added tag retention tasks list subcommand#954
Conversation
Signed-off-by: Nishchay Rajput <nishchayr@iitbhilai.ac.in>
cba1786 to
a8299ba
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #954 +/- ##
=========================================
- Coverage 10.99% 8.50% -2.49%
=========================================
Files 173 320 +147
Lines 8671 15953 +7282
=========================================
+ Hits 953 1357 +404
- Misses 7612 14470 +6858
- Partials 106 126 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| cmd := &cobra.Command{ | ||
| Use: "tasks", | ||
| Short: "Manage retention execution tasks", | ||
| Long: "List retention execution tasks", |
There was a problem hiding this comment.
this shouldnt mention only list, that should be in the ListCommand()
| cmd.Flags().IntVarP(&projectID, "project-id", "i", -1, "Project ID") | ||
| cmd.Flags().Int64VarP(&executionID, "execution-id", "e", -1, "Retention execution ID") |
There was a problem hiding this comment.
I think taking defaults to be 0 (as ints usually are) and then adding an extra validation somewhere that they arent negative might be the play.
So, we can check if its == 0 instead of == -1 and then also raise an invalid error if < 0.
| if <-length == 0 { | ||
| return 0 | ||
| } | ||
|
|
There was a problem hiding this comment.
You can just make this not be in a goroutine
Just use normally, since this isnt really async anyway.
Description
Briefly describe what this pull request does and why the change is needed.
This PR adds the
harbor tag retention tasks listsubcommand to display retention execution tasks for a specific retention policy execution.It enables users to view and inspect individual tasks from a retention policy execution, showing details such as task ID, repository, status, retention metrics, and timing information.
Type of Change
Please select the relevant type.
Changes
harbor tag retention taskscommand group underharbor tag retention.harbor tag retention tasks list [PROJECT_NAME]with:--output-format jsonListRetentionExecutions()- fetch retention executions for a policyListRetentionTasks()- fetch tasks for a specific executionRetentionExecutionList()- interactive selection view for executionsRetentionTaskList()- task details table viewGetRetentionExecutionIDFromUser()- interactive execution selection