fix: don't persist book filter across docs-migrate runs - #3835
Open
Mpdreamz wants to merge 2 commits into
Open
Conversation
Mpdreamz
force-pushed
the
feature/ascii-to-md-converter
branch
from
August 11, 2026 15:11
1d1540e to
9fd4a98
Compare
`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
force-pushed
the
fix/convert-all-book-filter-leak
branch
from
August 11, 2026 16:52
74b16e3 to
4686e6e
Compare
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.
Summary
clonewas persisting the--bookflag 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).ResolveFilterOptionswas already not re-applying the saved book on reads (Book: book, notbook ?? saved.Book); this PR fixes the write side soCloneCommandalso stops persisting it.majors/minors/all/minVersionrepresent a "how much to process" setting worth remembering between runs.Test plan
docs-migrate clone --book en/security, thendocs-migrate convert --all— should no longer filter to security only.clone-options.jsonno longer contains abookfield afterclonedotnet build src/tooling/docs-migrate/🤖 Generated with Claude Code