Skip to content

chore(ci): extract remaining workflows' inline bash into scripts/ci/ (#724) - #739

Merged
athvin merged 2 commits into
mainfrom
issue/724-workflows-sweep
Nov 6, 2026
Merged

athvin merged 2 commits into
mainfrom
issue/724-workflows-sweep

Conversation

@athvin

@athvin athvin commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Closes #724

What this does

The program's final sweep: ten scripts across six workflows, −389/+44 workflow lines, with the bodies extracted programmatically (PyYAML-read, written byte-exact).

Workflow Extracted Notes
agent-task.yml agent-publish.sh; mold step → shared install-mold.sh One deliberate semantic change: the old mold copy hard-failed after three attempts; the shared script falls back to the default linker, so a flaky mirror slows the agent instead of killing its task. The publish job gains contents: read + a checkout solely to have scripts/ on disk — every write still uses the App token. Resolve task id stays inline: it computes the checkout ref, so it runs before any checkout exists and cannot live in the tree it precedes.
infra.yml infra-detect.sh, charts-render-validate.sh, tf-plan-run.sh, tf-comment-upsert.sh; plan-gate → gate-all-legs.sh The two tf-* names are deliberate per the ticket's prefix rule (genuine terraform helpers: rust-gate-exempt, infra-triggering). plan-gate's skipped-passes-for-fork-PRs semantics are preserved (gate-all-legs treats skipped as a noted pass) with the fork-PR rationale kept as a YAML comment.
frontend.yml frontend-detect.sh + frontend-paths.sh (sourced); e2e-gate → gate-all-legs.sh The filter and the content-addressed key used to carry two copies of the input regex with a keep-in-sync comment; both now source one FRONTEND_INCLUDE, the same structure rust.yml's detect has with detect-paths.sh.
kind.yml kind-diagnostics.sh Added to kind.yml's paths: filter, per its explicit-script-paths rule.
images.yml images-detect.sh Added to the push paths: filter — same rule.
drift.yml drift-summary.sh matrix.key passed as STACK_KEY env.

The detect scripts' patterns gain their own filenames (and gate-all-legs.sh where it gates), keeping the property that a change to a gate runs the gate.

Ticket drift: agentics-maintenance.yml is not touched — it is generated by gh aw compile ("DO NOT EDIT" header), so its forecast block falls under the ticket's own generated-file exclusion; the listing of it had drifted.

Verified

  • All three detect scripts exercised both directions against real ranges: 2bdb336c (the Move frontend/dev/*.sh into scripts/frontend-dev/ #718 merge) → frontend=true, charts=true, rust=true frontend=true; a scripts-only range → all false; both fail-safe branches (all-zero before-SHA, diff-less event) fire
  • actionlint.sh ok (433 pins — the three new checkouts use the house-pinned SHA); every workflow parses; scripts-home-check ok (40 scripts); bash -n on all ten; skills-check regen only moves the chart-coverage row (committed)
  • Live proof on this PR: rust + frontend + infra gates all run here (the detect scripts, both reused gates, render-validate and tf-plan-run execute in this PR's own runs); kind/images/drift/agent-publish are post-merge or on-demand surfaces, verified by emitted log lines when they next run.

…724)

Ten scripts across six workflows (-389/+44 workflow lines), bodies
extracted programmatically so the logic is byte-exact:

- agent-task: agent-publish.sh; the mold copy now reuses the shared
  install-mold.sh — one semantic change, deliberate: the old copy
  hard-failed after three attempts, the shared script falls back to the
  default linker, so a flaky apt mirror slows the agent instead of
  killing its task. The publish job gains contents:read + checkout
  solely to have scripts/ on disk; every write still uses the App
  token. The 'Resolve task id' step STAYS INLINE: it computes the
  checkout ref, so it runs before any checkout exists and cannot live
  in the tree it precedes.
- infra: infra-detect.sh, charts-render-validate.sh, tf-plan-run.sh
  and tf-comment-upsert.sh (tf- prefix: genuine terraform helpers, so
  DETECT_EXEMPT for the rust gate and triggers for infra.yml);
  plan-gate reuses gate-all-legs.sh (same semantics, incl.
  skipped-passes for fork PRs) and gains a checkout.
- frontend: the filter/key regex now lives ONCE in frontend-paths.sh,
  sourced by both frontend-detect.sh and the key step — they used to
  carry two copies with a keep-in-sync comment; e2e-gate reuses
  gate-all-legs.sh and gains a checkout.
- kind: kind-diagnostics.sh, added to kind.yml's paths filter.
- images: images-detect.sh, added to the push paths filter.
- drift: drift-summary.sh (matrix.key passed as STACK_KEY env).

The detect scripts' patterns gain their own filenames (and
gate-all-legs.sh where it gates), keeping the property that a change
to a gate runs the gate.

agentics-maintenance.yml is NOT touched: it is generated by gh aw
compile ('DO NOT EDIT'), so its forecast block is out of scope by the
ticket's own generated-file exclusion — the ticket's listing of it had
drifted.

Verified: all three detect scripts exercised both directions against
real ranges (frontend/charts/images positives on 2bdb336, all-false
on a scripts-only range, both fail-safe branches fire); actionlint 433
pins ok; every workflow still parses; scripts-home-check 40 scripts;
regen only moves the chart-coverage row.
@athvin
athvin marked this pull request as ready for review November 6, 2026 11:41
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

terraform plan

b7f6035 · run log and full plans

env add change destroy
state-backend (plan only) 0 0 0
core 0 0 0
dev 0 0 0
prod 0 0 0

Planned with -refresh=false, so this is the config-versus-state diff and
not out-of-band drift. That is a security choice, not a speed one: a refreshing
plan reads secret values, and the plan role is assumable from any PR branch —
which can edit the workflow it runs under. Drift is caught at apply time, which
refreshes fully.

@athvin
athvin merged commit 6cb1685 into main Nov 6, 2026
52 checks passed
@athvin
athvin deleted the issue/724-workflows-sweep branch November 6, 2026 12:14
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.

Extract remaining workflows' inline bash (agent-task, infra, frontend, kind, images, drift, agentics-maintenance)

2 participants