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

Show the subject display name along with the ID in minder role #3772

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

rdimitrov
Copy link
Member

Summary

The following PR includes the subject display name when listing or updating role assignments. Previously it was just the ID.

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

@rdimitrov rdimitrov requested a review from a team as a code owner July 3, 2024 12:08
@@ -81,7 +81,7 @@ func GrantListCommand(ctx context.Context, cmd *cobra.Command, _ []string, conn
case app.Table:
t := initializeTableForGrantListRoleAssignments()
for _, r := range resp.RoleAssignments {
t.AddRow(r.Subject, r.Role, *r.Project)
t.AddRow(fmt.Sprintf("%s / %s", r.DisplayName, r.Subject), r.Role, *r.Project)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think it's worth adding another column to the table, because the current column title is "Subject" and with this change it will contain both the subject and the display name.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did do it like that initially, but it stretched the table too much, so I thought to reuse what we do in the auth command (where projects are displayed in a similar pattern - project_name / project_id). I can make it in the other way if you think it would be better 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we include both in the same column, but change the title from "Subject" to "User"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good 👍 I'll push a commit 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Done 👍

@coveralls
Copy link

Coverage Status

coverage: 51.884% (-0.004%) from 51.888%
when pulling 401f927 on subject-display-name
into a75c435 on main.

@coveralls
Copy link

Coverage Status

coverage: 51.898% (+0.01%) from 51.888%
when pulling 401f927 on subject-display-name
into a75c435 on main.

Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
@coveralls
Copy link

Coverage Status

coverage: 51.884% (-0.004%) from 51.888%
when pulling 5ec224f on subject-display-name
into a75c435 on main.

@rdimitrov rdimitrov merged commit 924bd1a into main Jul 3, 2024
21 checks passed
@rdimitrov rdimitrov deleted the subject-display-name branch July 3, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants