Hub: New pull-request does not submit params atomically

Created on 23 May 2019  路  5Comments  路  Source: github/hub

When creating a new pull request it appears that labels and reviewers are submitted as a separate request, which results in multiple events and incomplete information in the original "opened" event.

My go-foo is not strong enough to attempt a fix and test it yet, but I can see that params are being set only after PR has been created. Perhaps instead of adjusting params after creation, they should be populated in advance.

i.e. move all of this code to line 351
https://github.com/github/hub/blob/master/commands/pull_request.go#L382-L393

All 5 comments

The GitHub API for creating a PR allows only these fields: title, head, base, body, maintainer_can_modify, draft.

Everything else needs to be done as a subsequent API operation after creating the PR.

Thanks @mislav. It appears that GitHub has a different API for internal consumption. PRs created via web ui have labels when you view their "opened" event in the log. 馃し鈥嶁檪

@AndreiRailean Your observation is correct. I would prefer to have the same experience as the web UI for the end-user. Perhaps when the GraphQL API for creating PRs is stable, we can switch to that. Until then, there's nothing hub can do to work around this.

Thanks for writing in!

@mislav yeah, I checked GraphQL api to see if it has any advantages over REST. Doesn't look like it is better on that front. It appears that input type for opening a PR allows for the same set of initial params, and they don't include labels or reviewers.

Do you know where we could leave such feedback to the API team? I assume you use GH internally to track dev, so if you could xref this to there it may influence the evolution of gql api in a way that helps resolve this.

Thank you for looking into the GraphQL API. I will submit your feedback to our teams internally.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

segevfiner picture segevfiner  路  4Comments

aryan9600 picture aryan9600  路  3Comments

stsewd picture stsewd  路  4Comments

kentcdodds picture kentcdodds  路  4Comments

le0nik picture le0nik  路  4Comments