feat(repo): Implement Repository Update Command#714
feat(repo): Implement Repository Update Command#714bhavyaKhatri2703 wants to merge 2 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.21% -3.78%
=========================================
Files 173 261 +88
Lines 8671 12962 +4291
=========================================
- Hits 953 935 -18
- Misses 7612 11919 +4307
- Partials 106 108 +2 ☔ 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.
| 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.
fixes #710
This pr adds a repo update command which can update the description of a repository.