Skip to content

fix: don't persist book filter across docs-migrate runs - #3835

Open
Mpdreamz wants to merge 2 commits into
feature/ascii-to-md-converterfrom
fix/convert-all-book-filter-leak
Open

fix: don't persist book filter across docs-migrate runs#3835
Mpdreamz wants to merge 2 commits into
feature/ascii-to-md-converterfrom
fix/convert-all-book-filter-leak

Conversation

@Mpdreamz

Copy link
Copy Markdown
Member

Summary

  • clone was persisting the --book flag to .clone-options.json, which caused subsequent commands (convert --all, serve, etc.) to silently scope to only the previously-cloned book (e.g. en/security).
  • ResolveFilterOptions was already not re-applying the saved book on reads (Book: book, not book ?? saved.Book); this PR fixes the write side so CloneCommand also stops persisting it.
  • The book filter is a per-run override, not a durable preference — only majors/minors/all/minVersion represent a "how much to process" setting worth remembering between runs.

Test plan

  • Run docs-migrate clone --book en/security, then docs-migrate convert --all — should no longer filter to security only
  • Confirm .clone-options.json no longer contains a book field after clone
  • Run dotnet build src/tooling/docs-migrate/

🤖 Generated with Claude Code

Mpdreamz and others added 2 commits August 11, 2026 18:48
`clone` was saving the book filter to .clone-options.json, causing
`convert --all` (and any subsequent command) to silently operate only
on the previously-cloned book (e.g. en/security) even when no --book
flag was passed.

The book filter is a per-run override, not a persistent setting — only
majors/minors/all/minVersion represent a durable "how much to process"
preference worth remembering.

SharedOptions.ResolveFilterOptions was already fixed not to re-apply a
saved book (Book: book, not book ?? saved.Book); this commit fixes the
write side so CloneCommand also stops persisting it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
On Windows, Path.GetFullPath("/base/foo.adoc") returns "C:\base\foo.adoc".
Test FileReader lambdas keyed on "/base/foo.adoc" never matched, so all
includes were silently skipped and every chunker/parser test that relies
on include chains produced only an index page.

Normalize paths in ReadFile before calling FileReader: flip backslashes
and strip any drive-letter prefix so the contract is always Unix-style.

YamlWriter used AppendLine which emits \r\n on Windows; WriteTocYaml
tests asserting StartWith("toc:\n") failed. Replace with explicit '\n'.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant