Repository navigation
fix: resolve '..' physically in config [[table]] globs - #1670
Open
thekevinbot wants to merge 4 commits into
Open
thekevinbot wants to merge 4 commits into
thekevinbot wants to merge 4 commits into
Conversation
Red ahead of the fix: the config anchor folds '..' lexically, so a '..' after a symlinked directory reads a different file than the shell does.
The config anchor no longer folds '..' lexically; the filesystem resolves it, as for path-tables. Verbatim Windows paths, where the OS takes '..' literally, still fold.
This branch has not been deployed
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.
Fixes #1627
A config
[[table]] globwith an absolute,~/, or../prefix folded..lexically before the filesystem saw it, soglob = '/r/y/link/../*.md'matchedy/*.md, whilels /r/y/link/../*.md(bash, globstar on) listsreal/*.mdwheny/link -> real/sub. #1606 already fixed this for path-tables.Red
The red-test commit a96524e failed CI for the asserted reason: https://github.com/thekevinscott/dirsql/actions/runs/42132996705 (Rust
Unit testsjob: https://github.com/thekevinscott/dirsql/actions/runs/42132996705/job/127614014092)Locally, the new
tests/config_anchor.rsintegration tests failed the same way at that commit (left: ["LEXICAL"],right: ["PHYSICAL"]).Fix
path_table::config_anchor_asnow folds..only for verbatim Windows paths (\\?\), where the OS takes..literally. This is the same ruleresolve_asapplies to path-tables. All other anchors keep..as written, and the OS resolves it. The live watcher already watches the canonicalized anchor.The
on-filehook now receives paths, and{root}, with the..as written (see the migration fragment).Tests:
path_table.rs: an absolute anchor keeps..; a verbatim Windows anchor still folds; the../sharedanchor expectation is updated to/cfg/../shared.tests/config_anchor.rs(cfg(unix)): the absolute and../forms through a real symlink.By hand (debug CLI,
y/link -> real/sub; bashcaton each glob printsPHYSICAL):E2E Verification
packages/python/e2e-attestations/<branch>.jsonreceipt written ifpackages/pythonchanged (just e2e-attest-python)packages/ts/e2e-attestations/<branch>.jsonreceipt written ifpackages/tschanged (just e2e-attest-ts)cd packages/python && uv run maturin develop --release, thentesting-conventions e2e attest 'uv run python -m pytest tests/e2e/on_file_query_test.py tests/e2e/declared_table_name_test.py tests/e2e/fanout_test.py tests/e2e/query_contract_test.py tests/e2e/use_case_transcripts_test.py -x -q';just e2e-attest-ts;cargo test --workspace --features cli --no-fail-fasttests/non_utf8_names.rsandtests/non_utf8_names_e2e.rs. Those fail while creating their fixtures (Os { code: 84, "Invalid or incomplete multibyte or wide character" }) because this host's filesystem rejects non-UTF-8 file names. CI runs them.Changelog / Migrations
<root>/<pkg>/changelog.d/for each changed package (or:skip-changelogtrailer on a commit with reason)<root>/<pkg>/migrations.d/for each changed package (every subsection but Summary_None._when nothing breaks)