Skip to content

user: GetExecUser: rewrite with parseUserArg, parseGroupArg#231

Open
thaJeztah wants to merge 2 commits into
moby:mainfrom
thaJeztah:refactor_user
Open

user: GetExecUser: rewrite with parseUserArg, parseGroupArg#231
thaJeztah wants to merge 2 commits into
moby:mainfrom
thaJeztah:refactor_user

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

Use a similar approach as was applied to GetAdditionalGroups in 6eb9f15

Comment thread user/user.go Outdated
@thaJeztah thaJeztah changed the title [WIP] user: GetExecUser: rewrite with parseUserArg, parseGroupArg user: GetExecUser: rewrite with parseUserArg, parseGroupArg Jul 6, 2026
@thaJeztah thaJeztah marked this pull request as ready for review July 6, 2026 14:43
@thaJeztah thaJeztah requested a review from Copilot July 6, 2026 14:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Refactors GetExecUser to reuse shared parsing/matching helpers for user and group arguments, aligning the implementation approach with prior work done for additional group handling.

Changes:

  • Replaces inline numeric/name parsing in GetExecUser with parseUserArg / parseGroupArg and matches helpers.
  • Centralizes groupArg (and new userArg) parsing/matching helpers in user_utils.go.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
user/user.go Rewrites GetExecUser to use parsed user/group argument helpers for matching and error formatting.
user/user_utils.go Adds userArg and parseUserArg, and moves/extends group parsing helpers to support GetExecUser.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread user/user_utils.go Outdated
thaJeztah added 2 commits July 6, 2026 17:28
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
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.

2 participants