Skip to content

ci(ci.yml): run the four block steps as one Python call each (GEN-005, #2851) - #2852

Merged
zackees merged 2 commits into
masterfrom
infra/2851-ci-yml-gen005-steps
Oct 28, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/2851-ci-yml-gen005-steps

Conversation

@zackees

@zackees zackees commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Fixes #2851. Refs #962.

GEN-005's shell budget is one line per run:; four steps in
.github/workflows/ci.yml were over it. Each is now one
uv run --no-project --script ci/ci_gate_steps.py <subcommand> call.

RED — 50ed624e8

ci/test_ci_gate_steps.py only, against master's workflow and ci.toml:

$ uv run ci/test_ci_gate_steps.py
FAILED (failures=17, errors=2)

Nothing to import (ci/ci_gate_steps.py absent), run: | still in the two
jobs, and the path's GEN-005 [[exceptions]] block still in ci.toml.

GREEN — 2c7d6f146

Job Step Subcommand
flatpak-runtime-reuse Record Export Provenance record-export-provenance
flatpak-runtime-reuse Install Runtime Test Infrastructure install-runtime-deps
flatpak-runtime-reuse Run Installed Flatpak with Saved Capture Profile run-saved-capture-profile
tier2-setup-consumer Validate Prepared OFF and ON Suites validate-prepared-suites

Each subcommand keeps its step's argv and exit status: the run-id and 40-hex
checks with the step's own message, the gh api … --jq .head_sha argv, the two
apt-get calls with their -o Acquire::* options and the same 21 packages, the
tar -xf + ci/flatpak_runtime.py pair, and the single docker run with
OBS_TIER2_MODES=OFF ON and the uv bind mount resolved on the host.

Evidence:

$ uv run ci/test_ci_gate_steps.py
Ran 16 tests ... OK

$ uv run ci/local_gate.py --only self-test
+ unittest: 294 ci/test_*.py files, 8 at a time
== self-test: ok

$ uvx --from git+https://github.com/zackees/ci.yml@a1917ce76 ci-lint precheck
ci-lint precheck: 5 violation(s), 356 approved exception(s), 10 needs_review

Before: 5 violation(s), 360 approved exception(s), 10 needs_review. No other
rule moved; the path's GEN-005 block is gone.

Two pre-existing pins executed the ported steps as shell, so they are repointed
in the same commit: ci/test_host_apt_failover.py drives
install-runtime-deps through the module with the same sudo/apt-get stubs
(failover at mirror/update/install still propagates 42 and the call count still
matches), and ci/test_flatpak_runtime.py reads
FLATPAK_ARTIFACT_SOURCE/FLATPAK_ARTIFACT_RUN out of the module instead of
the workflow block.

What this PR does not prove

Both jobs are workflow_dispatch-gated — flatpak-runtime-reuse needs
inputs.flatpak-runtime-reuse-run, tier2-setup-consumer is skipped by
inputs.native-cache-measurement-only — so PR CI cannot run either and no
remote run is claimed here. The evidence is the offline pins plus the precheck
header; the first dispatch that exercises those two inputs is the run-path proof.

RED: with the four `run: |` steps still in .github/workflows/ci.yml and no
ci/ci_gate_steps.py, every case here fails: nothing to import, `run: |` still
present, the GEN-005 [[exceptions]] block still in ci.toml.

Refs #2851, #962.
…#2851)

`ci/ci_gate_steps.py` carries them, one subcommand per step:

- `record-export-provenance` is `Record Export Provenance`: the numeric
  `SOURCE_RUN` check with the step's own message, `gh api
  repos/$GITHUB_REPOSITORY/actions/runs/$SOURCE_RUN --jq .head_sha`, the 40-hex
  check, then `FLATPAK_ARTIFACT_SOURCE`/`FLATPAK_ARTIFACT_RUN` into `$GITHUB_ENV`.
- `install-runtime-deps` is `Install Runtime Test Infrastructure`: the mirror
  preference under `sudo -E` through the runner's uv, then the two `apt-get`
  calls with their retry/timeout options and the same 21 packages.
- `run-saved-capture-profile` is `Run Installed Flatpak with Saved Capture
  Profile`: the `tar -xf` of the downloaded OSTree repo, then
  `ci/flatpak_runtime.py --repo … --output …`.
- `validate-prepared-suites` is `tier2-setup-consumer`'s `Validate Prepared OFF
  and ON Suites`: the `tar --zstd` extraction, the `bundle.json` `image_id`
  read, and the one `docker run` with the same mounts and `OBS_TIER2_MODES=OFF
  ON`. The uv bind mount stays host-resolved (`shutil.which('uv')`).

The path's `GEN-005` `[[exceptions]]` block goes. `ci-lint precheck` header:
`5 violation(s), 360 approved exception(s), 10 needs_review` ->
`5 violation(s), 356 approved exception(s), 10 needs_review`, no other rule
moving.

Two existing pins drove the ported steps in shell, so they are repointed:
`ci/test_host_apt_failover.py` runs `install-runtime-deps` through the module
with the same `sudo`/`apt-get` stubs, and `ci/test_flatpak_runtime.py` reads the
published variables out of the module instead of the workflow block.

Both jobs are `workflow_dispatch`-gated, so PR CI cannot run either: the
evidence here is the offline pins, `ci/local_gate.py --only self-test` (294
files, ok) and the precheck header.

Refs #2851, #962.
@zackees
zackees marked this pull request as ready for review October 28, 2026 23:20
@zackees
zackees added this pull request to the merge queue Oct 28, 2026
@zackees

zackees commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator.

Queued on master (mergeQueue shows #2852 as its entry). Green before queueing: Build 🧱 / Fast Gate ⚡, Format 🔍 / checks, Validate Data 🕵️, Build 🧱 / Event Data 🔎, Build 🧱 / CI Mode 🛂, CI Gate ✅; every build lane is skipping, which is what a ci/-only change should do.

No local-gate stamp: the PR touches only .github/workflows/ci.yml, ci.toml and ci/ (no Rust, C, CMake or build input), so it is the documented no-stamp case. Local evidence in the body is ci/test_ci_gate_steps.py (16 cases), ci/local_gate.py --only self-test (294 files, ok) and the precheck header 360 -> 356 approved, no other rule moving.

The one thing a reviewer should not expect from this PR: a run of the two jobs it ports. Both are workflow_dispatch-gated, so the first dispatch with flatpak-runtime-reuse-run set and a prepared tier2 bundle is the run-path proof.

Merged via the queue into master with commit c26634f Oct 28, 2026
34 checks passed
@zackees
zackees deleted the infra/2851-ci-yml-gen005-steps branch October 28, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

infra: port ci.yml's four block run: steps to Python (GEN-005 sweep)

1 participant