Skip to content

feat(repo): Implement Repository Update Command#714

Open
bhavyaKhatri2703 wants to merge 2 commits intogoharbor:mainfrom
bhavyaKhatri2703:feat(repo)/Implement-repository-update-cmd
Open

feat(repo): Implement Repository Update Command#714
bhavyaKhatri2703 wants to merge 2 commits intogoharbor:mainfrom
bhavyaKhatri2703:feat(repo)/Implement-repository-update-cmd

Conversation

@bhavyaKhatri2703
Copy link

fixes #710

This pr adds a repo update command which can update the description of a repository.

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 0% with 49 lines in your changes missing coverage. Please review.
✅ Project coverage is 7.21%. Comparing base (60ad0bd) to head (7f4f12a).
⚠️ Report is 98 commits behind head on main.

Files with missing lines Patch % Lines
cmd/harbor/root/repository/update.go 0.00% 34 Missing ⚠️
pkg/api/repository_handler.go 0.00% 14 Missing ⚠️
cmd/harbor/root/repository/cmd.go 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@qcserestipy qcserestipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement repository update cmd

2 participants