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 roles could not be granted sometimes #6471

Merged
merged 8 commits into from
Aug 21, 2024

Conversation

JohnNiang
Copy link
Member

@JohnNiang JohnNiang commented Aug 15, 2024

What type of PR is this?

/kind improvement
/area core

What this PR does / why we need it:

This PR refactors searching roles by using index mechanism to speed up every request and fix the problem of not being able to grant roles to users sometimes.

Which issue(s) this PR fixes:

Fixes #5807
Fixes #4954
Fixes #5057

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/improvement Categorizes issue or PR as related to a improvement. labels Aug 15, 2024
@f2c-ci-robot f2c-ci-robot bot requested a review from guqing August 15, 2024 15:36
@f2c-ci-robot f2c-ci-robot bot added the area/core Issues or PRs related to the Halo Core label Aug 15, 2024
@f2c-ci-robot f2c-ci-robot bot requested a review from ruibaby August 15, 2024 15:36
@JohnNiang JohnNiang force-pushed the refactor/searching-roles branch from 2725829 to 9fe02f6 Compare August 16, 2024 09:11
@JohnNiang
Copy link
Member Author

/retitle Fix the problem that roles could not be granted sometimes

@f2c-ci-robot f2c-ci-robot bot changed the title WIP: Refactor searching roles by using index mechanism Fix the problem that roles could not be granted sometimes Aug 16, 2024
@f2c-ci-robot f2c-ci-robot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 16, 2024
@JohnNiang JohnNiang added the kind/bug Categorizes issue or PR as related to a bug. label Aug 16, 2024
Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 64.51613% with 99 lines in your changes missing coverage. Please review.

Project coverage is 58.16%. Comparing base (d19c27b) to head (ba05bb4).
Report is 6 commits behind head on main.

Files Patch % Lines
...app/core/extension/service/DefaultRoleService.java 51.28% 37 Missing and 1 partial ⚠️
.../app/core/extension/reconciler/UserReconciler.java 49.23% 29 Missing and 4 partials ⚠️
...halo/app/core/extension/endpoint/UserEndpoint.java 84.21% 10 Missing and 2 partials ⚠️
...ain/java/run/halo/app/infra/SchemeInitializer.java 75.00% 7 Missing ⚠️
...ain/java/run/halo/app/extension/ExtensionUtil.java 0.00% 4 Missing ⚠️
.../java/run/halo/app/core/extension/RoleBinding.java 0.00% 3 Missing ⚠️
...lo/app/core/extension/service/UserServiceImpl.java 89.47% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6471      +/-   ##
============================================
- Coverage     58.27%   58.16%   -0.12%     
+ Complexity     3783     3762      -21     
============================================
  Files           651      650       -1     
  Lines         22139    22106      -33     
  Branches       1555     1537      -18     
============================================
- Hits          12902    12857      -45     
- Misses         8613     8639      +26     
+ Partials        624      610      -14     

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

@JohnNiang JohnNiang changed the title Fix the problem that roles could not be granted sometimes WIP: Fix the problem that roles could not be granted sometimes Aug 19, 2024
@f2c-ci-robot f2c-ci-robot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 19, 2024
@JohnNiang JohnNiang changed the title WIP: Fix the problem that roles could not be granted sometimes Fix the problem that roles could not be granted sometimes Aug 19, 2024
@f2c-ci-robot f2c-ci-robot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 19, 2024
Signed-off-by: JohnNiang <[email protected]>
Copy link

Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

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

/approve

@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 Aug 20, 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

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

f2c-ci-robot bot commented Aug 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guqing, 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 merged commit 3a782be into halo-dev:main Aug 21, 2024
8 checks passed
@JohnNiang JohnNiang deleted the refactor/searching-roles branch August 21, 2024 03:36
@ruibaby ruibaby added this to the 2.19.0 milestone Aug 21, 2024
f2c-ci-robot bot pushed a commit that referenced this pull request Aug 27, 2024
…#6530)

#### What type of PR is this?

/kind bug
/area core
/milestone 2.19.0

#### What this PR does / why we need it:

This PR corrects list options builder for listing aggregated roles, because I wrongly used the label selector in <#6471>.

#### Special notes for your reviewer:

1. Try to install the plugin <https://www.halo.run/store/apps/app-YXyaD>
2. Enable the plugin and enable setting `匿名评论需要验证码`
3. **Anonymous** request any of posts with comment enabled
4. Check the captcha in comment area

#### Does this PR introduce a user-facing change?

```release-note
修复可能无法正常访问插件提供的接口的问题
```
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. 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
3 participants