Fix .gitattributes writer: quote paths with spaces, dedupe per-batch syncs, deterministic ordering#330
Conversation
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/6964fcee-affd-47fd-bce6-3168d0b89d53 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/6964fcee-affd-47fd-bce6-3168d0b89d53 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
|
/rust-review |
1 similar comment
|
/rust-review |
|
✅ Rust PR Reviewer completed successfully! |
🔍 Rust PR ReviewSummary: Looks good overall — clean implementation with good test coverage. Two issues worth addressing before merge. Findings🐛 Bugs / Logic Issues
|
|
@copilot Address feedback and suggestions |
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/8a920650-7872-4658-9e7a-85642e24bc6b Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Addressed all four items from the rust-review in bda2350:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
.gitattributes already preserves user content and emits deterministic order.gitattributes writer: quote paths with spaces, dedupe per-batch syncs, deterministic ordering
This is an empty commit to trigger release-please to open a release PR so that the changelog can be manually updated to include changes from commits #330, #331, and #332 which were merged without Conventional Commit prefixes and were silently dropped from the changelog. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Follow-up to the
.lock.yml/.gitattributeswork. The original goals — preserving pre-existing user-authored entries and emitting managed entries in a stable order so re-compiles don't churn the file — were already satisfied by the initial implementation. A subsequent/rust-reviewpass surfaced two real bugs and two doc/test improvements, all addressed here.Already-satisfied properties
strip_managed_blockonly removes lines between# BEGIN ado-aw managedand# END ado-aw managed; everything else is copied verbatim. Covered bypreserves_user_managed_lines.BTreeSet<String>before rendering, so output order is independent ofdetect_pipelinestraversal order. Covered byentries_are_sorted_and_deduplicated, and the writer additionally short-circuits the disk write when the rendered content matches the existing file (idempotent_when_unchanged).Changes from review feedback
"/#—normalize_pathpreviously emittedmy agents/pipeline.lock.yml linguist-generated=true merge=ours, which git would parse as patternmywith three attributes. It now wraps such entries in double quotes (with embedded"escaped) so git treats them as a single pattern. New regression testquotes_paths_containing_spaces.detect_pipelinescalls during batch compile —compile_pipelineis now a thin wrapper over a privatecompile_pipeline_inner(... sync_gitattributes: bool).compile_all_pipelinespassesfalseand performs a single.gitattributessync at the end of the batch, reusing the already-detected pipeline list rather than re-scanning the tree once per pipeline.rendercalling out that the block is always written at EOF; user lines outside it are preserved verbatim, but in-place block position is not.idempotent_when_unchangednow asserts only content equality (mtime granularity is filesystem-dependent, e.g. 1s on macOS HFS+).Smoke test
Pre-populated
.gitattributeswith three pipelines compiled in non-alphabetical order:A subsequent
ado-aw compile(auto-discover) produces a byte-identical file. A path containing a space (my agents/pipeline.md) compiles to a quoted entry:cargo build,cargo test, andcargo clippy --all-targets --all-featuresare clean (no new warnings on changed files).