Skip to content

Isolate freshness-check fixtures from operator git hooks - #535

Merged
TheGreatAxios merged 4 commits into
mainfrom
cl-7282-a-global-git-hook-makes-the-full-local-test-suite-unpassable
Aug 31, 2026
Merged

TheGreatAxios merged 4 commits into
mainfrom
cl-7282-a-global-git-hook-makes-the-full-local-test-suite-unpassable

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

packages/tool-registry-publish freshness fixtures compared src/ against real git history by running git commit in throwaway repos. That inherited the operator core.hooksPath, so a global commit-author allow-list made the local suite unpassable.

Fixture history is now written with git commit-tree under a test-owned config (GIT_CONFIG_NOSYSTEM, a scratch GIT_CONFIG_GLOBAL, and -c core.hooksPath=). A regression plants a rejecting commit-msg hook and still writes the fixture.

Test plan

  • HUB_DATA_DIR=$(mktemp -d) bun test packages/tool-registry-publish (62 pass)
  • Regression: unguarded git commit fails the planted allow-list hook; committedPackage still succeeds
  • Confirm the suite still passes on a machine whose ~/.config/git/hooks includes the author allow-list

Scratch repos still need git history so freshness can compare src/ to the version-introducing commit, but git commit ran the operator core.hooksPath and failed a global author allow-list. Fixtures now write history with commit-tree under a test-owned git config, and a regression plants a rejecting commit-msg hook to keep that isolation.
The regression planted a rejecting commit-msg hook but then wrote
fixture history through git() env that never included that hook.
Pass the hostile env into committedPackage so the writer is actually
under the hook when it succeeds.
@TheGreatAxios
TheGreatAxios force-pushed the cl-7282-a-global-git-hook-makes-the-full-local-test-suite-unpassable branch from 0c7c36e to 93906c5 Compare August 31, 2026 05:34
@TheGreatAxios
TheGreatAxios merged commit 7958d8d into main Aug 31, 2026
7 checks passed
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