Repository navigation
fix(pipeline): resolve gap paths to real files - #479
Merged
Merged
Conversation
detect_gaps.py copied docs.json page IDs, which have no extension, into the path of thin_page, missing_description and apiref_narrative_page gaps. The later steps expect a file: - generate.py read REPO_ROOT / path, got FileNotFoundError (swallowed by load_file, so the model saw an empty page) or, when a folder shares the page's name, IsADirectoryError (the run crashed) - the draft was written as docs--x--y with no .mdx, so evaluate.py found no .mdx files and the run failed Add util.page_file() to resolve a page ID to its .mdx/.md file and use it where the detector emits those three gap types. Detection is unchanged; only the path value differs. Add a stdlib test for the helper. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
shirgoldbird
approved these changes
Oct 28, 2026
shirgoldbird
added a commit
that referenced
this pull request
Oct 28, 2026
…mport Carries over the parts of #450 that #479 didn't cover: - detect_gaps: pages with child pages are exempt from the thin-page check. breaking-changes-change-notices is short because its content sits on its children; padding it out is the wrong fix. - generate: load_existing_page() raises when the page a gap edits is missing or empty, so a failed read can't become "write this page from scratch". - generate: import the Anthropic SDK only when a client is built, so --dry-run and the tests run without it. CI installs pyyaml for the new tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Oct 28, 2026
This branch was successfully 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
The "Docs Pipeline" workflow fails on every push to
mainthat touchesapi-reference/openapi.yaml. It failed on each of the last 8 runs, back to 2026-09-29, most recently on #478 (Run the docs pipelinestep, exit code 1).The log shows:
Cause
detect_gaps.pytakes page IDs fromdocs.json, which have no extension (docs/resources/foo), and puts them in thepathofthin_page,missing_descriptionandapiref_narrative_pagegaps. The later steps treatpathas a file:generate.pyreadsREPO_ROOT / path. For a page ID that is not a file,load_fileswallowsFileNotFoundErrorand returns an empty string, so the model is asked to expand a page it was never shown. When a folder has the same name as the page (breaking-changes-change-notices.mdxandbreaking-changes-change-notices/), the read raisesIsADirectoryErrorand the run crashes.docs--getting-started--supported-languages, no.mdx), soevaluate.py, which globs*.mdx, finds no drafts and fails the run.evaluate.pyandtest_open_prs.pyalready assume extension-bearing paths (docs--admin--overview.mdx,docs/a.mdx).Measured on current
main: all 7 gaps that carry a path pointed at something that is not a file (5 with no extension, 2 that resolve to a directory).Change
pipeline/util.py: addpage_file(page_id), which returns the repo-relative.mdxor.mdfile for a page ID, orNone.pipeline/detect_gaps.py: use it where the three gap types are emitted. Detection is unchanged: the same 13 gaps, with only thepathvalues differing.pipeline/test_page_file.py: 6 stdlib tests, including a page next to a same-named folder and a folder with no page.Verification
python -m unittest discover -s pipeline -p "test_*.py"passes (30 tests: 24 existing, 6 new), withoutyamlinstalled, as in CI.mainbefore and after: 13 gaps both times, everything exceptpathidentical, and 0 of 7 paths are non-files after (7 of 7 before).generate.pynow names the threethin_pagedraftsdocs--...--<page>.mdxandload_filereads the real page content for each.Not verified: a full pipeline run, which needs the model API and the later steps (
review,promote,ship).Heads up
Once this merges, the next change to
openapi.yamllets the pipeline get pastgenerateandevaluatefor the first time in these runs. It will call the model to expand the three thin pages (supported-languages,google-sheets,breaking-changes-change-notices) and may open a PR with the result. Use the manualworkflow_dispatchwithdry_runto see what it would do before relying on it.🤖 Generated with Claude Code