feat: add webhook cmd#391
Conversation
Signed-off-by: 35C4n0r <jaykumar20march@gmail.com>
Signed-off-by: 35C4n0r <jaykumar20march@gmail.com>
Signed-off-by: 35C4n0r <jaykumar20march@gmail.com>
Signed-off-by: 35C4n0r <jaykumar20march@gmail.com>
Signed-off-by: 35C4n0r <jaykumar20march@gmail.com>
Signed-off-by: 35C4n0r <jaykumar20march@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>
Screencast.from.12-04-25.11.27.17.AM.IST.webm |
|
@bupd ready for review |
There was a problem hiding this comment.
Copilot reviewed 19 out of 24 changed files in this pull request and generated 1 comment.
Files not reviewed (5)
- doc/man-docs/man1/harbor-webhook-create.1: Language not supported
- doc/man-docs/man1/harbor-webhook-delete.1: Language not supported
- doc/man-docs/man1/harbor-webhook-edit.1: Language not supported
- doc/man-docs/man1/harbor-webhook-list.1: Language not supported
- doc/man-docs/man1/harbor-webhook.1: Language not supported
Comments suppressed due to low confidence (1)
cmd/harbor/root/webhook/delete.go:67
- [nitpick] The flag name 'webhook' is inconsistent with other commands (e.g., edit uses '--webhook-id'); consider renaming it to '--webhook-id' for clarity and consistency.
flags.StringVarP(&webhookId, "webhook", "", "", "Webhook ID")
bupd
left a comment
There was a problem hiding this comment.
same here need better validation
and also screenshots of each cmd working
I have added the screen-recording of working of the command instead of screenshots does it work |
78b73eb to
faf959e
Compare
support yaml Signed-off-by: Rizul Gupta <mail2rizul@gmail.com> add valiators Signed-off-by: Rizul Gupta <mail2rizul@gmail.com> small fix Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
c4da5a6 to
89067ab
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR continues the work from PR #166 by introducing webhook commands and enhancing input validation for Harbor CLI.
- Added URL and empty string validator utilities in pkg/utils/helper.go
- Introduced new webhook-related CLI commands (list, create, edit, delete) and integrated them with the API and interactive prompt
- Updated and extended the CLI documentation to cover the new webhook functionality
Reviewed Changes
Copilot reviewed 19 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/utils/helper.go | New helper functions for URL validation and empty string checking |
| pkg/prompt/prompt.go | Added GetWebhookFromUser for interactive selection of webhook |
| pkg/api/webhook_handler.go | Implements listing, creating, deleting, and updating webhook policies |
| doc/cli-docs/*.md | Updated CLI docs to include webhook commands |
| cmd/harbor/root/webhook/*.go | New commands for managing webhooks (list, create, edit, delete) |
| cmd/harbor/root/cmd.go | Registered the new webhook command with the root command |
Files not reviewed (5)
- doc/man-docs/man1/harbor-webhook-create.1: Language not supported
- doc/man-docs/man1/harbor-webhook-delete.1: Language not supported
- doc/man-docs/man1/harbor-webhook-edit.1: Language not supported
- doc/man-docs/man1/harbor-webhook-list.1: Language not supported
- doc/man-docs/man1/harbor-webhook.1: Language not supported
Comments suppressed due to low confidence (1)
cmd/harbor/root/webhook/delete.go:67
- The flag for the webhook ID is named 'webhook', whereas in the edit command it is 'webhook-id'. Standardizing the flag naming across commands would improve clarity and consistency.
flags.StringVarP(&webhookId, "webhook", "", "", "Webhook ID")
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 <112455393+rizul2108@users.noreply.github.com>
…to continue-webhook
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This pull request continues the work from #166 by resolving merge conflicts and adding new commands and documentation for managing webhooks in Harbor.
- Resolved merge conflicts from a previous PR
- Added implementation for webhook commands in the CLI (list, create, edit, delete)
- Updated documentation to cover new webhook functionalities
Reviewed Changes
Copilot reviewed 20 out of 25 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/utils/helper.go | Added EmptyStringValidator helper function |
| pkg/prompt/prompt.go | Introduced GetWebhookFromUser for interactive webhook selection |
| pkg/api/webhook_handler.go | Added webhook API functions (list, create, update, delete) |
| doc/cli-docs/*.md | Updated and added CLI documentation for webhook commands |
| cmd/harbor/root/webhook/*.go | Implemented CLI commands for webhook management |
| cmd/harbor/root/cmd.go | Integrated webhook command into the main CLI command structure |
Files not reviewed (5)
- doc/man-docs/man1/harbor-webhook-create.1: Language not supported
- doc/man-docs/man1/harbor-webhook-delete.1: Language not supported
- doc/man-docs/man1/harbor-webhook-edit.1: Language not supported
- doc/man-docs/man1/harbor-webhook-list.1: Language not supported
- doc/man-docs/man1/harbor-webhook.1: Language not supported
bupd
left a comment
There was a problem hiding this comment.
I have some ideas for improvement.
- please maintain consistency among other commands.
❯ ./bin/harbor-dev webhook edit --project kumar --name paandi --description updatethe edit cmd spawns project selection eventhough I specified the project. |
fix edit sub-cmd Signed-off-by: Rizul Gupta <mail2rizul@gmail.com> implement changes Signed-off-by: Rizul Gupta <mail2rizul@gmail.com> lint fix Signed-off-by: Rizul Gupta <mail2rizul@gmail.com> left align fix Signed-off-by: Rizul Gupta <mail2rizul@gmail.com> fix left alignment Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
6622ca1 to
8d7691a
Compare
webhook cmdtest create cmd Signed-off-by: Rizul Gupta <mail2rizul@gmail.com> test all cmds Signed-off-by: Rizul Gupta <mail2rizul@gmail.com> lint fix Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
3ea1b26 to
12c3c2f
Compare
Signed-off-by: Rizul Gupta <112455393+rizul2108@users.noreply.github.com>
Signed-off-by: Rizul Gupta <mail2rizul@gmail.com>
|
@Vad1mo ready to merge |
Description
This pull request continues the work initiated in #166
Changes and Improvements