Repository navigation
feat(scaffold): sync-issues target-branch + schedule knobs (#1228) - #1232
Merged
Merged
Conversation
Add the render matrix (workflow model x target/schedule), guard failures (bad branch name, bad cron), bootstrap-step injection, and manifest writeback for the two new sync-issues knobs. RED against the current scaffold: the keys, render_sync_settings, and guards do not exist yet. Refs: #1228
Two optional .vig-os keys, realized at scaffold time in init-workspace.sh, that steer the scaffolded sync-issues.yml: - DEVKIT_SYNC_TARGET overrides the branch the sync job commits to (default stays workflow-model-aware: dev gitflow / main trunk). A protected-main consumer points it at an unprotected mirror branch so the sync job's direct API push is no longer refused by a require-PR main ruleset (#1227); the job gains a bootstrap step that creates the branch from the default branch head if absent. - DEVKIT_SYNC_SCHEDULE overrides the schedule trigger's 5-field cron. Both are guarded loudly at scaffold time (git ref-format for the branch, a 5-field cron check) and written back to .vig-os like DEVKIT_CI_RUNNER, so upgrades preserve them. Unset => byte-for-byte unchanged. Refs: #1228
Add a "Point sync-issues at an unprotected mirror branch" subsection to the MIGRATION.md Workflow models section: the require-PR-main failure (#1227), the rejected commit-App ruleset bypass, DEVKIT_SYNC_TARGET + the branch bootstrap, DEVKIT_SYNC_SCHEDULE, the provisioning note, and the deliberate deferral of PR-based sync mode. Add both keys to the .vig-os manifest table and a CHANGELOG Unreleased entry (mirrored into the devcontainer template by sync-manifest). Refs: #1228, #1227
git check-ref-format alone accepts quotes, dollar, backticks, semicolons, pipes, and hashes: such values render invalid YAML, crash the render seds with a raw sed error, or inject commands into the bootstrap step's double-quoted shell assignment at sync runtime with the App token in scope. RED: nine hostile values (foo'bar, x$(id)y, backticks, |, #, ;, double quote, &, braces) currently pass the guard. Refs: #1228
The target value is spliced into single-quoted YAML, sed replacement text, and the bootstrap step's double-quoted shell assignment executed at sync runtime with the App token in scope. git check-ref-format alone accepts quotes, dollar, backticks, semicolons, pipes, and hashes, so a hostile value could render invalid YAML, crash the render seds, or inject commands. Gate on a strict [A-Za-z0-9._/-] allowlist first and keep the ref-format check for git-illegal shapes the allowlist admits. Also drop the unsupported Quartz `?` from the cron field charset. Refs: #1228
Contributor
Author
|
Review remediation pushed:
Verified end-to-end: all reviewer repros ( Nit 2 checked: the MIGRATION.md anchor Evidence: |
This was referenced Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add two optional
.vig-osknobs, realized entirely at scaffold time, that steer the scaffoldedsync-issues.yml. They remediate #1227: trunk consumers whosemaincarries a require-PR ruleset cannot let the sync job's direct API push land onmain.DEVKIT_SYNC_TARGET— the branch the sync job commits to. Default stays workflow-model-aware (devgitflow /maintrunk), byte-for-byte unchanged when unset. A protected-mainconsumer points it at an unprotected mirror branch (e.g.sync/issue-mirror); the scaffolded job then gains a bootstrap step that creates the branch from the default branch head if absent. The mirror diverges permanently and is never merged back — each sync regenerates full state.DEVKIT_SYNC_SCHEDULE— cron override for the schedule trigger (default0 2 * * *). Realized at scaffold time because schedule triggers cannot take inputs.Both are guarded loudly at scaffold time (git ref-format for the branch, a 5-field cron check) and written back to
.vig-oslikeDEVKIT_CI_RUNNER, so upgrades preserve them with no flags.Design recap
maincan change whatever that branch controls, e.g. applied org config). The mirror-branch approach keeps the App off protectedmain.DEVKIT_WORKFLOW/DEVKIT_CI_RUNNER: read before the template overwrite, guarded, rendered, written back.render_sync_settings()runs afterrender_workflow_model(), so a custom target overrides the workflow-model default already in the file; both are no-ops when unset.sed rafter the unique app-tokenprivate-key:line, before the sync-job checkout), so an unconfigured workspace is unchanged. It uses the App token (same as the commit push) andgh api .../git/refs; rendered output validated withactionlint.Decisions / deviations from the issue spec
install.shunchanged. These are pure.vig-oskeys with no CLI flag (schedule triggers can't take inputs), so — exactly likeDEVKIT_CI_RUNNER/DEVKIT_TAG_PREFIX— they are resolved end-to-end ininit-workspace.sh, which reads the consumer's.vig-osdirectly.install.shonly handles keys it needs for its own flags (mode/workflow) or identity; adding handling there would be dead code against precedent. The issue mentioned "the install script", but following the real precedent keeps the diff minimal and consistent.docsmodule inNIX.md). Placing a sync-mode note there is topically wrong, so I applied the pattern (a "Deliberate exclusion" note) in the topically-correct new MIGRATION.md sync subsection.Test evidence
tests/test_sync_settings.py— 14 passed (RED first: 12 failed / 2 unset-preservation passed before implementation).test_workflow_model.py,test_ci_runner.py,test_install_script.py,test_scaffold_lint.py,test_workflow_sync_checkout.py, and more — 174 passed together.tests/bats/init-workspace.bats— 237 passed (was 232; +5 for sync-issues knobs: DEVKIT_SYNC_TARGET + DEVKIT_SYNC_SCHEDULE (target 1.4.1) #1228).sync-issues.yml: valid YAML +actionlintclean; bootstrap step sits after the app-token step, before the sync-job checkout.prek run --all-files— green.shellcheck assets/init-workspace.sh— clean.Target release: 1.4.1
Refs: #1228
Refs: #1227