chore(clickhouse): rename aux golden/sql files off a reserved name - #73002
Merged
tpgilmore merged 7 commits intoJul 23, 2026
Merged
Conversation
`aux` is a Windows-reserved device name, so git refuses to check out `golden/*/aux.hcl` and `sql/*/aux.sql` (core.protectNTFS) and NTFS rejects them outright, breaking the Release CLI windows build and any Windows clone. The golden/sql filenames derive from the role name, so a new `golden_name` alias maps the `aux` role's files to `auxiliary` (matching the roles/auxiliary/ layer dir) at every write and read site. The role identity (manifest role, NodeRole.AUX, the `aux` cluster, the hostClusterRole macro) is unchanged; only the filenames move. check.sh now rejects any Windows-reserved golden/sql basename so this can't recur. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
😎 Merged manually by @tpgilmore - details. |
Contributor
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
posthog/clickhouse/hcl/gen-golden.sh:42-46
**Reserved Name Is Written First**
On a Windows host where Docker's bind mount enforces NTFS naming rules, `hclexp` still tries to create `aux.hcl` before this loop renames it. That write fails, so the command exits before `mv` runs and Windows users still cannot regenerate the goldens.
### Issue 2 of 2
posthog/clickhouse/hcl/codegen/gen_migration.py:122
**Dump Name No Longer Matches Role**
This changes the temporary dump for role `aux` from `aux.hcl` to `auxiliary.hcl`. If `hclexp plan -dump` resolves files by the manifest role, it will not find the aux dump and can fail migration generation or plan against a missing aux schema; temporary dump files are not committed, so they can retain the raw role name.
Reviews (1): Last reviewed commit: "chore(clickhouse): rename aux golden/sql..." | Re-trigger Greptile |
bciaraldi
approved these changes
Jul 22, 2026
Contributor
🤖 CI report
|
…ndows-build-failures
…ndows-build-failures
…ndows-build-failures
tpgilmore
deleted the
fix_correct-aux-golden-file-name-due-to-windows-build-failures
branch
July 23, 2026 02:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
auxis a Windows-reserved device name. Git refuses to check out a path whose basename isaux(core.protectNTFS, on by default on Windows), and NTFS rejects the name regardless of extension. Soposthog/clickhouse/hcl/golden/*/aux.hclandsql/*/aux.sqlcannot land on a Windows working tree. This fails thebuild-local-artifacts (x86_64-pc-windows-msvc)job in the Release CLI workflow at checkout time, and it breaks any Windows clone of the repo. The files became reserved when #71133 restructured the flatlocal-aux.hcl(safe stem) intolocal-multi/aux.hcl(bare reserved stem).Changes
These files are generated, and their names derive from the role name (
golden/<env>/<role>.hcl,sql/<env>/<role>.sql). Renaming theauxrole would be a load-bearing change: the role name chains toNodeRole.AUX, theauxremote_servers cluster, and thehostClusterRolemacro on live hosts. So this aliases only the filename for the reserved word and leaves the role identity fully intact.golden_name()helper inlib.sh, mirrored incodegen/gen_migration.py, maps theauxrole's files toauxiliary(matching the existingroles/auxiliary/layer dir). Every other role passes through unchanged.gen-golden.sh,gen-sql.sh,check.sh,check-live.sh, andgen_migration.py's golden reader.golden/{local-multi,prod-us,prod-eu}/aux.hcltoauxiliary.hcl, andsql/{...}/aux.sqltoauxiliary.sql. Content is byte-identical. The role name never appears inside the files, onlycluster_name = "aux"does, and that stays.check.shgains a guard that fails if any committed golden or sql basename is a Windows-reserved device name, so a future reserved-name role fails loudly on the Linux gate instead of silently shipping a Windows-broken tree.Note
The
auxcluster name andNodeRole.AUXare deliberately unchanged. Only the on-disk golden/sql filenames move. No migration, no production code, no schema change.How did you test this code?
All local and automated. I (Claude) ran these. No Windows machine was involved, so the Windows checkout behavior is argued from protectNTFS and NTFS semantics, not verified on a real Windows runner.
check.shagainst the pinnedchschemaimage: exit 0, every (env, role) diff reports "no differences" including the three renamed aux nodes, sql freshness is clean, and the new filename guard prints "no reserved filenames".nul.hclintogolden/local-multi/, confirmedcheck.shfails with the reserved-name error and names the file, then removed it.is_reserved_basename(aux, nul, com1, lpt9, con reserved; auxiliary, com0, data, ops clean; case-insensitive).gen_migration.py --ref HEAD: reaches "No DDL generated" cleanly, confirming the dump/plan pipeline still resolves theauxrole.hclexp planmatches dumps to roles by theirhostClusterRolemacro, not by filename, so the scratch dump keeps the raw role name.ruff checkandruff format: clean.hogli ci:preflight: ruff lint and format pass, mypy advisory only.Automatic notifications
Docs update
Updated
posthog/clickhouse/hcl/migration.md(the end-state layout list) toauxiliary.hcl.🤖 Agent context
Autonomy: Human-driven by @tpgilmore (agent-assisted)
I diagnosed and implemented this with Claude (Claude Code) at the author's direction. The main decision was scope. The tempting "rename the role" fix looks small but ripples into
NodeRole.AUX, the livehostClusterRolehost tags, and theauxremote_servers cluster, which is a cross-repo, production-infra change. I rejected that and aliased only the generated filename instead. A/code-review mediumpass then flagged that the first cut special-casedauxwithout preventing recurrence, which is whycheck.shnow enforces the reserved-name invariant for the whole device-name class. Skills invoked:/code-review(medium).