Skip to content

Exclude the current user from reviewers when creating pr - #6464

Merged
samcoe merged 5 commits into
cli:trunkfrom
nsmag:exclude-current-user-from-reviewers
Dec 8, 2022
Merged

samcoe merged 5 commits into
cli:trunkfrom
nsmag:exclude-current-user-from-reviewers

Conversation

@nsmag

@nsmag nsmag commented Oct 19, 2022 •

Copy link
Copy Markdown
Contributor

Fixes #6436

Example from my test repo (there's only me as an assignable user):

$ bin/gh pr create -R nsmag/test -H foo

Creating pull request for foo into main in nsmag/test

? Title Foo
? Body <Received>
? What's next? Add metadata
? What would you like to add? Reviewers, Assignees
warning: no available reviewers
? Assignees [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
> [ ]  nsmag (Natthakit Susanthitanon)

@nsmag
nsmag requested a review from a team as a code owner October 19, 2022 09:42
@nsmag
nsmag requested review from mislav and removed request for a team October 19, 2022 09:42
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Oct 19, 2022
Comment thread pkg/cmd/pr/shared/survey_test.go Outdated
}

func (mf *metadataFetcher) currentUserID() (string, error) {
return "1", nil

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just make the tests pass. I don't know how to add a useful test for this.

This should make the options for reviewers show only monalisa.

@samcoe samcoe self-assigned this Nov 16, 2022
@samcoe
samcoe self-requested a review November 16, 2022 08:52

@samcoe samcoe 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.

@nsmag Thanks for the contribution! I pushed a small 💅 commit to make the fetching of the current login to be asynchronous and happen when fetching other repo metadata.

@samcoe
samcoe merged commit 3377963 into cli:trunk Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh pr create shows PR author as option for reviewers when logged in with PAT

3 participants