Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

feat(pkg/api/user): if given user is @me, translate to current user #438

Merged
merged 1 commit into from Dec 28, 2020

Conversation

maxice8
Copy link
Collaborator

@maxice8 maxice8 commented Dec 28, 2020

Description

this translates a value of '@me' to the currently authenticated user

Related Issue

Resolves #436

How Has This Been Tested?

Created issue on a gitlab repo related to myself.

See: https://gitlab.alpinelinux.org/Leo/agl/-/issues/9

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)

@maxice8
Copy link
Collaborator Author

maxice8 commented Dec 28, 2020

We might want to instead modify api.UsersByNames

@maxice8 maxice8 changed the title feat(commands/issue/create): use '@me' to assign issue to oneself feat(pkg/api/user): if given user is @me, translate to current user Dec 28, 2020
@maxice8
Copy link
Collaborator Author

maxice8 commented Dec 28, 2020

@profclems, this affects everything that uses api.UserByName, and api.UsersByName uses it so the affected places are:

commands/mr/update/mr_update.go:				users, err := api.UsersByNames(apiClient, assignees)
commands/mr/create/mr_create.go:				users, err := api.UsersByNames(labClient, opts.Assignees)
commands/issue/create/issue_create.go:			users, err := api.UsersByNames(apiClient, opts.Assignees)
commands/mr/list/mr_list.go:				users, err := api.UsersByNames(apiClient, assigneeNames)

@profclems
Copy link
Owner

@profclems, this affects everything that uses api.UserByName, and api.UsersByName uses it so the affected places are:

commands/mr/update/mr_update.go:				users, err := api.UsersByNames(apiClient, assignees)
commands/mr/create/mr_create.go:				users, err := api.UsersByNames(labClient, opts.Assignees)
commands/issue/create/issue_create.go:			users, err := api.UsersByNames(apiClient, opts.Assignees)
commands/mr/list/mr_list.go:				users, err := api.UsersByNames(apiClient, assigneeNames)

Great one! I like this solution.

@profclems profclems added this to In progress 📈 in GLab: A GitLab CLI Tool via automation Dec 28, 2020
@profclems profclems added the enhancement New feature or request label Dec 28, 2020
@profclems profclems merged commit 98f77aa into profclems:trunk Dec 28, 2020
GLab: A GitLab CLI Tool automation moved this from In progress 📈 to Pending Release 🗞️ Dec 28, 2020
@clemsbot clemsbot moved this from Pending Release 🗞️ to Done 🤝 in GLab: A GitLab CLI Tool Dec 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request size/XS
Projects
Development

Successfully merging this pull request may close these issues.

Special @me to create self-assigned issues
2 participants