Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the problem that theme assets could not be found after the first initialization #6049

Conversation

JohnNiang
Copy link
Member

What type of PR is this?

/kind bug
/area core
/milestone 2.17.x

What this PR does / why we need it:

When initialized for the first time, the folder ${halo.work-dir}/themes does not exist, resulting in the themes path being ignored when invoking themeRootResource.createRelative(themeName + "/templates/assets/");. It works very well after restarting.

This PR fixes the problem by resolving theme resource directly rather than delegating to PathResourceResolver.

Which issue(s) this PR fixes:

Fixes #6048

Does this PR introduce a user-facing change?

修复首次初始化后无法正常访问主题资源的问题

…initialization

Signed-off-by: JohnNiang <johnniang@foxmail.com>
@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Jun 6, 2024
@f2c-ci-robot f2c-ci-robot bot added this to the 2.17.x milestone Jun 6, 2024
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Jun 6, 2024
@JohnNiang
Copy link
Member Author

/cherrypick release-2.16

@halo-dev-bot
Copy link
Collaborator

@JohnNiang: once the present PR merges, I will cherry-pick it on top of release-2.16 in a new PR and assign it to you.

In response to this:

/cherrypick release-2.16

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@f2c-ci-robot f2c-ci-robot bot requested review from LIlGG and ruibaby June 6, 2024 16:24
Copy link

sonarcloud bot commented Jun 6, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.2% Duplication on New Code

See analysis details on SonarCloud

Copy link

codecov bot commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 28.57143% with 5 lines in your changes missing coverage. Please review.

Project coverage is 56.47%. Comparing base (5fdf6c0) to head (2275dad).
Report is 230 commits behind head on main.

Files Patch % Lines
.../halo/app/theme/config/ThemeWebFluxConfigurer.java 28.57% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6049      +/-   ##
============================================
- Coverage     56.91%   56.47%   -0.44%     
- Complexity     3319     3541     +222     
============================================
  Files           587      622      +35     
  Lines         18968    20957    +1989     
  Branches       1401     1478      +77     
============================================
+ Hits          10795    11836    +1041     
- Misses         7594     8521     +927     
- Partials        579      600      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Jun 7, 2024
Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link

f2c-ci-robot bot commented Jun 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ruibaby

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 7, 2024
@f2c-ci-robot f2c-ci-robot bot merged commit ccbe185 into halo-dev:main Jun 7, 2024
8 checks passed
@halo-dev-bot
Copy link
Collaborator

@JohnNiang: new pull request created: #6050

In response to this:

/cherrypick release-2.16

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@JohnNiang JohnNiang deleted the bug/theme-assets-not-found-after-system-init branch June 7, 2024 03:33
f2c-ci-robot bot pushed a commit that referenced this pull request Jun 7, 2024
…fter the first initialization (#6050)

This is an automated cherry-pick of #6049

/assign JohnNiang

```release-note
修复首次初始化后无法正常访问主题资源的问题
```
@ruibaby ruibaby modified the milestones: 2.17.x, 2.17.0 Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.16.1 初始化之后可能出现主题静态资源无法加载的问题
3 participants