feat(files): pin a file's doc so it is always regenerated (#812) - #2110
Open
sloemo01 wants to merge 2 commits into
Open
feat(files): pin a file's doc so it is always regenerated (#812)#2110sloemo01 wants to merge 2 commits into
sloemo01 wants to merge 2 commits into
Conversation
|
🔍 2 things to check
✅ Health of changed files: 5.2 → 5.3 (+0.1) 👀 Suggested reviewers @RaghavChamadiya 📊 See the full report for this PR |
…ev#812) The Doc tab's empty state needs a way to get a page for one file, and that page needs to stay in step with the code rather than silently disappearing on the next reindex. This is the pin half of issue repowise-dev#812: - Page.pinned column (auto-migrated by the schema reconciler) - PageRecord.pinned + resolve_page_selection always includes pinned pages, so every generation run regenerates them regardless of the heuristic - load_page_records carries pinned through from persisted rows - POST /{repo_id}/files/{path}/pin-doc: pins an existing page, or creates a lightweight template row (reads as unwritten) for a file with no page - FileWikiPageRef.pinned in the file-detail aggregate (types + server) - api-client pinFileDoc() - UI: 'Generate doc' button on the empty Doc tab via onGenerateDoc prop Tests: selection pins pinned pages; endpoint creates+pins, pins in place, 404s on unknown repo. 2219 generation/server/persistence tests pass.
…act (repowise-dev#812) CI caught test_response_contract: the new pin-doc route served an anonymous JSON body. Modeled PinDocResponse (file_path, pinned) and typed the route against it, so the OpenAPI generator ships a schema instead of adding an entry to WAIVED/UNMODELLED debt. 8 response-contract + file-pin tests pass.
sloemo01
force-pushed
the
feat/file-doc-pin
branch
from
September 3, 2026 22:19
4aa6fa5 to
e6e1a59
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.
What
Fixes #812 — the pin half of "generate a doc for an undocumented file and keep it synced".
Root cause
The Doc tab's empty state had no way to get a page for one file, and any page that did exist could silently disappear on the next reindex when the selection heuristic skipped it.
Changes
Page.pinnedcolumn (additive; picked up by the existing schema reconciler)PageRecord.pinned+resolve_page_selectionalways includes pinned pages, so every generation run regenerates them regardless of the selection heuristic — the keep-it-synced guaranteeload_page_recordscarriespinnedthrough from persisted rowsPOST /{repo_id}/files/{path}/pin-doc: pins an existing page, or creates a lightweight template row (reads as unwritten) for a file with no page yetFileWikiPageRef.pinnedin the file-detail aggregate (types + server)pinFileDoc()onGenerateDocpropTests
resolve_page_selectionincludes pinned pages under empty intent; endpoint creates+pins, pins in place (content untouched), 404s on unknown repo. 2219 generation/server/persistence tests pass.Note:
test_plugin_contentis red on main itself (v0.47.0 release bug, unrelated to this PR).