Skip to content

fix(workflow-model): scrub residual dev prose in trunk render - #1229

Merged
c-vigo merged 3 commits into
devfrom
bugfix/1226-trunk-render-prose
Jul 21, 2026
Merged

c-vigo merged 3 commits into
devfrom
bugfix/1226-trunk-render-prose

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Summary

Both live trunk switches (vig-os/org-config#64, exo-pet/exo-fleet#230) flagged
cosmetic residue: render_workflow_model() retargeted only functional literals,
so a trunk consumer still shipped comments naming dev. This extends the
anchored render to rewrite the four inert prose spots too — comments and input
descriptions only, no functional change
. gitflow is unaffected (the render is a
no-op there) and the templates are untouched, so gitflow output stays
byte-identical.

Follows the prepare-release.yml precedent (#1208), which already rewrites inert
dev step-names/comments to main for trunk in the same function.

Before / after (trunk-rendered)

File Before After
ci.yml header # - Pull requests to dev, release/**, and main # - Pull requests to release/** and main
ci.yml commit-gate rationale # … reachable from origin/dev — a no-op on a dev PR / # (its base IS dev) … # … reachable from origin/main — a no-op on a main PR / # (its base IS main) …
codeql.yml header # - Pull requests to dev, release/**, and main # - Pull requests to release/** and main
sync-issues.yml target-branch description … (e.g., dev, release/x.y.z). … (e.g., main, release/x.y.z).

A trunk scaffold now contains no stray dev workflow-branch prose in these
files (legit devkit / dev-shell tokens are untouched).

Test evidence

  • Extended tests/test_workflow_model.py (targeted string assertions, no
    over-assert) in test_trunk_ci_pr_filter_excludes_dev,
    test_trunk_codeql_pr_filter_excludes_dev, and
    test_trunk_sync_issues_default_main. TDD: assertions committed failing first
    (test:), then the render fix made them pass (fix:).
  • uv run pytest tests/test_workflow_model.py → 19 passed.
  • prek run --all-files → all hooks green.
  • The two pre-existing TestVersionCheckInitWorkspace failures are unrelated
    (reproduce on the base release commit d16541f5; environment-specific).

Concurrency note

Issue #1228 concurrently adds functional sync-target knobs to the
sync-issues.yml template and render function. This PR touches the
sync-issues.yml block of render_workflow_model (one added comment-only sed
line) and may need a trivial rebase after the #1228 PR lands (or vice versa).
Changes here are strictly comments/descriptions.

Refs: #1226

c-vigo added 2 commits July 21, 2026 09:16
Extend the trunk render suite to require that a trunk-scaffolded
ci.yml, codeql.yml, and sync-issues.yml carry no stray `dev` prose:
the trigger-header comments, the origin/dev commit-gate rationale, and
the sync-issues target-branch example must retarget dev -> main like
the functional literals already do. Targeted string assertions avoid
tripping on legit devkit/dev-shell tokens.

Fails until render_workflow_model rewrites these prose spots.

Refs: #1226
render_workflow_model retargeted only functional literals, so trunk
consumers shipped comments still naming `dev`. Extend the anchored
render to rewrite the inert prose too (comments/descriptions only, no
behavior change), matching the prepare-release precedent (#1208):

- ci.yml / codeql.yml trigger-header comment: drop `dev` from the
  "Pull requests to …" list.
- ci.yml origin/dev commit-gate rationale comment: dev -> main.
- sync-issues.yml target-branch input description example: dev -> main.

gitflow is unaffected (the render is a no-op there); the templates are
untouched so gitflow output stays byte-identical.

Refs: #1226
@c-vigo
c-vigo merged commit 20407d0 into dev Jul 21, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/1226-trunk-render-prose branch July 21, 2026 08:00
c-vigo added a commit that referenced this pull request Jul 21, 2026
…(trunk) (#1243)

## Problem

Follow-up to #1226 (PR #1229). The trunk workflow-model render scrubs
residual `dev` prose from `prepare-release.yml`, `ci.yml`, `codeql.yml`
and `sync-issues.yml`, but `render_workflow_model()` never touched
`promote-release.yml`. Two comments there name `sync-main-to-dev`:

- `assets/workspace/.github/workflows/promote-release.yml:8` — `# 3.
merge: merge release/X.Y.Z PR to main (triggers sync-main-to-dev)`
- `assets/workspace/.github/workflows/promote-release.yml:473` — `echo
"... merged to main (sync-main-to-dev may run next)"`

`sync-main-to-dev.yml` is copy-excluded in trunk mode (EXCLUDE_ARGS), so
trunk consumers ship comments referencing a workflow absent from their
repo. Cosmetic only, same class as #1226 — a pre-existing gap, not a
regression from PR #1229.

## Root cause

`render_workflow_model()` (`assets/init-workspace.sh`) enumerates the
files it retargets; `promote-release.yml` was simply not among them.

## Fix

Add an anchored `promote-release.yml` block to the trunk render that
drops both parentheticals (comments only, no behavior change). The
template is untouched, so gitflow output stays byte-identical (the
render early-returns for non-trunk).

```
sed -i 's| (triggers sync-main-to-dev)||' "$prom"
sed -i 's| (sync-main-to-dev may run next)||' "$prom"
```

## Test evidence

New test `test_trunk_promote_release_has_no_sync_main_to_dev_prose`
asserts a trunk-scaffolded `promote-release.yml` carries no
`sync-main-to-dev` mention; `promote-release.yml` is also registered in
the gitflow byte-identical guard (`NO_PLACEHOLDER_RENDER_FILES`).

- **RED** (test commit): `assert 'sync-main-to-dev' not in text` failed
on the two parentheticals.
- **GREEN** (fix commit): full `tests/test_workflow_model.py` suite —
**21 passed**.
- **gitflow no-op**:
`test_gitflow_render_files_are_byte_identical_to_template` (now covering
`promote-release.yml`) and `test_gitflow_scaffold_matches_default_path`
both green; the trunk-filtered bats suite (5 tests) green.
- `just precommit` (full suite, both hook environments) — all green, no
auto-fixes.

Closes #1233
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