Skip to content

ci: consolidate required checks into single gate workflow#2044

Merged
KRRT7 merged 3 commits into
mainfrom
ci/skip-irrelevant-checks
Apr 9, 2026
Merged

ci: consolidate required checks into single gate workflow#2044
KRRT7 merged 3 commits into
mainfrom
ci/skip-irrelevant-checks

Conversation

@KRRT7
Copy link
Copy Markdown
Contributor

@KRRT7 KRRT7 commented Apr 9, 2026

Summary

Replaces 17 individual workflow files with a single ci.yaml following the astral-sh/ruff gate pattern:

  • determine-changes job uses native git diff --quiet against merge base (zero third-party dependencies)
  • 19 jobs total: unit tests (7 matrix), type-check (mypy), prek lint, 9 Python E2Es, 3 JS E2Es, 2 Java E2Es — all gated by needs: + if:
  • required-checks-passed gate job (if: always()) accepts both "success" and "skipped" via jq check
  • E2E security preserved: environment gating for external contributors, author allowlists, Validate PR steps
  • Change detection has 5 flags: unit_tests, type_check, e2e, e2e_js (packages/), e2e_java (java runtime + fixtures)

Why

Workflow-level paths: filters leave required checks stuck at "Pending" when a PR doesn't touch matching files (e.g., workflow-only changes, dependabot bumps). This is a known GitHub limitation with no native fix. We've been admin-merging as a workaround.

With job-level if: conditions, skipped jobs report as "skipped" → the gate job accepts them → PR is mergeable without admin override.

Cost savings

What Per-skip savings Notes
Unit tests (7 matrix) $0.64 6 Linux × ~9min + 1 Windows × ~13min
Type check (mypy) $0.01 ~1min Linux
E2E tests (15 jobs) $1.20 15 × ~10min Linux
Total per skipped PR $1.85
Change detection overhead $0.001 ~10s on ubuntu-latest
Estimated annual savings $90-180 ~4-8 non-code PRs/month

Real value is operational: no more admin merges, CI is self-service, and workflow file count drops from 22 to 7.

After merge

Update the main-branch ruleset to replace all 13 individual required checks with the single required-checks-passed check.

Test plan

  • This PR only changes workflow files — determine-changes detects no code changes, all 17 jobs skipped
  • required-checks-passed gate job reports "success" (all upstream skipped)
  • Verify on a subsequent code-touching PR that all tests run normally

Replace 7 individual required-check workflows (unit-tests, mypy,
5 E2E tests) with a single ci.yaml following the astral-sh/ruff
gate pattern:

- determine-changes job uses native git diff (no third-party deps)
- Each test job skipped at job level when paths don't match
- Single required-checks-passed gate job accepts success + skipped
- E2E security preserved: environment gating, author allowlists

This fixes the long-standing issue where workflow-level path filters
leave required checks "Pending" on PRs that don't touch code paths,
blocking merge without admin override.

Estimated savings: ~$1.05/skipped PR ($0.64 unit-tests + $0.01
type-check + $0.40 E2E), ~$50-100/yr in compute, plus eliminating
all admin-merge workarounds.
@github-actions github-actions Bot added the workflow-modified This PR modifies GitHub Actions workflows label Apr 9, 2026
KRRT7 added 2 commits April 9, 2026 05:47
ci.yaml was in all three check_paths calls, so creating/modifying
the workflow itself triggered all test jobs. Workflow-only PRs
should skip tests — the gate job still validates the pattern.
Add all non-required-check E2E workflows and prek lint to the
consolidated ci.yaml:

- 4 standard Python E2Es (async, benchmark, coverage, init)
- 3 JS E2Es (cjs-function, esm-async, ts-class)
- 2 Java E2Es (fibonacci-nogit, tracer)
- prek lint

New change detection outputs:
- e2e_js: triggers JS E2Es when packages/ changes
- e2e_java: triggers Java E2Es when java runtime/fixtures change

Total: 17 jobs + determine-changes + gate = 19 jobs in one file.
Down from 22 workflow files to 7 (remaining are non-test: claude,
codeflash self-optimize, label-workflow-changes, publish, java-e2e).

Additional savings per irrelevant PR: ~$0.80 (10 jobs x ~$0.08).
Total per skipped PR: ~$1.85.
@KRRT7 KRRT7 merged commit 6f63ce0 into main Apr 9, 2026
22 of 23 checks passed
@KRRT7 KRRT7 deleted the ci/skip-irrelevant-checks branch April 9, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

workflow-modified This PR modifies GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant