Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor: Add roles into the user response#1347

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 9 commits intomainfrombq/add-roles-in-user-response
May 9, 2022

Conversation

BrunoQuaresma
Copy link
Collaborator

Since the roles are already returned by the User model, we just need to parse it from a rbac.Role to codersdk.Role.

Closes#1346

@BrunoQuaresmaBrunoQuaresma requested review fromEmyrk anda teamMay 9, 2022 14:39
@BrunoQuaresmaBrunoQuaresma self-assigned thisMay 9, 2022
@BrunoQuaresmaBrunoQuaresma requested a review froma team as acode ownerMay 9, 2022 14:39
Copy link
Contributor

@presleyppresleyp left a comment

Choose a reason for hiding this comment

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

Frontend looks good!

Copy link
Member

@kylecarbskylecarbs left a comment

Choose a reason for hiding this comment

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

Just one tiny change!

@codecov
Copy link

codecovbot commentedMay 9, 2022
edited
Loading

Codecov Report

Merging#1347 (27e14bc) intomain (ad8d9dd) willdecrease coverage by0.01%.
The diff coverage is96.15%.

@@            Coverage Diff             @@##             main    #1347      +/-   ##==========================================- Coverage   66.44%   66.43%   -0.02%==========================================  Files         284      280       -4       Lines       18584    18393     -191       Branches      235      235              ==========================================- Hits        12349    12219     -130+ Misses       4967     4923      -44+ Partials     1268     1251      -17
FlagCoverage Δ
unittest-go-macos-latest53.60% <96.15%> (-0.11%)⬇️
unittest-go-postgres-65.16% <96.15%> (+0.02%)⬆️
unittest-go-ubuntu-latest56.11% <96.15%> (+0.09%)⬆️
unittest-go-windows-2022?
unittest-js73.67% <ø> (ø)
Impacted FilesCoverage Δ
codersdk/roles.go72.72% <ø> (-7.92%)⬇️
site/src/testHelpers/entities.ts100.00% <ø> (ø)
codersdk/users.go65.17% <80.00%> (ø)
coderd/roles.go100.00% <100.00%> (ø)
coderd/users.go61.74% <100.00%> (+0.38%)⬆️
cli/configssh.go62.04% <0.00%> (-6.57%)⬇️
coderd/httpapi/httpapi.go71.25% <0.00%> (-6.25%)⬇️
pty/ptytest/ptytest.go86.95% <0.00%> (-4.35%)⬇️
cli/templateinit.go58.62% <0.00%> (-3.45%)⬇️
provisioner/echo/serve.go54.40% <0.00%> (-2.40%)⬇️
... and10 more

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updatead8d9dd...27e14bc. Read thecomment docs.

@BrunoQuaresma
Copy link
CollaboratorAuthor

Interesting to see the JS tests failing because an API change 👏

}
}

func ConvertRoles(roles []rbac.Role) []codersdk.Role {
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be exported either!

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

We are using it for some tests here

ExpectedRoles:coderd.ConvertRoles(rbac.OrganizationRoles(admin.OrganizationID)),

Copy link
Member

Choose a reason for hiding this comment

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

We should never need to use internalcoderd APIs to check API responses, otherwise, our customers will have to as well!

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Thinking on:

  • Do not export the convert functions
  • Copy the convert functions into the role tests
  • See if we need restructure the tests at all

@BrunoQuaresmaBrunoQuaresmaenabled auto-merge (squash)May 9, 2022 16:38
@BrunoQuaresmaBrunoQuaresma merged commite54324d intomainMay 9, 2022
@BrunoQuaresmaBrunoQuaresma deleted the bq/add-roles-in-user-response branchMay 9, 2022 16:38
@missknissmisskniss added this to theV2 Beta milestoneMay 15, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@kylecarbskylecarbskylecarbs approved these changes

@presleyppresleyppresleyp approved these changes

@EmyrkEmyrkAwaiting requested review from Emyrk

Assignees

@BrunoQuaresmaBrunoQuaresma

Labels
None yet
Projects
None yet
Milestone
V2 Beta
Development

Successfully merging this pull request may close these issues.

Backend add roles to the User response
4 participants
@BrunoQuaresma@presleyp@kylecarbs@misskniss

[8]ページ先頭

©2009-2025 Movatter.jp