Skip to content

Add Project Member Management Commands#85

Closed
bupd wants to merge 12 commits into
goharbor:mainfrom
bupd:member
Closed

Add Project Member Management Commands#85
bupd wants to merge 12 commits into
goharbor:mainfrom
bupd:member

Conversation

@bupd

@bupd bupd commented May 28, 2024

Copy link
Copy Markdown
Member

Overview:

The current CLI lacks the ability to manage project members, a feature already present in the WebUI.
Adding a member command will significantly enhance the CLI's functionality, making it a powerful tool for handling project members directly from the command line.

This addition will facilitate easier and more efficient management of project members, aligning the CLI's capabilities with those of the WebUI.

New Commands:

The member command will include the following subcommands:

  • list: List all members in the project.

    • Usage: harbor member list <project_name_or_id>
    • Description: Retrieves and displays a list of all members in the specified project.
  • create: Create a new member in the project.

    • Usage: harbor member create <project_name_or_id>
    • Description: Adds a new member to the specified project using the provided member information.
  • delete: Delete a member from the project.

    • Usage: harbor member delete <project_name_or_id> <member_id>
    • Description: Removes specified members from the project.
  • view: View details of a specific member.

    • Usage: harbor member view <project_name_or_id> <member_id>
    • Description: Retrieves and displays detailed information about a specific project member.
  • update: Update an existing member in the project.

    • Usage: harbor member update <project_name_or_id> <member_id>
    • Description: Updates the details of an existing project member with the provided information.

This PR adds the commands to manage project members.

@bupd bupd changed the title feat: Add Project Member Management Commands [WIP]: Add Project Member Management Commands May 28, 2024
@Vad1mo

Vad1mo commented May 28, 2024

Copy link
Copy Markdown
Member

Also you need to consider the group memberships, especially in the context of OIDC and LDAP a few things might behaive differently

@bupd

bupd commented May 28, 2024

Copy link
Copy Markdown
Member Author

Thank you for bringing up group memberships. That is a valid point and crucial for comprehensive member management. I will take that into consideration as I continue to develop this feature.

@bupd

bupd commented May 29, 2024

Copy link
Copy Markdown
Member Author

List:

memberList

Create:

memberCreate

Delete:

memberDelete

@bupd

bupd commented May 29, 2024

Copy link
Copy Markdown
Member Author

Update:

MemberUpdate

View:

memberView

@bupd bupd marked this pull request as ready for review May 29, 2024 11:14
@bupd bupd changed the title [WIP]: Add Project Member Management Commands Add Project Member Management Commands May 29, 2024
@bupd

bupd commented May 29, 2024

Copy link
Copy Markdown
Member Author

This PR #85 is ready for review @Vad1mo

Comment thread pkg/views/member/list/view.go Outdated
Comment thread pkg/views/member/select/view.go Outdated
Comment thread pkg/views/member/view/view.go Outdated
Comment thread cmd/harbor/root/member/delete.go Outdated
Comment thread cmd/harbor/root/member/list.go Outdated
Comment thread pkg/api/member_handler.go Outdated
Comment thread cmd/harbor/root/cmd.go Outdated

@ambahman ambahman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Member cmd should be subcommand of the project .

@Vad1mo

Vad1mo commented May 30, 2024

Copy link
Copy Markdown
Member

I agree. lets follow the UI here.

@bupd bupd force-pushed the member branch 2 times, most recently from 24b5c62 to a19ce3c Compare May 30, 2024 22:56
@bupd

bupd commented May 30, 2024

Copy link
Copy Markdown
Member Author

Added & updated with new changes.
This PR is ready to be merged.

Thanks.

Comment thread pkg/views/member/list/view.go Outdated
Comment thread pkg/views/member/view/view.go Outdated
Comment thread cmd/harbor/root/project/member/cmd.go
@bupd bupd force-pushed the member branch 2 times, most recently from 4a47106 to 7ad5782 Compare May 31, 2024 07:18
@Vad1mo

Vad1mo commented Jun 10, 2024

Copy link
Copy Markdown
Member

Add Users or groups to project
in the wizard it is not clear for the user what are the mandatory fields and what fields are alternatives like user_id and user_name (only one is needed),

  • same is for the group

image

Group Type

  • The group type depends on the auth mode, it is not selectable.

Conclusion

My recommendation is that in the Wizard flow we should guide the user more.
In the cli flags mode we can be more flexible, but should indicate which options can be one the other like user_id and user_name. Where one is mandatory. this should be visible in the wizard and cli mode.

@bupd bupd marked this pull request as draft July 26, 2024 13:33
@Vad1mo

Vad1mo commented Apr 29, 2025

Copy link
Copy Markdown
Member

This needs to be reworked and adapted to the new code...

@Vad1mo Vad1mo added the Changes Requesed feedback that must be addressed before merging. label Apr 29, 2025
@afeefuddin

Copy link
Copy Markdown
Contributor

Hey @bupd are you actively working on this? If you aren't, can I pick this up?

bupd added 5 commits July 7, 2025 11:38
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
bupd added 2 commits July 7, 2025 12:03
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
@codecov

codecov Bot commented Jul 7, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 663 lines in your changes missing coverage. Please review.
✅ Project coverage is 7.69%. Comparing base (60ad0bd) to head (54ed315).
⚠️ Report is 47 commits behind head on main.

Files with missing lines Patch % Lines
pkg/api/member_handler.go 0.00% 148 Missing ⚠️
cmd/harbor/root/project/member/create.go 0.00% 68 Missing ⚠️
pkg/views/member/create/view.go 0.00% 55 Missing ⚠️
cmd/harbor/root/project/member/delete.go 0.00% 48 Missing ⚠️
cmd/harbor/root/project/member/list.go 0.00% 43 Missing ⚠️
cmd/harbor/root/project/member/view.go 0.00% 43 Missing ⚠️
cmd/harbor/root/project/member/update.go 0.00% 42 Missing ⚠️
pkg/views/member/select/view.go 0.00% 42 Missing ⚠️
pkg/views/member/list/view.go 0.00% 40 Missing ⚠️
pkg/views/member/view/view.go 0.00% 40 Missing ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff            @@
##             main     #85      +/-   ##
=========================================
- Coverage   10.99%   7.69%   -3.30%     
=========================================
  Files         173     222      +49     
  Lines        8671   12593    +3922     
=========================================
+ Hits          953     969      +16     
- Misses       7612   11519    +3907     
+ Partials      106     105       -1     

☔ 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.

bupd added 5 commits July 7, 2025 12:13
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Improves the member deletion workflow by refactoring the command-line interface and API handler. This change simplifies the user prompt and clarifies the deletion logic.
@NucleoFusion

Copy link
Copy Markdown
Contributor

Hi, I am looking to contribute to this
What all exactly is left?

@bupd

bupd commented Aug 12, 2025

Copy link
Copy Markdown
Member Author

Hello @NucleoFusion, good to see that you are interested. We Need to rebase and update the PR to the current standards of the repo.

@NucleoFusion

Copy link
Copy Markdown
Contributor

This has been completely implemented in #540
Seems good to close!

@bupd bupd closed this Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changes Requesed feedback that must be addressed before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants