Skip to content

fix(ci): run required tests when a PR is retargeted to main - #1

Closed
joebasrawi wants to merge 3 commits into
mainfrom
cursor/fix-ci-pr-retarget-f376
Closed

fix(ci): run required tests when a PR is retargeted to main#1
joebasrawi wants to merge 3 commits into
mainfrom
cursor/fix-ci-pr-retarget-f376

Conversation

@joebasrawi

@joebasrawi joebasrawi commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

Retargeting a pull request onto main did not start the required test check. The CI workflow already filtered pull_request to main, but it used the default activity types (opened, synchronize, reopened). A base-branch change emits edited, so a PR that was synced against another branch and then pointed at main never got a run for that revision. PR apache#4161 showed the gap.

This keeps the existing CI / test job as the single required check:

  • Subscribe to edited in addition to the default types.
  • Run the job only when the edit is a base-branch change (or any non-edited event).
  • Put title/body edits in a unique concurrency group so they cannot cancel an in-progress valid run.
  • Report those unrelated edits under ignored-pr-edit instead of test, because a skipped job named test would still satisfy the required check.

Fixes apache#4181

This branch is based on current apache/maka main. To open the same change on Apache:

https://github.com/apache/maka/compare/main...joebasrawi:cursor/fix-ci-pr-retarget-f376?quick_pull=1

Verification

  • node --test --test-concurrency=1 scripts/ci-pull-request-trigger.test.mjs scripts/ci-test-plan.test.mjs
  • npx biome check scripts/ci-pull-request-trigger.mjs scripts/ci-pull-request-trigger.test.mjs
  • node scripts/asf-license-headers.mjs check

Changing .github/workflows/ci.yml selects the full CI plan. The fork test job is in progress after a synchronize onto main.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope:

Cursor Grok 4.6 authored the workflow guard, the trigger policy module, and the regression tests.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No
Open in Web Open in Cursor 

Subscribe the existing CI workflow to pull_request edited so a base-branch
change onto main produces the required test check. Skip title and body
edits, isolate them from the pull-request concurrency group, and report
them under a different check name so they cannot cancel or satisfy test.

Fixes apache#4181

Generated-by: Cursor Grok 4.6

Co-authored-by: Joseph B <joebasrawi@users.noreply.github.com>
@cursor
cursor Bot changed the base branch from main to cursor/apache-main-base-f376 August 29, 2026 14:46
@joebasrawi
joebasrawi marked this pull request as ready for review August 29, 2026 14:46
Generated-by: Cursor Grok 4.6

Co-authored-by: Joseph B <joebasrawi@users.noreply.github.com>
@cursor
cursor Bot changed the base branch from cursor/apache-main-base-f376 to main August 29, 2026 14:48
Generated-by: Cursor Grok 4.6

Co-authored-by: Joseph B <joebasrawi@users.noreply.github.com>
@joebasrawi

Copy link
Copy Markdown
Owner Author

Not opening this upstream. apache#4181 is assigned to jackeyfaker77 and already has apache#4186.

@joebasrawi joebasrawi closed this Aug 29, 2026
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.

CI does not run when a pull request is retargeted to main

2 participants