refactor(robot): dynamically fetch and sort permissions with improved error handling#690
Open
qcserestipy wants to merge 1 commit intogoharbor:mainfrom
Open
refactor(robot): dynamically fetch and sort permissions with improved error handling#690qcserestipy wants to merge 1 commit intogoharbor:mainfrom
qcserestipy wants to merge 1 commit intogoharbor:mainfrom
Conversation
… error handling - Fetch available permissions and actions from API instead of using hardcoded values - Sort resources and actions deterministically for reliable UI presentation - Introduce PermissionSelectResult struct for proper error propagation in channel - Support both 'project' and 'system' permission kinds - Remove os.Exit() calls in favor of channel-based error handling Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #690 +/- ##
=========================================
- Coverage 10.99% 7.16% -3.83%
=========================================
Files 173 260 +87
Lines 8671 12860 +4189
=========================================
- Hits 953 922 -31
- Misses 7612 11830 +4218
- Partials 106 108 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
NucleoFusion
suggested changes
Feb 7, 2026
Contributor
NucleoFusion
left a comment
There was a problem hiding this comment.
Looks pretty good!
We could also handle the api.GetPermissions() error here in my opinion
Comment on lines
322
to
323
| response, _ := api.GetPermissions() | ||
| robotView.ListPermissions(response.Payload, kind, permissions) |
Contributor
There was a problem hiding this comment.
Could we integrate the api.GetPermissions error to be returned here as well?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR does not change the functionality, but refactors the
NewRobotPermissionsGridin the robot permission selection. Before it was relying on hard coded actions and permissions for the table creation. This information is now retrieved directly from the harbor api as the permission spec might change in the future and hard coded parts break. Additionally, the go routine passes a customn struct that allows for more cleaner error handling than justos.Exiton failureChanges