Skip to content

IGNITE-28827 Run all PR checks even when the PR conflicts with the base branch#13287

Open
anton-vinogradov wants to merge 1 commit into
apache:masterfrom
anton-vinogradov:ignite-28827
Open

IGNITE-28827 Run all PR checks even when the PR conflicts with the base branch#13287
anton-vinogradov wants to merge 1 commit into
apache:masterfrom
anton-vinogradov:ignite-28827

Conversation

@anton-vinogradov

@anton-vinogradov anton-vinogradov commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Problem

The GitHub Actions checks in commit-check.yml (Code Style, Abandoned Tests, Javadocs, .NET, ducktape) are not dispatched for a pull request that conflicts with the base branch. The status checks never appear, so a contributor whose PR is temporarily in conflict gets no CI feedback until the conflict is resolved.

Root cause

These checks are triggered by the pull_request event, which GitHub dispatches against the test-merge commit (PR head merged into base). When the PR conflicts (mergeable state DIRTY), GitHub cannot compute that merge commit, so no run is created. This is independent of what the jobs check out — they already check out pull_request.head.sha.

For comparison, the "Rolling Upgrade / Protected Classes" check runs fine on conflicting PRs because it is triggered by pull_request_target, which runs in the base-branch context and does not depend on the test-merge commit.

Change

Switch commit-check.yml from pull_request to pull_request_target. That event is the only PR-triggered event not gated on the merge commit, so it is the only way to dispatch these checks on a conflicting PR. All jobs already check out pull_request.head.sha.

Security trade-off

These jobs build and run untrusted PR code (mvnw test, dotnet build, tox). Running untrusted code under pull_request_target is sensitive, so the workflow is hardened to grant no more privilege than the pull_request event already did:

  • the token is downscoped to permissions: contents: read (no write);
  • no secrets.* are referenced;
  • the workflow definition is taken from the base branch, so a PR cannot modify it.

A code comment documents this invariant so that secrets / write permissions are not added later without revisiting the trade-off.

Notes / follow-ups

  • pull_request_target that builds and runs fork code goes against GitHub's default guidance for untrusted code; needs confirmation that ASF Infra policy permits it. Feedback welcome.
  • Required checks / branch protection are unchanged (job names stay the same).

JIRA: https://issues.apache.org/jira/browse/IGNITE-28827

@anton-vinogradov anton-vinogradov changed the title IGNITE-28827 Run code style check on pull requests that conflict with the base branch IGNITE-28827 Run all PR checks even when the PR conflicts with the base branch Jun 27, 2026
…se branch

The Code Style / Abandoned Tests / Javadocs and the .NET and ducktape checks
were triggered by the pull_request event, which GitHub dispatches against the
test-merge commit. For a PR that conflicts with the base branch GitHub cannot
compute that merge commit, so the runs were never created and the PR got no
feedback until the conflict was resolved.

Switch commit-check.yml to the pull_request_target event, which runs in the
base-branch context and does not depend on the test-merge commit, so the checks
are dispatched regardless of merge conflicts. All jobs already check out
pull_request.head.sha.

Since these jobs build and run untrusted PR code, the token is downscoped to
contents: read and no secrets are referenced, so a fork build gets no more
privilege than it had under pull_request.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant