Commit Graph

18 Commits

Author SHA1 Message Date
Sebastian Poxhofer 7b25e97ba3 feat(github): add support for using merge queues without auto merge (#45721)
* feat(github): add experimental support for using merge queues without auto merge

* test(github): use vi.stubEnv for merge queue env flag

* fix(github): do not re-enqueue PRs already waiting in the merge queue

* refactor(github): reuse merge queue detection from #45252 for isBranchMergeQueueEnabled

* refactor(github): read the base branch from the PR instead of extending MergePRConfig

* feat(github): enable merge queue support without the RENOVATE_X_GITHUB_MERGE_QUEUE flag

* Apply suggestion from @secustor
2026-09-09 15:21:45 +00:00
Michael Kriese c953fafcdc fix(platform/github): abort branch update when PR is in merge queue (#45252)
* 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>
2026-08-14 07:05:12 +00:00
Tinus Mørch Abell 2abd139cd2 feat(platform/github): support gitUrl option on github (#43531)
* feat(config): add github to gitUrl supportedPlatforms

Declare GitHub as a supported platform for the gitUrl option so users
can configure ssh/endpoint URL resolution on github.com and GHES.

Wiring in the github platform module follows in subsequent commits.

Refs: renovatebot/renovate#43086

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(platform/github): fetch sshUrl from repoInfoQuery

Add sshUrl to the GraphQL repository query and to the GhRepo type so
the platform can resolve SSH-based git remotes. Typed as nullable
to match the gitlab pattern and to allow a missing-field error path.

Refs: renovatebot/renovate#43086

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(platform/github): add getRepoUrl helper

Introduce a getRepoUrl helper that returns the repository git URL based
on the gitUrl option:
- 'ssh' uses the sshUrl from the GraphQL repo response; throws
  CONFIG_GIT_URL_UNAVAILABLE if not available
- 'default' and 'endpoint' build an https URL from the configured
  endpoint with credentials embedded (current behavior)

The helper is unused in this commit; initRepo wiring follows.

Refs: renovatebot/renovate#43086

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat(platform/github): support gitUrl in initRepo

Destructure gitUrl from RepoParams and replace the inline URL
construction with getRepoUrl calls. The working URL uses the fork's
ssh_url when running in fork mode, otherwise the GraphQL repo.sshUrl.
The upstream URL (used when forkCreation and a parentRepo is set)
uses repo.sshUrl, which is the parent's URL because the GraphQL
query runs before the fork swap.

GhRestRepo gains an ssh_url field so findFork/createFork responses
can carry the fork's SSH URL forward.

Refs: renovatebot/renovate#43086

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* test(platform/github): cover gitUrl branches

Add unit tests for getRepoUrl in utils.spec.ts and three integration
tests in index.spec.ts that exercise initRepo with gitUrl=ssh:

- ssh URL is forwarded to git.initRepo
- missing sshUrl with gitUrl=ssh throws CONFIG_GIT_URL_UNAVAILABLE
- fork mode uses the fork's ssh_url for url and the parent's sshUrl
  for upstreamUrl

initRepoMock and forkInitRepoMock now include sshUrl in the GraphQL
response so existing tests continue to populate the field that the
new code path reads.

Refs: renovatebot/renovate#43086

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* docs: note github-specific gitUrl behavior

Document that 'default' and 'endpoint' produce the same URL on GitHub,
that 'ssh' uses the repository's sshUrl, and that fork mode propagates
SSH selection to both the working URL and the upstream URL.

Refs: renovatebot/renovate#43086

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* refactor(platform/github): pass parsed URL to getRepoUrl

Accept a pre-parsed URL in getRepoUrl instead of re-parsing the
endpoint string inside the helper. The endpoint is validated during
initPlatform so the helper no longer needs its own null check. The
caller now parses once and passes the URL to both initRepo call
sites; the helper clones it before mutating.

Also assert config.repository as non-null at the initRepo call site,
fixing the TS2345 error reported by the lint-other job.

* Update docs/usage/self-hosted-configuration.md

Co-authored-by: Michael Kriese <michael.kriese@gmx.de>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
2026-06-08 11:51:46 +00:00
Jameel Al-Aziz 1e7dd2043c fix(github): set commit message explicitly for platform automerge (#42056)
* fix(github): set commit message explicitly for platform automerge

When GitHub's "Use PR title and body as commit message" setting is
enabled, the verbose Renovate PR description gets used as the squash
commit body. Pass `commitHeadline` and `commitBody` to the
`enablePullRequestAutoMerge` GraphQL mutation so the actual commit
message is used instead.

* add REBASE test

* pr feedback
2026-05-13 15:37:52 +00:00
Sergei Zharinov 22a8be3f96 fix(github): Make user GraphQL parameter optional (#36547) 2025-06-17 08:41:57 +00:00
RahulGautamSingh 5ed97aa738 refactor(vulnerability-alerts): move to REST API (#27378) 2024-07-25 15:28:16 +02:00
RahulGautamSingh e11f9d9882 fix(github): fetch all open issue if ignorePrAuthor=true (#29485)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-06-12 06:53:55 +00:00
Sergei Zharinov 579d8c83bc feat(github): Fetch issues during repo initialization (#27785) 2024-04-12 11:28:37 +00:00
Sergei Zharinov 0cc759c66e feat(github): Use schema for issue objects (#27782) 2024-03-10 11:54:57 +00:00
Sergei Zharinov 794fc5c293 refactor(github): Remove unused GraphQL queries (#27710) 2024-03-04 17:11:36 +00:00
Rhys Arkins 2caf0b304b fix(github): skip forked repos when in fork mode (#27684) 2024-03-02 07:16:07 +00:00
Rhys Arkins 9f2394680e fix(github): Revert "feat(github): use REST for etag caching of issues" (#27612) 2024-02-28 13:20:29 +01:00
Rhys Arkins 924b9dad68 feat(github): use REST for etag caching of issues (#26793)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-02-28 05:22:16 +00:00
Rhys Arkins 8038ad8531 feat(github): detect if repo has vulnerability alerts enabled (#26795) 2024-01-22 08:57:22 +00:00
Sergei Zharinov d18538dc4d feat(platform): Provide repoFingerprint field on repository init (#17288)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-08-22 07:50:55 +00:00
nyg 18b884d4a7 fix(github): Ignore vulnerability alerts in FIXED or DISMISSED states (#14431) 2022-03-28 14:16:25 +02:00
Sergei Zharinov 9933dda182 refactor(github): Stop using cannotMergeReason field (#14823) 2022-03-28 13:15:45 +02:00
Rhys Arkins dca3418bbd refactor: lib/modules (#14488)
Moves datasource, manager, platform and versioning code from lib/ into new lib/modules/

BREAKING CHANGE: External tools must update paths to datasource, manager, platform and versioning
2022-03-04 09:04:02 +01:00