fix: do not fail translate extract on link-included tocs - #2107
Open
martyanovandrey wants to merge 2 commits into
Open
fix: do not fail translate extract on link-included tocs#2107martyanovandrey wants to merge 2 commits into
martyanovandrey wants to merge 2 commits into
Conversation
martyanovandrey
requested review from
reazy015 and
stenin-nikita
and removed request for
a team
July 24, 2026 12:44
martyanovandrey
force-pushed
the
fix/translate-link-included-tocs
branch
2 times, most recently
from
July 24, 2026 13:00
7f1ecc5 to
8a8be8c
Compare
stenin-nikita
approved these changes
Jul 24, 2026
martyanovandrey
force-pushed
the
fix/translate-link-included-tocs
branch
from
July 27, 2026 13:19
91d87ca to
1d63fb5
Compare
Tocs pulled in with `include: {mode: link}` are inlined into their parent
toc during translate, but were still enumerated as standalone files. For
those files `TocService.for()` throws `Error while finding toc dir.`,
which failed the whole `translate extract` run (DOCSTOOLS-6294).
Skip link-included tocs in translate file enumeration - they stay as
`source` graph nodes and their strings are already extracted with the
parent toc, so extracting them on their own only duplicates content and
crashes.
The guard also fixes the default (merge) include mode: a section keeping all articles in subdirectories never puts its own directory into the merged-directories filter, so its absorbed toc leaked into the extraction list and crashed the run. Add a fixture reproducing this layout and generalize the guard comments accordingly.
martyanovandrey
force-pushed
the
fix/translate-link-included-tocs
branch
from
July 28, 2026 09:56
1d63fb5 to
4fd069c
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.



Problem
translate extractfails withError while finding toc dir.on projects whose toc pulls in another toc viainclude: {mode: link}(DOCSTOOLS-6294).Link-included tocs are inlined into their parent toc during translate, but they were also enumerated as standalone files. They stay as
sourcenodes in the toc graph rather thantocnodes, soTocService.for()cannot resolve them and throws, aborting the whole extract.Fix
Skip link-included tocs during translate file enumeration. Their strings are already extracted together with the parent toc, so extracting them separately only duplicated content on top of crashing.
The guard in
Run.getFiles()keys offTocService.isToc(): a globbedtoc.yamlthat is not a real toc node is a link include and is dropped from the file list. Standalone tocs, merged tocs and non-toc yaml are unaffected.A new e2e fixture (
tests/mocks/translation/toc-include-link) with nestedmode: linkincludes guards the regression - without the fix it reproduces the exactError while finding toc dir.failures.