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

refactor: add system initialization check and redirect to console if not initialized #3892

Merged
merged 1 commit into from May 4, 2023

Conversation

guqing
Copy link
Member

@guqing guqing commented May 4, 2023

What type of PR is this?

/kind improvement
/area core
/milestone 2.5.2

What this PR does / why we need it:

添加系统初始化检查,如果未初始化则重定向到控制台。

此检查只针对首页,当用户访问首页时检查到未初始化则跳转到 Console 让用户初始化以优化没有数据时的访问体验。

SetupStateCache 用于缓存系统初始化状态,当数据库状态改变时会更新缓存以优化性能,避免每次访问首页都查询数据。

Which issue(s) this PR fixes:

A part of #3230

Does this PR introduce a user-facing change?

支持系统初始化检查,如果未初始化则重定向到控制台。

@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/improvement Categorizes issue or PR as related to a improvement. labels May 4, 2023
@f2c-ci-robot f2c-ci-robot bot added this to the 2.5.2 milestone May 4, 2023
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label May 4, 2023
@f2c-ci-robot f2c-ci-robot bot requested review from lan-yonghui and ruibaby May 4, 2023 06:09
@codecov
Copy link

codecov bot commented May 4, 2023

Codecov Report

Merging #3892 (471cc7c) into main (0f03922) will decrease coverage by 0.01%.
The diff coverage is 52.63%.

@@             Coverage Diff              @@
##               main    #3892      +/-   ##
============================================
- Coverage     60.21%   60.20%   -0.01%     
- Complexity     2331     2340       +9     
============================================
  Files           351      353       +2     
  Lines         12045    12083      +38     
  Branches        877      878       +1     
============================================
+ Hits           7253     7275      +22     
- Misses         4363     4378      +15     
- Partials        429      430       +1     
Impacted Files Coverage Δ
.../main/java/run/halo/app/infra/SetupStateCache.java 32.00% <32.00%> (ø)
...o/app/security/InitializeRedirectionWebFilter.java 92.30% <92.30%> (ø)

... and 1 file with indirect coverage changes

Copy link
Member

@LIlGG LIlGG left a comment

Choose a reason for hiding this comment

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

/lgtm

在本地及 docker 下可以正常跳转

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label May 4, 2023
@ruibaby ruibaby modified the milestones: 2.5.2, 2.6.x May 4, 2023
@ruibaby
Copy link
Member

ruibaby commented May 4, 2023

/cherry-pick release-2.5

@halo-dev-bot
Copy link
Collaborator

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

In response to this:

/cherry-pick release-2.5

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.

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.

开发环境和 Docker 镜像均已测试,符合预期。

/lgtm

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented May 4, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LIlGG, 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 May 4, 2023
@f2c-ci-robot f2c-ci-robot bot merged commit a825050 into halo-dev:main May 4, 2023
4 checks passed
@halo-dev-bot
Copy link
Collaborator

@ruibaby: new pull request created: #3895

In response to this:

/cherry-pick release-2.5

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 bot pushed a commit that referenced this pull request May 4, 2023
…to console if not initialized (#3895)

This is an automated cherry-pick of #3892

/assign ruibaby

```release-note
添加系统初始化检查,如果未初始化则重定向到控制台
```
@guqing guqing deleted the feature/3230 branch May 4, 2023 07:53
@ruibaby ruibaby modified the milestones: 2.6.x, 2.6.0 May 10, 2023
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/improvement Categorizes issue or PR as related to a improvement. 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.

None yet

4 participants