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

feat: add role information for user-related custom endpoint #3372

Merged
merged 9 commits into from
Feb 24, 2023

Conversation

guqing
Copy link
Member

@guqing guqing commented Feb 23, 2023

What type of PR is this?

/kind feature
/kind api-change
/area core
/milestone 2.3.x

What this PR does / why we need it:

获取用户信息的 API 响应体包含关联角色信息

  • 新增 API /apis/api.console.halo.run/v1alpha1/users/{name}
  • 修改了 API 的返回值类型 /apis/api.console.halo.run/v1alpha1/users/-

由于 API 响应体结构的改变,需要 Console 适配

Which issue(s) this PR fixes:

Fixes #3342

Special notes for your reviewer:

/cc @halo-dev/sig-halo

Does this PR introduce a user-facing change?

获取用户信息的 API 响应体包含关联角色信息

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Feb 23, 2023

@guqing: GitHub didn't allow me to request PR reviews from the following users: halo-dev/sig-halo.

Note that only halo-dev members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

What type of PR is this?

/kind feature
/kind api-change
/area core
/milestone 2.3.x

What this PR does / why we need it:

获取用户信息的 API 响应体包含关联角色信息

  • 新增 API /apis/api.console.halo.run/v1alpha1/users/{name}
  • 修改了 API 的返回值类型 /apis/api.console.halo.run/v1alpha1/users/-

由于 API 响应体结构的改变,需要 Console 适配

Which issue(s) this PR fixes:

Fixes #3342

Special notes for your reviewer:

/cc @halo-dev/sig-halo

Does this PR introduce a user-facing change?

获取用户信息的 API 响应体包含关联角色信息

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 added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Feb 23, 2023
@f2c-ci-robot f2c-ci-robot bot added this to the 2.3.x milestone Feb 23, 2023
@f2c-ci-robot f2c-ci-robot bot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API area/core Issues or PRs related to the Halo Core labels Feb 23, 2023
@ruibaby ruibaby changed the title feat: the API for retrieving user information returns role information feat: add role information for user-related custom endpoint Feb 23, 2023
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.

/approve

可以配合 halo-dev/console#882 测试。

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Feb 24, 2023

[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 Feb 24, 2023
f2c-ci-robot bot pushed a commit to halo-dev/console that referenced this pull request Feb 24, 2023
#### What type of PR is this?

/kind improvement

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

重构获取用户信息的请求方式,无需再请求所有角色即可获取当前用户的角色信息,适配:halo-dev/halo#3372

相关 PR:#847

#### Which issue(s) this PR fixes:

Fixes halo-dev/halo#3342

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 halo-dev/halo#3372 分支。
2. Console 需要 `pnpm install && pnpm build:packages`
3. 测试用户列表、登录、检查角色信息是否显示正确。

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

```release-note
优化 Console 端用户角色标识的显示名称。
```
@ruibaby ruibaby requested a review from JohnNiang February 24, 2023 06:23
@codecov
Copy link

codecov bot commented Feb 24, 2023

Codecov Report

Merging #3372 (0489675) into main (ce80ed4) will decrease coverage by 0.21%.
The diff coverage is 85.45%.

@@             Coverage Diff              @@
##               main    #3372      +/-   ##
============================================
- Coverage     60.99%   60.79%   -0.21%     
- Complexity     2490     2491       +1     
============================================
  Files           399      399              
  Lines         12664    12709      +45     
  Branches       1043     1044       +1     
============================================
+ Hits           7725     7727       +2     
- Misses         4431     4474      +43     
  Partials        508      508              
Impacted Files Coverage Δ
...app/core/extension/service/DefaultRoleService.java 73.68% <0.00%> (-4.10%) ⬇️
...halo/app/core/extension/endpoint/UserEndpoint.java 91.84% <88.00%> (-1.39%) ⬇️
...lo/app/core/extension/service/UserServiceImpl.java 94.11% <100.00%> (+0.24%) ⬆️
...halo/app/extension/gc/GcControllerInitializer.java 71.42% <0.00%> (-28.58%) ⬇️
...java/run/halo/app/extension/gc/GcSynchronizer.java 70.83% <0.00%> (-12.50%) ⬇️
...a/run/halo/app/metrics/VisitedEventReconciler.java 30.50% <0.00%> (-10.17%) ⬇️
.../halo/app/plugin/PluginCreatedEventReconciler.java 41.66% <0.00%> (-8.34%) ⬇️
...ava/run/halo/app/metrics/VotedEventReconciler.java 37.50% <0.00%> (-7.50%) ⬇️
src/main/java/run/halo/app/extension/Watcher.java 46.42% <0.00%> (-7.15%) ⬇️
...ava/run/halo/app/metrics/ReplyEventReconciler.java 35.71% <0.00%> (-7.15%) ⬇️
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@LIlGG
Copy link
Member

LIlGG commented Feb 24, 2023

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Feb 24, 2023
@JohnNiang JohnNiang merged commit c8f3229 into halo-dev:main Feb 24, 2023
@ruibaby ruibaby modified the milestones: 2.3.x, 2.3.0 Feb 24, 2023
@guqing guqing deleted the feature/3342 branch February 24, 2023 10:58
f2c-ci-robot bot pushed a commit to halo-dev/plugin-comment-widget that referenced this pull request Mar 1, 2023
修复由 halo-dev/halo#3372 导致获取用户错误的问题。

/kind bug

```release-note
None
```
JohnNiang pushed a commit to JohnNiang/halo that referenced this pull request Mar 2, 2023
#### What type of PR is this?

/kind improvement

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

重构获取用户信息的请求方式,无需再请求所有角色即可获取当前用户的角色信息,适配:halo-dev#3372

相关 PR:halo-dev/console#847

#### Which issue(s) this PR fixes:

Fixes halo-dev#3342

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 halo-dev#3372 分支。
2. Console 需要 `pnpm install && pnpm build:packages`
3. 测试用户列表、登录、检查角色信息是否显示正确。

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

```release-note
优化 Console 端用户角色标识的显示名称。
```
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/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. 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.

关于用户的接口,建议聚合返回用户的角色信息
4 participants