sapling
sapling copied to clipboard
[ISL][Feature Request] Specify github reviewers
Currently whenever creating a PR with sapling, I still need to open the PR in github to finish off some things. It would be much more ideal if I could be done after clicking "Submit". One such thing is specifying reviewers for the PR (which seems to be supported internally).
It seems like there's already support for something like this by adding to OSSDefaultFieldSchema
and using the type: 'field'
. Autocomplete could be easily implemented via github graphql API. My main concern is how to actually pass the information from ISL webview to lower level APIs (not very familiar with that), and vice-versa for PRs with reviewers. It seems like there's an assumption that commit description has all this metadata stored as text which seems weird for github PRs. If there's any quick pointers here I'd be happy to tackle this, but might be a bit complex.
As a hack, I created this script to print the PR url, so that I can use gh pr edit
like this:
gh pr edit $(sl-pr) --add-reviewer <username>
This would indeed be nice!
I agree the setup is a little wonky, since internally we base all this info off of the diff's description. I think we'd probably need to have a step where we extract the reviewers from the description and use that as some sort of input to the github PR creation (or a later async syncing step). I think the best way would for us to have a flag in sl pr submit
and sl ghstack submit
for --reviewers="alias1,alias2,..."
. Then we could pretty easily handle this during message creation time.
There is definitely code in here that would make this feature work nicely, such as autocomplete support. Unfortunately I'm not sure when I'll have a chance to look more into this.