Skip to content

tests.yml: main gets a push trigger for the ubuntu job alone, so a squash landing is tested instead of only the pull request it squashed (#122) - #124

Merged
brettheap merged 1 commit into
mainfrom
ci/tests-run-on-main-push-ubuntu-only
Sep 11, 2026
Merged

brettheap merged 1 commit into
mainfrom
ci/tests-run-on-main-push-ubuntu-only

Conversation

@brettheap

@brettheap brettheap commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openreposhape-2 (openRepoShape-2)
Claim: #122 (comment)

Closes #122.

What was wrong

.github/workflows/tests.yml ran on pull_request and workflow_dispatch
only. main itself was never tested by CI: gh run list --branch main is
empty for the repository's whole history, so a squash of several disjoint
pull requests landing in one evening (tonight's #116, #117 and #121, each
green on its own run) produces a tree no run ever exercised. SonarCloud
already analyses every push to main; only the test record stopped short of
it.

Brett Heap ruled on #122: "do option 1 on 122" — option 1 being, in the
issue's own words, push: branches: [main] for the tests (ubuntu) job
only, the two OS jobs staying pull-request-gated, plus a concurrency group.

What landed

In .github/workflows/tests.yml only (nothing under templates/ touched —
the assembly-root validate.yml is a project's own gate and stays
digest-pinned; tests.yml itself is not one of the digest-pinned copies
listed in AGENTS.md either):

  • on: gains push: { branches: [main] }; pull_request: and
    workflow_dispatch: are unchanged.
  • tests-windows and tests-macos each gain if: github.event_name != 'push' — narrower than the issue's own suggested == 'pull_request'
    guard, so both jobs still run on a manual workflow_dispatch (a full,
    all-three-platform run on demand) and skip ONLY the automatic main push.
    The ubuntu tests job carries no guard and runs on all three events.
    A comment above each guard says why, in the file's own voice: a
    squash-interaction regression is not OS-specific, so the Linux job on
    main is the gate for that, and Windows (2x the Linux billing rate) /
    macOS (10x) stay the pull-request gate they already were.
  • A top-level
    concurrency: { group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}, cancel-in-progress: true }
    so back-to-back landings on main cancel the superseded run. The group
    falls back to github.ref only when there is no PR number, so two
    different pull requests (or a PR versus the main branch) never share a
    group and never cancel each other's run — only a re-run of the SAME PR or
    the SAME ref does.
  • The header comment gains one paragraph saying the push trigger is
    deliberate and Linux-only, and why, for the next reader.

How it was proven

🤖 Generated with Claude Code

Summary by Sourcery

Run Linux CI on main-branch pushes and streamline workflow concurrency while preserving cross-platform pull-request coverage.

New Features:

  • Run the Linux test job for pushes to the main branch to validate the exact trees produced by squash merges.

Enhancements:

  • Keep Windows and macOS jobs limited to pull requests and manual runs while retaining full multi-platform coverage on demand.
  • Cancel superseded runs for the same pull request or branch reference to avoid redundant CI execution.

CI:

  • Extend the tests workflow with a main-branch push trigger and event-specific job execution.

…uash landing is tested instead of only the pull request it squashed (#122)

`.github/workflows/tests.yml` ran on `pull_request` and `workflow_dispatch`
only, so `main` itself was never tested by CI: a squash of several disjoint
pull requests landing in one evening (tonight's #116, #117 and #121) is a
tree no run had ever exercised, even though each one was green on its own
run. SonarCloud already analyses every push to `main`; the test record
stopped at each pull request's last run instead of following it there too.

Brett Heap ruled "do option 1 on 122": `on:` gains `push: { branches:
[main] }`, and `tests-windows` / `tests-macos` each gain `if:
github.event_name != 'push'` so they keep running on `pull_request` and a
manual `workflow_dispatch` but skip on the main push — a squash-interaction
regression is not OS-specific, so the ubuntu job on `main` is the gate for
that, and the two jobs GitHub bills at 2x (Windows) and 10x (macOS) stay the
pull-request-only gate they already were. A top-level `concurrency:` group
keyed on the PR number (falling back to `github.ref`) cancels a superseded
run of the same PR or the same branch, without touching an unrelated PR's
in-flight run. The header comment gets one paragraph saying so, for the next
reader.

Nothing under `templates/` changes; the assembly-root `validate.yml` is a
project's own gate and stays digest-pinned.

Lane: openreposhape-2 (openRepoShape-2)

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 11, 2026 21:47

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 2 days and 19 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@sourcery-ai

sourcery-ai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Reviewer's Guide

Updates the test workflow to validate the exact squashed tree on pushes to main using the Ubuntu job, preserves Windows/macOS coverage for pull requests and manual runs, and cancels superseded runs within the same PR or ref.

File-Level Changes

Change Details Files
Run the Ubuntu test job on pushes to main while keeping the platform-specific jobs pull-request gated.
  • Added a main-branch push trigger alongside the existing pull request and manual triggers.
  • Left Ubuntu unconditionally enabled, and skipped Windows and macOS only for push events while retaining manual full-suite runs.
  • Documented the Linux-only post-merge validation and its cost rationale.
.github/workflows/tests.yml
Prevent superseded workflow runs from consuming resources or reporting stale results.
  • Added a workflow/ref-or-pull-request concurrency group with cancel-in-progress enabled.
  • Used the pull request number when available and the Git ref otherwise, isolating different PRs and branches.
.github/workflows/tests.yml

Assessment against linked issues

Issue Objective Addressed Explanation
#122 Add a push-to-main trigger so the post-squash state of the main branch is tested by CI. ✅
#122 Implement the selected cost-conscious option of running the Ubuntu tests job on main pushes while keeping the Windows and macOS jobs pull-request-only, without removing workflow_dispatch support. ✅
#122 Add concurrency control so superseded runs for the same pull request or ref are cancelled while distinct pull requests or refs do not cancel one another. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The scoped workflow changes satisfy the intended CI coverage and preserve existing platform coverage.

Pull request overview

Updates CI so squash merges to main receive Linux test coverage while preserving cross-platform pull-request and manual runs.

Changes:

  • Adds a main push trigger.
  • Skips Windows/macOS jobs only on pushes.
  • Adds concurrency cancellation.
File summaries
File Description
.github/workflows/tests.yml Adds main-branch Linux testing, event guards, and workflow concurrency.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@brettheap
brettheap merged commit bd6eaec into main Sep 11, 2026
6 checks passed
@brettheap
brettheap deleted the ci/tests-run-on-main-push-ubuntu-only branch September 11, 2026 22:11
brettheap added a commit that referenced this pull request Sep 11, 2026
… workflow too, not only the assembly-root one (#127) (#129)

The step that installs actionlint ran it against exactly one file --
templates/assembly-root/.github/workflows/validate.yml, the workflow this
repository ships into a scaffolded project. templates/family-root's own
validate.yml was in the same boat, and neither lint ever touched
.github/workflows/tests.yml itself: the workflow that runs on every push
and pull request here. #122/#124 just added an `if:` guard on two jobs and
a `concurrency:` expression to that file, with nothing in the loop that
would have caught a typo in either.

Hand actionlint all three paths from the one step it already runs from,
and rename it to say so. actionlint 1.7.12 finds nothing to fix in any of
the three files as they stand.

Lane: openreposhape-2 (openRepoShape-2)

Co-authored-by: Claude Fable 5.1 <[email protected]>
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.

tests.yml runs on pull_request only, so main itself is never tested after a squash — a push-to-main trigger is a CI-minutes decision for Brett

2 participants