fix: Un-gitignore fab/.fab-version#477
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a regression where fab/.fab-version was unintentionally ignored by the unanchored .fab-* gitignore pattern, preventing the version pin from being committed and breaking fresh clones/worktrees/CI that rely on that version source.
Changes:
- Un-ignores
fab/.fab-versionin both this repo and the shipped scaffold.gitignorefragment. - Adds a new
2.15.1-to-2.15.2migration documenting the verify+commit remediation for already-shipped repos, and bumps the kit version to2.15.2. - Hardens init/upgrade by emitting a fail-open stderr warning when the stamped
fab/.fab-versionis still gitignored; adds focused tests and updates docs/memory to reflect the load-bearing negation.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/kit/VERSION |
Bumps kit version to 2.15.2. |
src/kit/scaffold/fragment-.gitignore |
Adds !fab/.fab-version negation under .fab-* for future/self-healing syncs. |
src/kit/migrations/2.15.1-to-2.15.2.md |
Adds migration guidance to ensure negation + commit of fab/.fab-version. |
src/go/fab-kit/internal/upgrade.go |
Calls the new warning helper after stamping .fab-version. |
src/go/fab-kit/internal/scaffold_test.go |
Adds tests pinning fragment merge semantics for the new negation line. |
src/go/fab-kit/internal/init.go |
Adds warnIfFabVersionIgnored and wires it into Init after stamping. |
src/go/fab-kit/internal/init_test.go |
Adds stderr-capture helper + tests for the warning behavior. |
fab/changes/260708-8ken-fab-version-gitignore-fix/plan.md |
Records requirements/tasks/acceptance for the change. |
fab/changes/260708-8ken-fab-version-gitignore-fix/intake.md |
Captures incident diagnosis and design decisions for the fix. |
fab/changes/260708-8ken-fab-version-gitignore-fix/.status.yaml |
Tracks change pipeline state/metrics for this change. |
fab/changes/260708-8ken-fab-version-gitignore-fix/.history.jsonl |
Logs stage transitions and change history events. |
fab/.fab-version |
Commits the repo’s pinned fab version file. |
docs/specs/config.md |
Documents the gitignore caveat + required negation to keep .fab-version committable. |
docs/memory/distribution/setup.md |
Updates setup memory with the new negation semantics and rationale. |
docs/memory/distribution/migrations.md |
Adds memory entry for the new 2.15.1-to-2.15.2 migration behavior. |
docs/memory/distribution/kit-architecture.md |
Updates architecture memory with committability mechanisms and warning helper wiring. |
docs/memory/distribution/index.md |
Refreshes distribution index entries to reflect updated memories. |
docs/memory/_shared/index.md |
Updates shared index to reflect configuration memory changes. |
docs/memory/_shared/configuration.md |
Updates configuration memory with the new committability caveat + warning behavior. |
.gitignore |
Adds !fab/.fab-version negation under .fab-* in this repo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| func captureStderr(t *testing.T, fn func()) string { | ||
| t.Helper() | ||
| r, w, err := os.Pipe() | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| orig := os.Stderr | ||
| os.Stderr = w | ||
| done := make(chan string, 1) | ||
| go func() { | ||
| data, _ := io.ReadAll(r) | ||
| done <- string(data) | ||
| }() | ||
| fn() | ||
| os.Stderr = orig | ||
| w.Close() | ||
| out := <-done | ||
| r.Close() | ||
| return out | ||
| } |
There was a problem hiding this comment.
Fixed — restored os.Stderr via a deferred restore and now close the pipe writer through a deferred wrapper around fn, matching captureStdout, so a panic or runtime.Goexit (e.g. t.Fatal) inside fn can no longer leak the pipe or leave stderr redirected into later tests. The concurrent drain goroutine is preserved. (09dc4b4)
Align captureStderr with captureStdout — restore os.Stderr via defer and close the pipe writer through a deferred wrapper around fn, so a panic or runtime.Goexit (e.g. t.Fatal) inside fn cannot leak the pipe or leave stderr redirected into subsequent tests.
Meta
8kenexcludes
fab/,docs/· generated by fab-kit v2.15.1Pipeline: intake ✓ → apply ✓ → review ✓ → hydrate ✓ → ship → review-pr
Summary
fab/.fab-versionis silently swallowed by the.fab-*gitignore pattern (added for root runtime files like.fab-status.yaml), so it can never be committed even though the design says it should be. Post-migration, this leaves every fresh checkout — new worktree, new clone, CI — without a version source, causingwt create/fab syncto fail with "no fab version found."Changes
.gitignore+ commit the file