Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command line option to specify labels #64

Open
SplitInfinity opened this issue May 27, 2021 · 2 comments
Open

Add command line option to specify labels #64

SplitInfinity opened this issue May 27, 2021 · 2 comments

Comments

@SplitInfinity
Copy link
Contributor

Consider adding a command line option (e.g. --labels=...) that would allow users to specify labels that should be applied to the PR when it is created. Without this, users have to open the PR and add the label(s) manually or use the GitHub command line tool after running ghstack.

I'm 90% sure the GitHub API supports adding labels to PRs (either at creation time or after), so I think it's matter of adding the option and plumbing the value provided by the user through to the API call.

@samestep samestep self-assigned this May 27, 2021
@samestep
Copy link
Collaborator

samestep commented Jun 9, 2021

I couldn't find anything about labels in the API docs for creating a PR, so I did some quick Googling and found octokit/octokit.net#1862, which seems to imply that, while you can use the API to add a label right after the PR is created, there isn't a way to add the label while creating it. I could be mistaken though, since that issue is a few years old and also on a .NET-specific repo.

Would this still fit your use case? It would require another network round-trip but that's probably fine; I guess the question is whether this label application would happen before or after pytorch-probot queries for labels.

Also, should the labels given on the command line be applied to all PRs in the stack even if they already exist, or only newly created PRs?

@SplitInfinity
Copy link
Contributor Author

I couldn't find anything about labels in the API docs for creating a PR, so I did some quick Googling and found octokit/octokit.net#1862, which seems to imply that, while you can use the API to add a label right after the PR is created, there isn't a way to add the label while creating it. I could be mistaken though, since that issue is a few years old and also on a .NET-specific repo.

Would this still fit your use case? It would require another network round-trip but that's probably fine; I guess the question is whether this label application would happen before or after pytorch-probot queries for labels.

My use case is applying labels to my PRs so that the right tests run on them in the pytorch/pytorch repo.

Also, should the labels given on the command line be applied to all PRs in the stack even if they already exist, or only newly created PRs?

I think a --all option might be useful here to distinguish between the two.

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 a pull request may close this issue.

2 participants