mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-25 06:51:11 +00:00
c953fafcdc
* fix(platform/github): skip PR update when PR is in merge queue Updating a PR that is queued for merging can remove it from the merge queue. Check the PR's merge queue status via GraphQL before updating and skip the update if it is queued. The check is skipped on GHES <3.12.0 and fails open on errors. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(platform/github): dequeue PR from merge queue instead of skipping update Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs(platform/github): note re-queue behavior after dequeue Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * refactor(platform/github): dequeue merge queue PR in commitAndPush Dequeue on push instead of on PR metadata update, since pushing to the branch is what invalidates the queued merge result. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * refactor(platform/github): extract dequeuePr to pr.ts Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(platform/github): abort branch update when PR is in merge queue Instead of dequeueing the PR, throw PR_ALREADY_IN_MERGE_QUEUE from commitAndPush and handle it gracefully in processBranch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(platform/github): check merge queue enablement per base branch Cache merge queue enablement per base branch like branchForceRebase and skip the per-PR merge queue check when the base branch has no merge queue. Errors are treated as enabled. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(platform/github): fetch default branch merge queue status in initRepo Include mergeQueue in repoInfoQuery so no extra query is needed for the default branch, stripping it on GHES <3.12.0 like other unsupported fields. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
27 lines
921 B
TypeScript
27 lines
921 B
TypeScript
import * as git from '../../../util/git/index.ts';
|
|
import type { CommitFilesConfig } from '../../../util/git/types.ts';
|
|
import type { LongCommitSha } from '../../../util/schema-utils/git.ts';
|
|
import { DefaultGitScm } from '../default-scm.ts';
|
|
import { assertPrNotInMergeQueue, commitFiles, isGHApp } from './index.ts';
|
|
|
|
export class GithubScm extends DefaultGitScm {
|
|
override async commitAndPush(
|
|
commitConfig: CommitFilesConfig,
|
|
): Promise<LongCommitSha | null> {
|
|
let platformCommit = commitConfig.platformCommit;
|
|
if (platformCommit === 'auto' && isGHApp()) {
|
|
platformCommit = 'enabled';
|
|
}
|
|
|
|
// a queued PR could otherwise merge before the pushed changes take effect
|
|
await assertPrNotInMergeQueue(
|
|
commitConfig.branchName,
|
|
commitConfig.baseBranch,
|
|
);
|
|
|
|
return platformCommit === 'enabled'
|
|
? commitFiles(commitConfig)
|
|
: git.commitFiles(commitConfig);
|
|
}
|
|
}
|