[bug]: project member update prints incorrect role ID in success message

Open Beginner friendly
#1,063 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
go
Domain
cli

Research direction

Start in cmd/harbor/root/project/member/update.go and inspect the success message after the project member update completes. Reproduce the command with --roleid 2, then verify the message displays the numeric role ID 2 instead of the formatting error.

Written by the indexing model from the issue text.

Description

bug

Description

The project member update command prints an incorrect role ID in its success message after successfully updating a project member.

The success message formats a *models.RoleRequest value using the %d formatting verb instead of printing the numeric role ID.

Steps to Reproduce

  1. Configure Harbor CLI with a working Harbor instance.
  2. Run command:
    harbor project member update <project-name> <member-name> --roleid 2
    
  3. Observe the success message after the update completes successfully.

Expected Behavior

The success message should display the numeric role ID.

Example:

successfully updated user with ID 1 with role ID 2 for project my-project

Actual Behavior

The success message attempts to format a *models.RoleRequest using %d, resulting in incorrect output instead of the numeric role ID.

Example:

successfully updated user with ID 1 with role ID %!d(*models.RoleRequest=...) for project my-project

Environment

  • OS: Windows
  • Tool version: Current main branch
  • Other relevant details: Issue located in cmd/harbor/root/project/member/update.go

Additional Context

The success message currently passes opts.RoleID (type *models.RoleRequest) to fmt.Printf using the %d format verb. The success message should print the numeric role ID instead.

Dominant language
Go
Stars
163
Forks
212
Avg merge
1m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from goharbor/harbor-cli

All issues in goharbor/harbor-cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.