Skip to content

ci: run CI on merge groups, and drop the Codecov upload token - #469

Merged
kfox merged 2 commits into
mainfrom
ci/merge-queue
Sep 18, 2026
Merged

kfox merged 2 commits into
mainfrom
ci/merge-queue

Conversation

@kfox

@kfox kfox commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Two changes that make a merge queue workable here.

ci.yml gains a merge_group: trigger. A queue grades the merge commit it
builds against the same required checks the pull request carries, so a check
whose workflow does not trigger there never reports — which is a hang rather
than a failure: the entry waits out the status-check timeout and is evicted.

The Codecov uploads move from CODECOV_TOKEN to the job's own short-lived
OIDC token. A queued pull request runs the workflow file from its own merge
commit on a base-repo ref, which widens the set of authors who can reshape the
job that holds a long-lived credential.

Enabling the queue is a settings change this branch cannot make

In this order, after merge:

  1. Drop CodeQL from the required status checks. The code-scanning
    roll-up check does not report on merge groups
    (github/codeql-action#1537,
    still open), so a queue that requires it stalls every entry until the
    timeout evicts it. The ruleset's code_scanning rule goes on covering pull
    requests.
  2. Turn off "require branches to be up to date" — the queue supersedes it.
  3. Restrict the pypi environment's deployment branches to tags (v*), as
    github-pages already restricts to main. pypi currently has
    protection_rules: [] and no branch policy, and release.yml's
    publish-pypi job declares that environment with id-token: write and
    publishes to PyPI by trusted publishing. Under a queue, a pull request could
    add merge_group: to release.yml and strip that job's if:; PyPI
    validates the workflow filename and the environment, and both would match.
    Queuing needs write access, so this is a precondition rather than a live
    hole — but no in-file guard can substitute, since the same merge commit owns
    the file that would carry it.
  4. Add the merge_queue rule.

Worth looking at closely

The Codecov step on this PR's own run. If the server declines the OIDC token,
fail_ci_if_error: false swallows it and nothing goes red, and neither
codecov/patch nor codecov/project is a required context. Confirm those two
post before deleting the CODECOV_TOKEN repository secret; nothing in the tree
references it any more.

A merge queue grades the merge commit it builds against the same required
checks the pull request carries. A check whose workflow has no `merge_group`
trigger never reports there, and that is a hang rather than a failure: the
entry waits out the status-check timeout and is evicted.

codeql.yml gets no `merge_group` trigger. Its analysis would run there, but
the code-scanning roll-up check that branch protection names reports only in a
pull-request context (github/codeql-action#1537, open and last confirmed
2026-05-22), so the build would gate nothing. Switching the queue on therefore
means dropping `CodeQL` from the required contexts, where the ruleset's
`code_scanning` rule goes on carrying it for pull requests.
The action's `use_oidc` input takes the job's own short-lived OIDC token and
ignores any token supplied, so `CODECOV_TOKEN` stops being a credential worth
stealing. Every same-repo pull request already ran this workflow with that
secret in reach; a merge queue widens the set of authors who can reshape the
job around it.

The coverage job declares `id-token: write` for it, alongside the
`contents: read` that job-level permissions otherwise drop. Fork pull requests
are unaffected: the action skips OIDC when the head is a fork, which leaves
them on the tokenless path an empty `secrets.CODECOV_TOKEN` already gave them.

No step in the composite action carries `continue-on-error`, so a job that
asks for OIDC without the permission to mint a token fails its upload step,
the coverage job, and the aggregate gate behind it — with an error that names
neither the input nor the permission.
@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.14%. Comparing base (af8d12b) to head (5a1ec71).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #469   +/-   ##
=======================================
  Coverage   86.13%   86.14%           
=======================================
  Files         168      168           
  Lines       31409    31409           
  Branches     4591     4591           
=======================================
+ Hits        27055    27056    +1     
+ Misses       3440     3439    -1     
  Partials      914      914           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kfox
kfox merged commit 312875d into main Sep 18, 2026
24 checks passed
@kfox
kfox deleted the ci/merge-queue branch September 18, 2026 22:32
kfox added a commit that referenced this pull request Sep 19, 2026
Merge queues are organization-gated. GitHub's gated-features text: "Pull
request merge queues are available in any public repository owned by an
organization, or in private repositories owned by organizations using GitHub
Enterprise Cloud." kfox/c64cast is owned by a personal account, so no ruleset
can enable one, and the rule is absent from the Rulesets UI.

#469 added the trigger and a guard pinning it, on the assumption that enabling
the queue was a settings change away. Both go, along with the docstring
paragraph describing an eviction behavior nothing here can reach.

CONTRIBUTING.md names the two triggers again. #469 replaced them with a pointer
to ci.yml rather than enumerate a third; the clause it replaced had said "on
every push", which the `branches: [main]` filter already made wrong.
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