Auto-prune registered pages whose wiki source has disappeared - #162
Open
fcbond wants to merge 1 commit into
Open
Auto-prune registered pages whose wiki source has disappeared#162fcbond wants to merge 1 commit into
fcbond wants to merge 1 commit into
Conversation
Right now if a registered page's wiki file is deleted or renamed, createdocs.py throws trying to open it and the *entire* build fails (assert False) until a human notices and hand-edits sitesdefinitions.json -- one missing page currently takes down every site. apply_new_pages.py now also removes stale entries, but only once a page has been seen missing on two separate runs (tracked via a "MissingSince" marker persisted in sitesdefinitions.json itself), as insurance against a one-off flaky checkout deleting a real, still-existing page. If the file reappears before the second run, the marker is cleared instead. The "<ignore>" section (a deliberate blackhole for links to pages that are never expected to exist, like personal wiki-username pages) is never touched by this. Tested against a full local build: simulated a page going missing for one run (flagged, kept), staying missing for a second run (removed), and reappearing after being flagged (marker cleared, page kept) -- all three paths produce valid sitesdefinitions.json and a clean createdocs.py build. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
Follow-up to the BergenTop auto-registration fix (already merged directly to main). This closes the other half of the gap: a registered page whose wiki file gets deleted or renamed currently takes down the entire site build, since
createdocs.pythrowsFileNotFoundErrortrying to open it and the run fails until a human hand-editssitesdefinitions.json.apply_new_pages.pynow also removes stalePagesentries, but only once a page has been missing for two separate runs (tracked via a"MissingSince"marker persisted insitesdefinitions.jsonitself) -- cheap insurance against a one-off flaky wiki checkout wrongly deleting a real page."<ignore>"section is a deliberate blackhole for links to pages that are never expected to exist (personal wiki-username pages, wiki system pages) and is explicitly never touched by this logic.Testing
Ran a full local build against the real
delph-in/docs.wikicheckout and:BergenSchedule.mdgoing missing: run 1 flagged it (kept), run 2 (still missing) removed itBergenParticipants.mdgoing missing then reappearing before a second run: marker cleared, page kept<ignore>section (87 entries) was untouched throughoutcreatedocs.pystill builds cleanly (exit 0) against the resulting file in every caseTest plan
BuildDocson this branch (workflow_dispatch) once to confirm the new step runs cleanly in CI🤖 Generated with Claude Code