Skip to content

Add: Project Robot Account Management commands#101

Closed
bupd wants to merge 11 commits into
goharbor:mainfrom
bupd:robots
Closed

Add: Project Robot Account Management commands#101
bupd wants to merge 11 commits into
goharbor:mainfrom
bupd:robots

Conversation

@bupd

@bupd bupd commented Jun 2, 2024

Copy link
Copy Markdown
Member

Fixes #100

This PR adds system robot account cmds to manage project wide robot accounts in harbor cli.

Commands to implement:

  • harbor project robot list -- list robot accounts
  • harbor project robot get -- get a robot account
  • harbor project robot delete -- delete robot account
  • harbor project robot create -- create a robot account
  • harbor project robot refresh -- refresh the secret of robot account
  • harbor project robot update -- update a robot account

This PR handles project wide robot accounts.

@bupd bupd force-pushed the robots branch 2 times, most recently from 3086a3f to 069253e Compare June 2, 2024 23:03
@bupd bupd changed the title Add: robot commands Add: Project Robot Account Management commands Jun 2, 2024
@bupd bupd force-pushed the robots branch 2 times, most recently from 0d6d134 to a0a9b98 Compare June 4, 2024 20:27
@bupd bupd marked this pull request as ready for review June 4, 2024 20:28
@bupd

bupd commented Jun 7, 2024

Copy link
Copy Markdown
Member Author

Screenshots:

Robot List:

robotList

Robot View:

robotView

Robot Create:

robotCreate

Robot Refresh:

robotRefresh

Robot Update:

robotUpdate

Robot Delete:

robotDelete

@Vad1mo

Vad1mo commented Apr 22, 2025

Copy link
Copy Markdown
Member

@bupd can you rebase

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces project-wide robot account management commands to the harbor CLI. It adds new CLI commands for listing, viewing, creating, updating, refreshing, and deleting robot accounts, along with corresponding interactive views and API handlers.

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/views/styles.go Added WhiteStyle for styling consistency.
pkg/views/robot/update/view.go Implements interactive update form for robot accounts.
pkg/views/robot/select/view.go Adds selection views for robot permissions and accounts.
pkg/views/robot/list/view.go Implements listing view with formatted robot account details.
pkg/views/robot/create/view.go Provides interactive form for creating robot accounts.
pkg/views/project/select/view.go Enhances project selection with an additional ProjectListID.
pkg/views/base/multiselect/model.go Adds multiselect model for picking permissions.
pkg/utils/utils.go Adds utilities for saving JSON payloads and reading secrets.
pkg/prompt/prompt.go Updates prompt logic for retrieving project and robot IDs and permissions.
pkg/constants/constants.go Introduces new constants related to robot and project query strings.
pkg/api/robot_handler.go Implements API handlers for robot commands (list, get, create, update, delete, refresh).
cmd/harbor/root/project/robot/view.go Implements “view” command for fetching and displaying robot details.
cmd/harbor/root/project/robot/update.go Implements “update” command with an interactive view for updating robot accounts.
cmd/harbor/root/project/robot/refresh.go Implements “refresh” command to update the robot secret with clipboard support.
cmd/harbor/root/project/robot/list.go Implements “list” command for displaying robot accounts.
cmd/harbor/root/project/robot/delete.go Implements “delete” command for removing a robot account.
cmd/harbor/root/project/robot/create.go Implements “create” command with interactive prompts and secret management.
cmd/harbor/root/project/robot.go Aggregates all robot account commands under the “robot” subcommand.
cmd/harbor/root/project/cmd.go Updates the project command to include robot account management.

Comment thread pkg/views/robot/list/view.go
Comment thread cmd/harbor/root/project/robot/create.go Outdated
bupd added 8 commits May 2, 2025 05:23
Signed-off-by: bupd <bupdprasanth@gmail.com>
This commit adds delete and get project robot accounts cmds

Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
bupd added 3 commits May 2, 2025 05:46
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
@bupd bupd added the Changes Requesed feedback that must be addressed before merging. label Jun 4, 2025
@qcserestipy

Copy link
Copy Markdown
Collaborator

@bupd
I’ve just pulled your robots branch into my fork, rebased it onto the current main, and started extending the permission-selection logic we discussed yesterday.

Would you prefer that I:

  1. open a fresh PR from my fork (so you can review the changes in isolation), and
  2. reference that new PR back here for context?

Happy to follow whichever workflow works best for you—just let me know. 🙌

@bupd

bupd commented Jun 5, 2025

Copy link
Copy Markdown
Member Author

Both create a new PR and also reference it here

Thanks

@bupd

bupd commented Jun 10, 2025

Copy link
Copy Markdown
Member Author

closing in favor of #489

@bupd bupd closed this Jun 10, 2025
@bupd bupd deleted the robots branch June 17, 2025 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changes Requesed feedback that must be addressed before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Robot Accounts in CLI

4 participants