feat: add project config command#448
Conversation
Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
It is beneficial when a project's name is same as another project's ID. Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
…e` and `list` command. Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
…n and addition of the flag in the command in the `cmd.go` file. Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: muaz-32 <96006730+muaz-32@users.noreply.github.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
@rizul2108 Please add a clear PR description of changes made and Screenshots of the working cmd |
|
I am currently working on this. It is not ready for review yet. It needs major changes so i am implementing those currently Sorry I forgot to mark it as draft doing it just now |
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
|
I'm a bit confused about the implementation of the The URL we are referring to is: https://demo.goharbor.io/harbor/projects/1650/configs From observing this UI, it seems that the API requests made for updating project configurations are not just targeting metadata (i.e., To modify the CVE allowlist, we would need to make a This raises a question: Additionally, for the So my main confusion is: Does this implementation approach — where the |
@rizul2108 I suggest we don't need to worry about the cve-allowlist in project config
For now, we can focus on having Hope this helps. Thanks |
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
|
There is no option to update more than 1 metadata fields in the metadata API requests |
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new command group for managing Harbor project configuration, including interactive updates and listing of project metadata. Key changes include:
- New views for updating and listing configuration (under pkg/views/project/config).
- Updated API handlers for configuration management (under pkg/api).
- CLI and manual documentation updates, along with new commands integrated into the project subcommands.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/views/project/config/update/view.go | Implements the interactive update view for project configuration. |
| pkg/views/project/config/list/view.go | Implements the interactive list view for project configuration. |
| pkg/api/project_config_handler.go | Provides API methods to list and update project configuration. |
| doc/man-docs/*.1 | New man pages covering the config commands. |
| doc/cli-docs/*.md | Updated CLI documentation for the new config commands. |
| cmd/harbor/root/project/config/*.go | Implements and integrates the update and list commands into the CLI. |
| cmd/harbor/root/project/cmd.go | Adds the new project config subcommand to the root project command. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Rizul Gupta <112455393+rizul2108@users.noreply.github.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
bupd
left a comment
There was a problem hiding this comment.
@rizul2108 please fix the suggestions
| var err error | ||
| var projectNameorID string | ||
| cmd := &cobra.Command{ | ||
| Use: "list [NAME|ID]", |
There was a problem hiding this comment.
Accept only name as an argument and users can give id via flags.
There was a problem hiding this comment.
Yes, I gave that feature already. I gave ID as a persistent flag in the config subcommand rather than mentioning it in each sub-command under the config.
There was a problem hiding this comment.
I will improve the use description in each command
resolve errors Signed-off-by: Rizul Gupta <mail2rizul@gmail.com> add docs Signed-off-by: Rizul Gupta <mail2rizul@gmail.com> add docs Signed-off-by: Rizul Gupta <mail2rizul@gmail.com> update docs Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
|
@bupd resolved errors |
|
@bupd can you review and approve this PR? |

Introduces the
project configcommand, enabling users to manage Harbor project configurations like in UIFeatures added:
harbor project configManage project configuration with support for specifying projects by name or ID.
Includes options:
--idto use project ID instead of project nameharbor project config list— List current configuration of a Harbor projectharbor project config update— Update project configuration interactively or via flagsFix #91