fix(robot_delete): adapt robot api handler for deletion by name; adapt robot delete commands for project and system to allow for deletion by name#563
Conversation
…t robot delete commands for project and system to allow for deletion by name Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR enables robot account deletion by name instead of ID for both project and system robots. The change improves usability by allowing users to reference robots using human-readable names rather than numeric IDs.
Key Changes:
- Added
GetRobotByNamefunction to resolve robot names to IDs - Updated deletion commands to accept robot names as arguments
- Updated all documentation to reflect the name-based deletion approach
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/api/robot_handler.go | Adds new GetRobotByName function to retrieve robot by name; removes trailing whitespace |
| cmd/harbor/root/robot/delete.go | Updates system robot delete command to accept names instead of IDs |
| cmd/harbor/root/project/robot/delete.go | Updates project robot delete command to accept names instead of IDs |
| doc/man-docs/man1/harbor-robot-delete.1 | Updates man page documentation to reflect name-based deletion |
| doc/man-docs/man1/harbor-project-robot-delete.1 | Updates project robot man page for name-based deletion |
| doc/cli-docs/harbor-robot.md | Updates CLI reference for robot commands |
| doc/cli-docs/harbor-robot-delete.md | Updates robot delete command documentation |
| doc/cli-docs/harbor-project-robot.md | Updates project robot command reference |
| doc/cli-docs/harbor-project-robot-delete.md | Updates project robot delete documentation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…se robot is not found by name Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #563 +/- ##
=========================================
- Coverage 10.99% 6.58% -4.41%
=========================================
Files 173 258 +85
Lines 8671 12566 +3895
=========================================
- Hits 953 828 -125
- Misses 7612 11632 +4020
Partials 106 106 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
…g in robot delete commands; handle robot names with and without prefix for deletion Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
bupd
left a comment
There was a problem hiding this comment.
@qcserestipy Thanks for your contribution
Added my suggestions for possible edge cases and improvements.
… accept returned robot object Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
|
@bupd Thank you for your review! I incorporated the changes accordingly. In case you have time feel free to have another look. |

Closes #555
Overview
This PR introduces changes to improve user experience for project and system robot deletion. It introduces the possibility to delete both kinds of robots by name instead of ID.
Behavior
Screen.Recording.2025-10-28.at.20.19.18.mov