Skip to content

feat(ci): add run_flake_check to skip inline checks for fan-out consumers - #9

Merged
kalbasit merged 2 commits into
mainfrom
user/wnasreddine/further-improvement
May 29, 2026
Merged

kalbasit merged 2 commits into
mainfrom
user/wnasreddine/further-improvement

Conversation

@kalbasit

Copy link
Copy Markdown
Owner

Why

The reusable workflow runs nix flake check + coverage inline (standalone flake-check job and inside the OCI build job). A consumer that wants to fan the checks out into its own parallel matrix (one job per nix build .#checks.<system>.<name>, for much faster wall-clock) has no way to turn the monolithic inline check off — it would run twice.

What

Add a run_flake_check input (boolean, default true) to build.yml and the ci.yml orchestrator. When false:

  • the standalone flake-check job is skipped, and
  • build.yml skips its inline Flake check / Build coverage / Codecov steps, only building/pushing the OCI image.

Default true is inert for every existing consumer. The consumer (e.g. ncps) then owns the fanned-out checks + a coverage job.

Specs: oci-build (conditional check/coverage) + reusable-ci (new input). actionlint clean.

Paired with the ncps fan-out PR (forthcoming) that sets run_flake_check: false and adds the check matrix.

…mers

Add a run_flake_check input (default true) to build.yml and the ci.yml
orchestrator. When false, the standalone flake-check job is skipped and
build.yml skips its inline nix flake check + coverage steps (only building/
pushing the OCI image) — letting a consumer fan the checks out into its own
parallel matrix. Default true is inert for existing consumers.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@kalbasit

Copy link
Copy Markdown
Owner Author

This change is part of the following stack:

Change managed by git-spice.

@coderabbitai

coderabbitai Bot commented May 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b17c31df-ce95-4053-a22c-da17466c9ae6

📥 Commits

Reviewing files that changed from the base of the PR and between c43d0eb and 86c2a6b.

📒 Files selected for processing (2)
  • openspec/specs/oci-build/spec.md
  • openspec/specs/reusable-ci/spec.md

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added an optional CI toggle to skip flake checks and coverage uploads (run_flake_check, default: true) so teams can disable monolithic check/coverage while keeping OCI image build/push intact.
    • The toggle is forwarded across reusable CI flows to coordinate behavior.
  • Documentation

    • Added design, proposal, specs, and task docs describing the new CI control and expected scenarios.

Walkthrough

This PR adds a run_flake_check boolean input (default true) to the reusable GitHub workflows in ci.yml and build.yml, enabling consumers to skip the monolithic flake check, coverage build, and Codecov upload steps while preserving OCI image build and push operations. The implementation includes specification updates and comprehensive planning documentation.

Changes

Skip Monolithic Flake Check Feature

Layer / File(s) Summary
Official Specification Updates
openspec/specs/oci-build/spec.md, openspec/specs/reusable-ci/spec.md
Specification text for oci-build and reusable-ci workflows now defines behavior when run_flake_check is false: flake check and coverage steps are skipped, but per-system OCI image builds, registry pushes, and multi-arch manifest assembly continue. Scenarios explicitly document this behavior.
CI Workflow Orchestration
.github/workflows/ci.yml
Adds run_flake_check boolean input (default true), gates the standalone flake-check job to run only when both oci == false and run_flake_check is true, and forwards the input to the reusable build workflow via with: parameters.
Build Workflow Input and Step Gating
.github/workflows/build.yml
Introduces run_flake_check input and modifies step conditionals so that Flake check, Build coverage, and Upload coverage reports to Codecov steps execute only when inputs.run_flake_check is true, independent of test_systems filtering.
Feature Proposal and Archive Documentation
openspec/changes/archive/2026-05-29-skip-monolithic-flake-check/*, openspec/changes/.../specs/*
Proposal markdown, design document, archive specifications for oci-build and reusable-ci, openspec metadata file, and task checklist documenting the feature design, goals, trade-offs, migration plan, and implementation status.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • kalbasit/gh-actions#8: Both PRs modify the same GitHub Actions workflow control flow in .github/workflows/build.yml and .github/workflows/ci.yml, adding new if: gating around the nix flake check/coverage/Codecov steps.

Poem

🐰 A rabbit skips a flake with delight,
Images still build through day and night,
Coverage sleeps when the flag's set low,
Manifests gather what the builders sow,
CI hops on, steady and light.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a run_flake_check input to enable consumers to skip inline checks for their own fan-out implementations.
Description check ✅ Passed The description is directly related to the changeset, explaining the motivation (fan-out consumers need to skip monolithic checks), the solution (new run_flake_check boolean input), and its effects on the workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@openspec/specs/reusable-ci/spec.md`:
- Around line 129-137: The Inputs table is missing the new run_flake_check input
defined in the "Requirement: run_flake_check input" section; update the Inputs
table in the spec to add a row for run_flake_check (type: boolean, required: no,
default: true) and note its behavior (when true run nix flake check + coverage;
when false skip standalone flake-check job and forward value to build.yml so
inline check/coverage steps are skipped; OCI image build/push unaffected) so the
Inputs section matches the requirement text and the ci.yml contract.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 84666be6-3075-4cd2-a50b-62b968c9d46d

📥 Commits

Reviewing files that changed from the base of the PR and between 526ca03 and c43d0eb.

📒 Files selected for processing (10)
  • .github/workflows/build.yml
  • .github/workflows/ci.yml
  • openspec/changes/archive/2026-05-29-skip-monolithic-flake-check/.openspec.yaml
  • openspec/changes/archive/2026-05-29-skip-monolithic-flake-check/design.md
  • openspec/changes/archive/2026-05-29-skip-monolithic-flake-check/proposal.md
  • openspec/changes/archive/2026-05-29-skip-monolithic-flake-check/specs/oci-build/spec.md
  • openspec/changes/archive/2026-05-29-skip-monolithic-flake-check/specs/reusable-ci/spec.md
  • openspec/changes/archive/2026-05-29-skip-monolithic-flake-check/tasks.md
  • openspec/specs/oci-build/spec.md
  • openspec/specs/reusable-ci/spec.md

Comment thread openspec/specs/reusable-ci/spec.md Resolved

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a run_flake_check boolean input (defaulting to true) to the reusable workflows build.yml and ci.yml, allowing consumers to skip monolithic inline flake checks and coverage runs when parallelizing checks. The changes include updates to the reusable-ci and oci-build specifications, as well as proposal and design documentation. Feedback from the review highlights that the new input needs to be added to the inputs table in the reusable-ci specification, and that the scenario updates in the delta specification for oci-build should be synchronized with the main specification file.

Comment thread openspec/specs/reusable-ci/spec.md Resolved
…ci-build scenarios

Address review feedback on #9: add run_flake_check (and the earlier
test_systems) rows to the reusable-ci Inputs table, and add run_flake_check
to the owner/fork scenario WHEN clauses in the oci-build spec to match the
delta.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@kalbasit
kalbasit enabled auto-merge (squash) May 29, 2026 22:57
@kalbasit
kalbasit merged commit 564f503 into main May 29, 2026
1 check passed
@kalbasit
kalbasit deleted the user/wnasreddine/further-improvement branch May 29, 2026 22:57
kalbasit added a commit to kalbasit/ncps that referenced this pull request May 29, 2026
## Why

After compile-once (#1292) CI is ~10m, bottlenecked by a single `nix
flake check` building **~13 check derivations on one contended 4-core
runner**. They're logically parallel but CPU-starved; the remaining
costs (backend-cohort test execution, golangci's own analysis) aren't
cacheable — they need more cores in parallel.

## What

Replace the monolithic check with a **CI matrix**:
- `check-matrix` job enumerates checks: `nix eval .#checks.x86_64-linux
--apply builtins.attrNames --json`.
- `checks` job runs each as its own parallel runner: `nix build
.#checks.x86_64-linux.<name>` (`fail-fast: false`), pulling the shared
`_ncps-test-cache`/`_ncps-base` from Cachix instead of rebuilding.
- `coverage` job (`needs: checks`) merges per-cohort profiles → Codecov.
- The shared build job sets **`run_flake_check: false`**
(kalbasit/gh-actions#9) so it only builds/pushes the OCI image.

Wall-clock collapses from sum-under-contention (~10m) to
**slowest-single-check + nix setup (~3–4m)** — the path to the ~5m
target. The per-job times on this run also give us the first clean
per-check breakdown.

## ⚠️ Merge order
Depends on **kalbasit/gh-actions#9** (adds `run_flake_check`). The
caller is **temporarily pinned to the gh-actions branch** to validate
now; revert to `@main` before merging once #9 lands.

OpenSpec: `flake-check-topology` gains "CI runs each check as an
independent parallel job" + "Coverage is produced by a job consuming the
fanned-out cohorts".

---------

Co-authored-by: Claude Opus 4.8 <[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.

1 participant