feat(dev-infra): create rebase-pr tool in ng-dev (#37055)
Creates a tool in ng-dev which rebases a PR automatically and pushes the rebase commits back to the PR. This is meant to be a replacement to the local merge script currently in the repo and currently has feature parity. PR Close #37055
This commit is contained in:

committed by
Kara Erickson

parent
5ac5ac1dec
commit
009f394237
@ -26,6 +26,25 @@ const graphql = unauthenticatedGraphql.defaults({
|
||||
}
|
||||
});
|
||||
|
||||
/** Get a PR from github */
|
||||
export async function getPr<PrSchema>(
|
||||
prSchema: PrSchema, number: number, {owner, name}: GithubConfig) {
|
||||
const PR_QUERY = params(
|
||||
{
|
||||
$number: 'Int!', // The PR number
|
||||
$owner: 'String!', // The organization to query for
|
||||
$name: 'String!', // The organization to query for
|
||||
},
|
||||
{
|
||||
repository: params({owner: '$owner', name: '$name'}, {
|
||||
pullRequest: params({number: '$number'}, prSchema),
|
||||
})
|
||||
});
|
||||
|
||||
const result = await graphql(graphqlQuery(PR_QUERY), {number, owner, name}) as typeof PR_QUERY;
|
||||
return result.repository.pullRequest;
|
||||
}
|
||||
|
||||
/** Get all pending PRs from github */
|
||||
export async function getPendingPrs<PrSchema>(prSchema: PrSchema, {owner, name}: GithubConfig) {
|
||||
// The GraphQL query object to get a page of pending PRs
|
||||
|
Reference in New Issue
Block a user