Repository navigation
Keep the docs layout when --update follows a crashed run - #32
Open
dandydarshan wants to merge 1 commit into
Open
dandydarshan wants to merge 1 commit into
dandydarshan wants to merge 1 commit into
Conversation
A run that stopped before writing metadata.json left docs with no recorded layout. read_layout treated that as old flat docs, so the updater switched the run to flat, moved existing pages out of their folders and recorded the flat layout for every later update. read_layout now returns the default layout when metadata.json is missing (metadata without a layout is still old flat docs), and the updater keeps the run's layout in that case so --flat is respected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CXRqenV27WmHS3PtveCubG
This branch has not been deployed
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
A run that stops before writing
metadata.json(for example the 2.1.1 Mermaid crash, which moves the old docs and metadata aside first) leaves docs with no recorded layout. On the next--update:generatepicks the default hierarchical layout, because there is no metadata.IncrementalUpdatercallsread_layout(), which treats a missingmetadata.jsonthe same as old docs with no layout recorded, so it returnsflatand switchesconfig.layoutto flat.organize_docsmoves the existing pages out of their folders.metadata.jsonrecords"layout": "flat", so every later--updatestays flat.Fix
read_layoutreturns the default layout whenmetadata.jsonis missing. Metadata that exists but has no layout is still read as old flat docs.IncrementalUpdaterkeeps the run's layout when there is nometadata.json, so--flatis still respected.Docs that were already turned flat this way go back into folders with one plain
codewiki generate(without--update). That is in the changelog entry, under Unreleased.Tests
test_docs_without_metadata_keep_the_run_layout. It fails without the fix.test_read_layout_defaults_to_flat_for_old_docsandtest_updater_pages_follow_recorded_layoutnow model old docs as ametadata.jsonwithout a layout instead of no metadata at all.Version not bumped: this waits in Unreleased for more fixes before 2.1.3.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CXRqenV27WmHS3PtveCubG