Skip to content

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

Merged
Mpdreamz merged 2 commits into
feature/ascii-to-md-converterfrom
fix/convert-all-book-filter-leak
Aug 13, 2026
Merged

fix: don't persist book filter across docs-migrate runs#3835
Mpdreamz merged 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
Mpdreamz requested a review from a team as a code owner August 11, 2026 13:46
@Mpdreamz
Mpdreamz requested a review from technige August 11, 2026 13:46
@Mpdreamz
Mpdreamz force-pushed the feature/ascii-to-md-converter branch from 1d1540e to 9fd4a98 Compare August 11, 2026 15:11
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>
@Mpdreamz
Mpdreamz force-pushed the fix/convert-all-book-filter-leak branch from 74b16e3 to 4686e6e Compare August 11, 2026 16:52
@Mpdreamz
Mpdreamz merged commit 0955afa into feature/ascii-to-md-converter Aug 13, 2026
31 of 32 checks passed
@Mpdreamz
Mpdreamz deleted the fix/convert-all-book-filter-leak branch August 13, 2026 09:29
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