Skip to content

fix(workspace): isolate dev-shell env dump from shellHook stdout - #1190

Merged
c-vigo merged 2 commits into
release/1.4.0from
bugfix/1189-env-forward-shellhook-banner
Jul 17, 2026
Merged

c-vigo merged 2 commits into
release/1.4.0from
bugfix/1189-env-forward-shellhook-banner

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Summary

1.4.0-rc2 consumer validation failed on every direnv-mode host CI job (org-config vig-os/org-config#54, sync-issues-action vig-os/sync-issues-action#143) at "Set up devkit toolchain":

##[error]Unable to process file command 'env' successfully.
##[error]Invalid format 'devcontainer dev environment loaded (nix)'

The #1180 shellHook env forward captured the whole stdout of nix develop as the env dump, so the scaffolded flake's shellHook banner glued onto the first NUL-delimited record and produced an invalid GITHUB_ENV heredoc name. Both banner and action are devkit-managed — every direnv consumer breaks and cannot fix it locally. rc2's smoke test missed it because the smoke-test consumer is container-mode.

Fix (TDD)

  • dcbcbd02 test (RED): stub nix now echoes the banner on stdout on every invocation, exactly like the real flake; asserts the banner never reaches GITHUB_ENV and the first env record survives. Reproduced the exact live corruption.
  • 20b6d58b fix (GREEN): dump the env to a file inside the shell command (--command bash -c 'env -0 > "$1"' _ <file>) so shellHook stdout stays on the job log; plus defense in depth — skip any record whose name is not a valid env identifier. 19/19 tests green.

The step's other two stdout captures (PATH, UV download URL) are already banner-safe via their grep filters; the env dump was the only raw capture.

Note: 4 unrelated local pytest failures against the stale local :dev image (missing DOWNSTREAM_RELEASE.md / 1.4.0 devtools) — CI builds fresh.

Per the RC-validation runbook this targets release/1.4.0; rc3 follows. Second rc finding after #1187.

Refs: #1189

c-vigo added 2 commits July 17, 2026 16:59
The #1180 env forward captured the whole stdout of nix develop as the
env dump, so the scaffolded flake's shellHook banner glued onto the
first NUL record and produced an invalid GITHUB_ENV name, failing every
direnv-mode consumer CI job. Dump the env to a file inside the shell
command instead, and skip any record whose name is not a valid env
identifier as defense in depth.

Refs: #1189
@c-vigo
c-vigo merged commit b533ef9 into release/1.4.0 Jul 17, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/1189-env-forward-shellhook-banner branch July 17, 2026 15:16
c-vigo added a commit that referenced this pull request Jul 20, 2026
…el (#1215)

## Summary

Unfreezes release/1.4.0 by merging `dev` into it, deliberately pulling
epic #1205 (per-consumer `DEVKIT_WORKFLOW` gitflow/trunk model, merged
to dev via #1212) and the renovate `github-backup` 0.64.0→0.64.2 bump
(#1213) into the 1.4.0 release. **This deviates from the epic's
documented 1.5.0 target** — accepted trade-off: an rc5 was required
anyway (the branch is five fixes past rc4), and gitflow consumers get a
provable byte-for-byte no-op.

## Gates cleared before this merge

- **Dev composite tree proven green**: the merged dev head `4ac2ca90`
(feature + renovate bump as one tree) passed a full dispatched `ci.yml`
run
([29726877354](https://github.com/vig-os/devkit/actions/runs/29726877354))
— the pre-merge PR checks had only tested stale bases.
- **Epic completeness audited**: every acceptance criterion of
#1206–#1211 mapped to merged code; gitflow no-op pinned by
`test_gitflow_scaffold_matches_default_path` and
`test_gitflow_render_files_are_byte_identical_to_template`. Sub-issues
remain open only as bookkeeping (dev-PR `Refs:` doesn't auto-close).

## Merge composition

Two real conflicts, composed to preserve both sides:

- `assets/init-workspace.sh`: kept #1196's `MODE_CONFIG_EXCLUDES` array
(supersedes dev's older explicit exclude blocks) **and** appended
#1205's trunk-only `sync-main-to-dev.yml` exclude + preview skip-guard;
`render_workflow_model()` and its invocation intact.
- `tests/bats/init-workspace.bats`: additive union of #1195's
chmod-scope test and #1205's six trunk tests.

CHANGELOG surgery: dev's two Unreleased entries moved into the `[1.4.0]`
section (Added/Changed), `## Unreleased` restored to the empty skeleton
(#590 invariant); `assets/workspace/.devcontainer/CHANGELOG.md`
re-synced byte-identical (sync-manifest hook green). All seven
release-branch hardening fixes (#1190 #1193 #1199 #1200 #1201 #1202
#1204) survive.

## Verification

- Targeted suites: 66 passed (`test_workflow_model`,
`test_install_script`, `test_workflow_prepare_extension`,
`test_workflow_sync_checkout`)
- Full pytest: 1098 passed, 28 skipped; 3 failures all
environmental/pre-existing (2× `vig-utils` `TestFindRepoRoot` env, 1×
`test_manifest_files` stale local image — CI rebuilds)
- bats: 331 ok, 0 not ok (`init-workspace.bats`, `install.bats`)
- `pre-commit run --all-files`: fully green
- Containment: `git log HEAD..origin/dev` empty; diff vs dev = release
fixes + changelog structure only

## After merge

Cut **rc5** (required regardless of this PR) and extend rc validation
with the trunk-render suites + a gitflow-consumer scaffold byte-identity
check.

Refs: #1205
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