Skip to content

feat(workflow): scaffold self-polling devkit-upgrade workflow - #1298

Merged
c-vigo merged 4 commits into
devfrom
feature/1296-devkit-upgrade-workflow
Jul 30, 2026
Merged

c-vigo merged 4 commits into
devfrom
feature/1296-devkit-upgrade-workflow

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Closes #1296

Summary

Scaffolds a self-polling devkit-upgrade.yml workflow into consumers: weekly (Monday 06:00, aligned with the Renovate window) it queries devkit's releases/latest, and when the repo's .vig-os pin is behind it runs the full-fidelity install.sh --force --version <X> upgrade — pin + flake.lock vigos node + scaffold regeneration move together — commits inside the project shell so consumer hooks run (dist rebuild, trailer strip, commit-msg validation), and opens the adoption PR. workflow_dispatch with an explicit version input (final or rc) is the release-train / lane-re-bump path. Merging stays human. Depends on the #1295 drift gate (PR #1297) as its safety net.

Design

  • Feature group: new devkit-upgrade group in the feat(workspace): manifest-driven scaffold feature opt-outs (release, sync-issues, scanning, skills, worktree) #1284 opt-out mechanism (never ship the file at all), composing with the runtime knobs:
  • DEVKIT_AUTO_UPGRADE (.vig-os, default enabled): gates the schedule path only; manual dispatch always runs. DEVKIT_UPGRADE_EXCLUDE: comma-separated paths reset before the adoption commit (e.g. vault's generated-doc churn). Both round-trip across --force upgrades.
  • Version logic: releases/latest excludes prereleases/drafts, so cron never proposes an rc; a prerelease-aware compare makes the schedule a no-op when the pin is current or ahead (an rc of a newer train is never downgraded). Resolved versions are strictly semver-validated before reaching any shell/gh sink.
  • Train keying: adoption issue/branch/PR key on the train (chore/<issue>-devkit-1-5-0, dots→dashes for the branch guard), so rc1→rc2→final reuse one issue/branch/PR force-updated; commit + PR title carry the exact version.
  • Base branch: ships dev literals, retargeted to main at scaffold time for trunk repos via render_workflow_model (the sync-issues.yml precedent).
  • Token: dedicated DEVKIT_UPGRADE_TOKEN secret (fail-fast with a clear error when absent) — the default GITHUB_TOKEN is used only for the read-only release query, since PRs it creates don't trigger CI. Commit identity configurable via vars.DEVKIT_UPGRADE_AUTHOR_NAME/EMAIL; the default avoids the agent-blocklist.
  • Security: every untrusted value (dispatch input, event fields, API responses) routed through env:; actions SHA-pinned; permissions: {} at workflow level, contents: read on the job. One deliberate zizmor artipacked baseline entry (the checkout persists the dedicated token because the branch push needs it), commented in zizmor.yml.

Test evidence

  • tests/test_workflow_devkit_upgrade.py (new, 15 tests; RED-first) + workflow-model/sync-settings/scaffold-lint/zizmor-baseline/ci-runner suites: 121 passed
  • tests/bats/init-workspace.bats (feature-group assertions): 275/275 pass
  • zizmor --offline over the workspace templates: no findings
  • prek run --all-files: green (both hook layers)

Reviewer notes

  • Provisioning is deliberately out of code scope: the DEVKIT_UPGRADE_TOKEN App/PAT identity (and optional DEVKIT_UPGRADE_AUTHOR_* variables) must be created per the feat(workflow): self-polling devkit-upgrade workflow (auto adoption PR in consumers) #1296 checklist before the workflow can act; until then it fails fast with a pointer. The default author email is a placeholder — set the real identity at provisioning.
  • Live proof requires a consumer: this template never executes in devkit's own CI; first end-to-end validation comes with the first consumer adoption (worth exercising via workflow_dispatch on one lane during the 1.5.0 rollout).
  • The nix develop -c git commit step assumes a flake-bearing (direnv/both) consumer — true for all five current consumers; bare/devcontainer-only consumers are out of scope per the issue.
  • Untracked files matching DEVKIT_UPGRADE_EXCLUDE are not reset (git checkout -- only restores tracked paths) — acceptable for the known use case (tracked generated PDFs).
  • Merge-order note: this PR and feat(workflow): add scaffold-drift CI gate (DEVKIT_DRIFT_CHECK) #1297 both touch CHANGELOG.md, .vig-os, and init-workspace.sh; whichever merges second needs a trivial conflict resolution (GitHub merges don't apply the changelog union driver).

Refs: #1296

c-vigo added 4 commits July 29, 2026 13:56
Cover the self-polling devkit-upgrade workflow deliverable: the two .vig-os
runtime knobs, the managed template shape (triggers, latest-release check,
prerelease-aware compare, dedicated token, install.sh + nix develop commit),
the no-template-injection rule over run blocks, the workflow-model base-branch
retarget, and the devkit-upgrade feature opt-out.

Refs: #1296
Ship a managed devkit-upgrade.yml into consumers: a weekly schedule (Monday,
aligned with the Renovate window) polls devkit's public releases/latest and,
when DEVKIT_VERSION is behind, runs install.sh --force to move the pin, the
flake.lock vigos node and the whole scaffold together — committing inside the
project shell so consumer hooks run — then opens the adoption PR. A
workflow_dispatch version input drives the release-train / rc re-bump path.

The version check is prerelease-aware (no-op when current or ahead) so a
consumer on an rc of a newer train is never downgraded; the adoption issue,
branch and PR are keyed on the train and reused across rc->final. Two runtime
.vig-os knobs (DEVKIT_AUTO_UPGRADE gates the schedule; DEVKIT_UPGRADE_EXCLUDE
resets paths before the commit) plus a new devkit-upgrade feature group opt out.

Untrusted values (dispatch input, event fields, API responses) are routed
through env and the resolved version is strictly validated before it reaches
any shell/gh sink; the deliberate persist-credentials push is baselined in
zizmor.yml. The base branch is workflow-model aware via render_workflow_model.
Requires a dedicated DEVKIT_UPGRADE_TOKEN (fail-fast when absent).

Refs: #1296
Union-resolves the #1295/#1296 overlap in CHANGELOG.md (+ mirror), .vig-os
and init-workspace.sh after PR #1297 merged to dev.

Refs: #1296
@c-vigo
c-vigo merged commit 4772c62 into dev Jul 30, 2026
20 of 22 checks passed
@c-vigo
c-vigo deleted the feature/1296-devkit-upgrade-workflow branch July 30, 2026 08:50
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