Skip to content

feat: add "Published pages only" filter to Broken Links report#704

Open
NagariaHussain wants to merge 1 commit into
developfrom
fix/broken-links-published-filter
Open

feat: add "Published pages only" filter to Broken Links report#704
NagariaHussain wants to merge 1 commit into
developfrom
fix/broken-links-published-filter

Conversation

@NagariaHussain

Copy link
Copy Markdown
Member

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_only filter (Check, default on) to the report. When enabled, get_data restricts the scan to documents where is_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

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>
@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

The backend default path can still include unpublished pages.

  • Calls that omit published_only leave the new filter disabled.
  • Programmatic or omitted-filter report runs can still show draft-page broken links.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Broken Links Report] Add filter for published pages

1 participant