feat: add "Published pages only" filter to Broken Links report#704
Open
NagariaHussain wants to merge 1 commit into
Open
feat: add "Published pages only" filter to Broken Links report#704NagariaHussain wants to merge 1 commit into
NagariaHussain wants to merge 1 commit into
Conversation
The Wiki Broken Links report scanned every Wiki Document regardless of publish state, so broken links on draft pages added noise. Add a `published_only` filter (Check, default on) that restricts the scan to published documents via `is_published`, wired into both the report's Desk filter config and the `get_data` query. Fixes #577 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Confidence Score: 4/5The backend default path can still include unpublished pages.
wiki/wiki/report/wiki_broken_links/wiki_broken_links.py Reviews (1): Last reviewed commit: "feat: add "Published pages only" filter ..." | Re-trigger Greptile |
Comment on lines
+55
to
+57
| doc_filters = {} | ||
| if filters and filters.get("published_only"): | ||
| doc_filters["is_published"] = 1 |
There was a problem hiding this comment.
Backend Default Still Scans Drafts
When execute() is called with no filters, {}, or another filter that omits published_only, this branch leaves doc_filters empty and reports broken links from unpublished documents. That makes non-UI and omitted-filter report runs ignore the new default-on behavior.
Suggested change
| doc_filters = {} | |
| if filters and filters.get("published_only"): | |
| doc_filters["is_published"] = 1 | |
| doc_filters = {} | |
| if not filters or filters.get("published_only", 1): | |
| doc_filters["is_published"] = 1 |
Context Used: CLAUDE.md (source)
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 Wiki Broken Links report scanned every Wiki Document — published and unpublished — so broken links on draft pages added noise. Closes #577.
Solution
Add a
published_onlyfilter (Check, default on) to the report. When enabled,get_datarestricts the scan to documents whereis_published = 1. Wired into both the Desk filter config (.js) and the backend query (.py), with unit tests covering exclude / include / toggle-off behaviour.🤖 Generated with Claude Code