Skip to content

chore(ci): cancel orphaned PR runs + prune Java matrix on PR#176

Merged
saurabhjain1592 merged 2 commits intomainfrom
cost/ci-sweep
May 10, 2026
Merged

chore(ci): cancel orphaned PR runs + prune Java matrix on PR#176
saurabhjain1592 merged 2 commits intomainfrom
cost/ci-sweep

Conversation

@saurabhjain1592
Copy link
Copy Markdown
Member

Summary

Same patterns shipped on `axonflow-enterprise` (#2140, #2146), now applied here.

Changes

Workflow Change
ci.yml + concurrency block; matrix prune `[11,17,21]` → `[17]` on PR
integration.yml concurrency reshaped to PR-only cancel; same matrix prune on contract-integration job
heartbeat-real-stack.yml + concurrency block
wire-shape-contract.yml + concurrency block
definition-of-done.yml + concurrency block; drop `edited` PR event type
validate-version-alignment.yml + concurrency block

Concurrency pattern

```yaml
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
```

PR rebases cancel orphans by PR#; push-to-main runs each get a unique SHA group, so main builds never queue or cancel each other.

Matrix prune

```yaml
java-version: ${{ fromJson(github.event_name == 'pull_request' && '[17]' || '[11, 17, 21]') }}
```

PR-time validation runs only Java 17 (current release toolchain). Push-to-main, workflow_dispatch, and the existing weekly Tuesday cron all run the full `[11, 17, 21]` matrix to catch version-specific drift before tagging.

Expected impact

  • ci.yml p95: ~5.2m → ~2m on PR (3 parallel java legs → 1)
  • integration.yml contract-integration: same shape, same magnitude
  • Other workflows: no wallclock change; concurrency just cancels orphans on rebases

Public repo, free minutes — this is dev-velocity work, not cost.

Test plan

  • CI: this PR's own runs show only 1 java-version leg (`build (17)`)
  • CI passes; both Test/Build summary checks green
  • Sanity rebase: push a tiny commit, confirm prior run cancels (concurrency working)

Sweeps the same patterns shipped on axonflow-enterprise (#2140, #2146):

1. **Concurrency**: cancel orphaned PR runs when a new commit is
   pushed; push-to-main keys on SHA so main runs never queue or
   cancel each other. Applied to ci, integration (existing block
   reshaped from `cancel-in-progress: true`), heartbeat-real-stack,
   wire-shape-contract, definition-of-done, validate-version-alignment.

2. **Matrix prune on PR** for ci.yml + integration.yml's
   contract-integration job:
       PR:  java-version: [17]   (current release toolchain)
       else: java-version: [11, 17, 21]   (push, dispatch, weekly cron)

   Cuts the heaviest workflow in the SDK fleet from p95 ~5.2m to ~2m.
   Version-specific drift surfaces post-merge on push:main and the
   Tuesday cron (already present on integration.yml).

3. **definition-of-done.yml**: drop the `edited` PR event type — it
   re-runs the gate on title/body edits without any code change.
   Keep opened/synchronize/reopened.

No app code change; CI ergonomics only.

Signed-off-by: Saurabh Jain <saurabhjain1592@gmail.com>
The matrix prune in this PR (`[11, 17, 21]` → `[17]` on PR) means
the per-version check names (`build (11)`, `build (21)`) don't
report on PR runs. Branch protection requires those names, so PRs
get permanently blocked.

Add a `Build Summary` aggregator that always runs, reflects the
overall matrix result (success/skipped → green; failure → red), and
emits a stable single check name regardless of matrix shape. Branch
protection should require `Build Summary` instead of the per-version
names — same pattern axonflow-enterprise uses with its
`Build Summary` / `Test Summary` aggregators.

Signed-off-by: Saurabh Jain <saurabhjain1592@gmail.com>
@saurabhjain1592 saurabhjain1592 merged commit a780934 into main May 10, 2026
18 checks passed
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