feat(repo): Implement Repository Update Command#714
feat(repo): Implement Repository Update Command#714bhavyaKhatri2703 wants to merge 5 commits intogoharbor:mainfrom
Conversation
Signed-off-by: bhavyakhatri2703 <khatribhavya2703@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #714 +/- ##
=========================================
- Coverage 10.99% 7.41% -3.58%
=========================================
Files 173 263 +90
Lines 8671 13104 +4433
=========================================
+ Hits 953 972 +19
- Misses 7612 12023 +4411
- Partials 106 109 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
qcserestipy
left a comment
There was a problem hiding this comment.
Thank you for the contribution! I was wondering whether it makes sense to make --description flag optional and follow conventions for other update commands to open a view form where you can enter the description. Additionally, I guess it would be better to fetch the upstream repo api object first, update and then push the update instead of creating a new repo object without the other info. Could you also please add screenshots or a small screen record to demonstrate the working command.
cmd/harbor/root/repository/update.go
Outdated
| repoName = prompt.GetRepoNameFromUser(projectName) | ||
| } | ||
|
|
||
| if !cmd.Flags().Changed("description") { |
There was a problem hiding this comment.
It would be great to make the flag not mandatory but optional. In harbor-cli we usually open a small user tui for entering the information needed. For example see other update commands.
| return err | ||
| } | ||
|
|
||
| repo := &models.Repository{ |
There was a problem hiding this comment.
Here you are creating a new blank repository object without fetching the info of the already existing repo from the api. I would expect that this could lead to some issues. I think the correct behavior would be something like getting the repo object from the api, updating the description and then calling the update request to the api.
Signed-off-by: bhavyaKhatri2703 <khatribhavya2703@gmail.com>
Signed-off-by: bhavyaKhatri2703 <khatribhavya2703@gmail.com>
|
@qcserestipy can u pls have a look again ive made the changes suggested , thanks. |
fixes #710
This pr adds a repo update command which can update the description of a repository.