Skip to content

CI cost hygiene: cancel superseded runs, cap hung jobs, skip docs-only pushes - #175

Closed
simbo1905 wants to merge 1 commit into
mainfrom
chore/ci-hygiene
Closed

simbo1905 wants to merge 1 commit into
mainfrom
chore/ci-hygiene

Conversation

@simbo1905

Copy link
Copy Markdown
Owner

CI cost hygiene: cancel superseded runs, cap hung jobs, skip docs-only pushes

Mechanical change to .github/workflows/ only — no code, no settings, no triggers removed.

1. Concurrency: cancel superseded runs on push-triggered workflows

Added a workflow-level block to the two workflows that run on branch pushes:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
  • .github/workflows/ci.yml (push to any branch + pull_request)
  • .github/workflows/maven.yml (push/pull_request on main)

Pushing twice to the same branch/PR now cancels the older run instead of billing both.

2. timeouts on every job

timeout-minutes added to all 10 jobs across all 6 workflows (none existed before, so no
pre-existing values were touched or lowered):

workflow job timeout-minutes
ci.yml build 30
ci.yml docker-build 20
maven.yml test-java21 20
maven.yml test-java25 30
maven.yml docker-build 20
api-tracker-java25.yml track-api 45
daily-api-tracker.yml track-api 45
release-on-tag.yml release 60
release-on-tag.yml docker-publish 30
secrets-self-check.yml check 10

A hung JDK/Maven/Docker step now fails at the cap instead of burning the 6 h default.
Observed wall-clock for these workflows is 1–3 minutes, so the caps are ~10x headroom.

3. paths-ignore: docs-only pushes

Added to the push trigger only, on the two push workflows:

    paths-ignore:
      - '**/*.md'
      - 'docs/**'

pull_request triggers are deliberately left unfiltered so PR verification still runs on
every change; no paths: filter exists anywhere in these files, so there is no
paths + paths-ignore conflict on a single event.

Deliberately not changed

  • release-on-tag.yml keeps its existing concurrency: group: release-${{ github.ref }} with
    cancel-in-progress: false. It is tag-triggered (not branch-push) and publishes to Maven
    Central, which is irreversible: cancelling a superseded run could stop it between the Central
    deploy and the release-notes/GHCR steps. Revert line if that judgement is wrong:
    set cancel-in-progress: true under that workflow's existing concurrency: block.
  • api-tracker-java25.yml, daily-api-tracker.yml, secrets-self-check.yml have no push
    trigger (workflow_dispatch/schedule only), so no concurrency group and no paths-ignore
    was added — a filter there would be meaningless.

Verification

  • All six files parse with PyYAML safe_load; actionlint reports no syntax/schema errors
    (only pre-existing shellcheck info notes in untouched run: blocks).
  • Every job in every workflow has a timeout-minutes.
  • No pull_request trigger is path-filtered.
  • Default branch (main) has one active ruleset (deletion, non_fast_forward, pull_request
    with 0 required approvals) and no required status checks, so no required-check workflow
    can be skipped by these filters.

Revert: git revert this single commit, or drop the added concurrency: / timeout-minutes: /
paths-ignore: blocks.

- concurrency (cancel-in-progress) on the branch-push workflows ci.yml and maven.yml
- timeout-minutes on every job in every workflow
- paths-ignore for markdown/docs on the push trigger only; pull_request stays unfiltered
@simbo1905

Copy link
Copy Markdown
Owner Author

Superseded by #206 (merged as 8a6efc5): same three controls with one commit per issue (#172 timeouts on 6 files / 9 jobs, #173 concurrency on both push-triggered workflows, #174 paths-ignore). One delta in this PR - paths-ignore on ci.yml - was deliberately excluded there because ci.yml produces the required status checks (a required check that is path-skipped can wedge merges). Everything else here landed in #206.

@simbo1905 simbo1905 closed this Nov 21, 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.

1 participant