Skip to content

build(devkit): adopt devkit 1.2.1 to fix release automation - #80

Merged
c-vigo merged 1 commit into
release/0.3.0from
chore/79-adopt-devkit-1-2-1
Jul 15, 2026
Merged

c-vigo merged 1 commit into
release/0.3.0from
chore/79-adopt-devkit-1-2-1

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

What & why

Adopt vigOS devkit 1.2.1 to unblock the 0.3.0 release, which failed in
the automated release workflow (Fixes #79).

Root cause: the scaffolded release-core.yml applied the draft + approval
gate to every release kind, so a release_kind=candidate dispatch aborted
against its still-draft PR (ERROR: PR #N is still in draft). devkit 1.2.1
guards that gate behind release_kind=final — candidates gate on CI only, the
main-protecting approval is re-enforced at promote (vig-os/devkit#1095).

Changes

  • release-core.yml — regenerated from the 1.2.1 scaffold; the draft +
    approval gate is now release_kind=final-only (the Release 0.3.0 failed — automatic rollback #79 fix).
  • flake.nix / flake.lock / .vig-os — vigos input and
    DEVKIT_VERSION bumped to 1.2.1 (kept in sync per devkit#1093).
  • Reconciled the build(devkit): adopt devkit 1.2.0 and declare the v tag scheme #76 manual workarounds now fixed upstream (devkit#1092):
    • Removed the bespoke dist/.gitignore; the managed .gitignore now ignores
      the dist/src/ tsc/ncc declaration byproducts while keeping
      dist/index.js + dist/package.json tracked.
    • Moved the flake-generated .pre-commit-config.yaml symlink ignore to the
      new consumer-owned .gitignore.project (the #1092 auto-seed only fires
      when the store symlink resolves at scaffold time, which a direnv-mode
      container upgrade can't do).
  • Restored the [TASK] Adopt DEVKIT_TAG_PREFIX=v and floating major/minor tags once devkit ships them #62 tag scheme in .vig-os — the 1.2.1 scaffold reset
    DEVKIT_TAG_PREFIX and DEVKIT_FLOATING_TAGS to defaults; restored
    v / major,minor so 0.3.0 still ships vX.Y.Z tags and moves v0 / v0.X.
  • CHANGELOG — updated the [0.3.0] devkit bullet to reflect shipping on
    1.2.1 and the Release 0.3.0 failed — automatic rollback #79 fix.

Verification

  • just precommit (full prek suite) green locally, including
    no-commit-to-branch.
  • Bundle rebuilt with the pinned toolchain (npm ci && npm run bundle);
    dist/index.js did not drift — the only dist/ change is the intentional
    dist/.gitignore removal (dist-check parity).

Note

gh issue develop generated a build/79-… branch name, which the enforced
branch-naming hook rejects (build/ isn't an allowed prefix; dots aren't valid
in the slug). This PR uses the compliant chore/79-adopt-devkit-1-2-1; the
empty build/79-adopt-devkit-1.2.1 branch it left on the remote can be deleted.

Release 0.3.0 failed in the automated release workflow (#79): the
scaffolded release-core.yml applied the draft + approval gate to every
release kind, so a release-candidate dispatch aborted against its
still-draft PR. devkit 1.2.1 guards that gate behind release_kind=final
(candidates gate on CI only), fixing the failure (vig-os/devkit#1095).

Re-scaffolded onto 1.2.1 and bumped the vigos flake input and
DEVKIT_VERSION to 1.2.1 (kept in sync). Reconciled the #76 manual
workarounds now fixed upstream by vig-os/devkit#1092:

- Removed the bespoke dist/.gitignore; the managed .gitignore now ignores
  the dist/src/ tsc/ncc declaration byproducts while keeping dist/index.js
  and dist/package.json tracked.
- Moved the flake-generated .pre-commit-config.yaml symlink ignore to the
  new consumer-owned .gitignore.project (its #1092 auto-seed only fires
  when the store symlink resolves at scaffold time, which a direnv-mode
  container upgrade cannot do).

Also restored DEVKIT_TAG_PREFIX=v and DEVKIT_FLOATING_TAGS=major,minor in
.vig-os, which the 1.2.1 scaffold reset to defaults; the #62 tag scheme
must survive the upgrade or 0.3.0 would ship bare X.Y.Z tags.

Refs: #79
@c-vigo
c-vigo merged commit b9ad5db into release/0.3.0 Jul 15, 2026
15 checks passed
@c-vigo
c-vigo deleted the chore/79-adopt-devkit-1-2-1 branch July 15, 2026 12:28
c-vigo added a commit to vig-os/devkit that referenced this pull request Jul 15, 2026
## Description

An `install.sh --force` upgrade reset `DEVKIT_TAG_PREFIX` and
`DEVKIT_FLOATING_TAGS` in a consumer's `.vig-os` manifest back to the
empty template defaults, silently discarding consumer-set values.
Action-publishing consumers set `DEVKIT_TAG_PREFIX=v` /
`DEVKIT_FLOATING_TAGS=major,minor`; after an upgrade the next release
cut bare `X.Y.Z` tags and stopped moving floating tags — a silent
release-integrity regression, observed on the `vig-os/commit-action`
1.2.0 → 1.2.1 upgrade (vig-os/commit-action#80).

Closes #1116

## Type of Change

- [ ] `feat` -- New feature
- [x] `fix` -- Bug fix
- [ ] `docs` -- Documentation only
- [ ] `chore` -- Maintenance task (deps, config, etc.)
- [ ] `refactor` -- Code restructuring (no behavior change)
- [ ] `test` -- Adding or updating tests
- [ ] `ci` -- CI/CD pipeline changes
- [ ] `build` -- Build system or dependency changes
- [ ] `revert` -- Reverts a previous commit
- [ ] `style` -- Code style (formatting, whitespace)

### Modifiers

- [ ] Breaking change (`!`) -- This change breaks backward compatibility

## Changes Made

- `assets/init-workspace.sh`: read `DEVKIT_TAG_PREFIX` /
`DEVKIT_FLOATING_TAGS` from the consumer's `.vig-os` **before** the
template rsync overwrite (alongside the existing
MODE/identity/`DEVKIT_MODULES` reads) and conditionally write them back
in the final persist block, mirroring the `DEVKIT_MODULES` preservation
pattern (#884). Written back bare, matching the template's unquoted
form. Persist-block comment updated.
- `tests/bats/init-workspace.bats`: new regression test — scaffold, seed
both keys, `--force` upgrade, assert both survive (the preservation gap
had no coverage, which is how this regressed).

## Changelog Entry

### Fixed
- **Preserve tag-scheme keys across `--force` upgrades**
([#1116](#1116))
- `init-workspace.sh` read back `DEVKIT_MODE`/identity/`DEVKIT_MODULES`
before the managed-template overwrite of `.vig-os`, but not
`DEVKIT_TAG_PREFIX` or `DEVKIT_FLOATING_TAGS`, so an upgrade silently
reset a consumer's release tag scheme to the empty template defaults
(observed cutting bare tags and stalling floating tags on the
commit-action 1.2.0 → 1.2.1 upgrade).
- Both keys are now read before the overwrite and written back (bare,
matching the template's unquoted form) when the consumer set them.

## Testing

- [x] Tests pass locally (`just test`)
- [x] Manual testing performed (describe below)

### Manual Testing Details

- TDD: the new bats test was committed failing (RED —
`DEVKIT_TAG_PREFIX` reset to empty after upgrade), then the fix turned
it GREEN.
- Full `tests/bats/init-workspace.bats`: 199 tests, 0 failures, exit 0
(verified twice — implementation run and an independent review run).
- `uv run pytest tests/test_release_tag_prefix.py
tests/test_floating_tags.py`: 9 passed.
- `prek run --all-files`: green.

## Checklist

- [x] My code follows the project's style guidelines
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have updated the documentation accordingly (edit
`docs/templates/`, then run `just docs`)
- [x] I have updated `CHANGELOG.md` in the `[Unreleased]` section (and
pasted the entry above)
- [x] My changes generate no new warnings or errors
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published

## Additional Notes

Part of the commit-action-deployment bug batch (#1116, #1117, #1118,
plus #1111/#1112). Merge order: this PR first (priority high), the
others rebase on top.

Refs: #1116
c-vigo added a commit to vig-os/devkit that referenced this pull request Jul 15, 2026
## Description

In direnv mode a flake-hooks consumer's `.pre-commit-config.yaml` is a
symlink into the **host** `/nix/store`. `install.sh` runs
`init-workspace.sh` inside the devcontainer image where that store is
not mounted, so the symlink is dangling from the container's viewpoint.
The preserve/exclude gate used `[[ -e ]]` (which follows the link),
reported the file absent, and `rsync -avL` wrote the real ~6 KB template
over the symlink — which in turn prevented the #1092 ignore auto-seed
(its gate is correctly target-based, but the symlink no longer existed
when it ran). Net result on every direnv-mode flake-hooks upgrade: a
committed, non-ignored template shadowing the flake-generated config.
Observed on the `vig-os/commit-action` 1.2.0 → 1.2.1 upgrade
(vig-os/commit-action#80).

Closes #1117

## Type of Change

- [ ] `feat` -- New feature
- [x] `fix` -- Bug fix
- [ ] `docs` -- Documentation only
- [ ] `chore` -- Maintenance task (deps, config, etc.)
- [ ] `refactor` -- Code restructuring (no behavior change)
- [ ] `test` -- Adding or updating tests
- [ ] `ci` -- CI/CD pipeline changes
- [ ] `build` -- Build system or dependency changes
- [ ] `revert` -- Reverts a previous commit
- [ ] `style` -- Code style (formatting, whitespace)

### Modifiers

- [ ] Breaking change (`!`) -- This change breaks backward compatibility

## Changes Made

- `assets/init-workspace.sh`: new `path_present()` helper (`[[ -e || -L
]]` — a symlink of any kind, even dangling, is present) routed through
all three presence gates:
1. the rsync preserve/exclude builder (the critical clobber fix — the
symlink is now excluded from the template copy),
2. the `--preview` classification loop (a dangling store symlink now
reports PRESERVED, not ADDED),
3. `PRECOMMIT_CONFIG_PREEXISTED` (was `-f`; the #878 divergence guard is
no longer silently skipped).
The #1092 ignore-seed gate itself is unchanged — it was already
target-based (`readlink | grep /nix/store/`); the fix is that the
symlink still exists when it runs.
- `tests/bats/init-workspace.bats`: two regression tests reproducing the
exact direnv-in-container scenario (dangling `/nix/store/...` target):
symlink survives upgrade untouched + ignore seeded; `--preview`
classifies PRESERVED. Also updated the existing whitebox exclude-gate
assertion that pinned the old literal `-e` line.

## Changelog Entry

### Fixed
- **Preserve a dangling flake-hooks store symlink through direnv-mode
upgrades** ([#1117](#1117))
- In direnv mode `init-workspace.sh` runs inside the image where the
host `/nix/store` is not mounted, so a flake-generated
`.pre-commit-config.yaml` symlink is dangling; the `-e`/`-f` presence
gates followed the link, reported it absent, and the template rsync
overwrote it — also silencing the #1092 ignore auto-seed.
- All presence gates now treat a symlink of any kind (including
dangling) as present via a shared `path_present()` helper: the symlink
survives the copy, the ignore is seeded, `--preview` classifies it as
PRESERVED, and the #878 divergence guard sees the pre-existing config.

## Testing

- [x] Tests pass locally (`just test`)
- [x] Manual testing performed (describe below)

### Manual Testing Details

- TDD: both regression tests committed failing (RED — symlink clobbered
into a regular file; `--preview` misclassified as ADDED), turned GREEN
by the fix.
- Full `tests/bats/init-workspace.bats`: 200 tests, 0 failures, exit 0
(implementation run + independent review run).
- `prek run --all-files`: green.

## Checklist

- [x] My code follows the project's style guidelines
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have updated the documentation accordingly (edit
`docs/templates/`, then run `just docs`)
- [x] I have updated `CHANGELOG.md` in the `[Unreleased]` section (and
pasted the entry above)
- [x] My changes generate no new warnings or errors
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published

## Additional Notes

Part of the commit-action-deployment bug batch. Known adjacent,
deliberately not fixed here: `print_preserved_template_diff` still gates
on `-f`, so the #878 divergence *diff* is not printed for a dangling
symlink — harmless (a store symlink has no meaningful template diff and
cannot be validated while unmounted). #1111 (root-`.gitignore`
migration, same function) follows in a separate PR after this one
merges.

Refs: #1117
c-vigo added a commit to vig-os/devkit that referenced this pull request Jul 15, 2026
…d non-fatal (#1125)

## Description

During a direnv-mode `install.sh --force` upgrade, after all scaffold
files were written successfully, `init-workspace.sh` ran `just sync`
(npm ci) inside the container; under `set -euo pipefail` a sync failure
(observed: `npm error Exit handler never called!`) aborted the whole
init and `install.sh` reported a misleading "Failed to initialize
workspace". Two fixes, per the issue's two questions: the container-side
sync is now skipped entirely in direnv/bare modes (the consumer's host
nix/direnv shell owns dependency install; a container-side `npm ci`
writes wrong-platform, wrong-owner artifacts into the bind-mounted
workspace), and where it does run (devcontainer/both) a failure warns
and continues so the exit status reflects the scaffold result. Observed
on the `vig-os/commit-action` 1.2.1 upgrade (vig-os/commit-action#80).

Closes #1118

## Type of Change

- [ ] `feat` -- New feature
- [x] `fix` -- Bug fix
- [ ] `docs` -- Documentation only
- [ ] `chore` -- Maintenance task (deps, config, etc.)
- [ ] `refactor` -- Code restructuring (no behavior change)
- [ ] `test` -- Adding or updating tests
- [ ] `ci` -- CI/CD pipeline changes
- [ ] `build` -- Build system or dependency changes
- [ ] `revert` -- Reverts a previous commit
- [ ] `style` -- Code style (formatting, whitespace)

### Modifiers

- [ ] Breaking change (`!`) -- This change breaks backward compatibility

## Changes Made

- `assets/init-workspace.sh` (post-scaffold sync block): mode gate —
`direnv`/`bare` skip the sync with an informational line;
`devcontainer`/`both` run it as `just sync || echo "Warning: …" >&2`
(warn-and-continue, reusing the established non-fatal post-scaffold
idiom). The existing #859 "no `sync` recipe" warn-and-continue branch is
preserved. Comment block updated to document both behaviors.
- `tests/bats/init-workspace.bats`: `_scaffold_synclog` helper (a `just`
stub that logs invocations and controls the `sync` exit code) + two
regression tests: direnv mode never invokes `just sync` and prints the
skip message; devcontainer mode with a failing `sync` recipe exits 0
with the warning (and asserts sync was actually attempted).

## Changelog Entry

### Fixed
- **Post-scaffold dependency sync is mode-aware and no longer aborts a
successful upgrade**
([#1118](#1118))
- In `direnv` and `bare` modes the container-side `just sync` is now
skipped entirely: the consumer's host nix/direnv shell owns dependency
install, and a container-side `npm ci`/`uv sync` would write
wrong-platform, wrong-owner artifacts into the bind-mounted workspace.
An informational line notes the skip.
- In `devcontainer`/`both` modes the sync still runs but is non-fatal —
a failure (e.g. `npm error Exit handler never called!`) now warns and
continues instead of aborting init with a misleading "Failed to
initialize workspace", since the scaffold itself is already complete.

## Testing

- [x] Tests pass locally (`just test`)
- [x] Manual testing performed (describe below)

### Manual Testing Details

- TDD: both regression tests committed failing (RED — direnv mode still
synced; failing sync aborted init), turned GREEN by the fix.
- Full `tests/bats/init-workspace.bats`: 200 tests, 0 failures, exit 0
(implementation run + independent review run).
- `prek run --all-files`: green.

## Checklist

- [x] My code follows the project's style guidelines
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have updated the documentation accordingly (edit
`docs/templates/`, then run `just docs`)
- [x] I have updated `CHANGELOG.md` in the `[Unreleased]` section (and
pasted the entry above)
- [x] My changes generate no new warnings or errors
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published

## Additional Notes

Part of the commit-action-deployment bug batch. The image-side root
cause of `npm error Exit handler never called!` is out of scope here
(this PR only removes its blast radius); worth a separate look if it
recurs.

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