fix(seo): repair validate_seo.py crash + stop false-blocking on doc placeholder URLs#74
Merged
Merged
Conversation
…laceholder URLs Three fixes to the pre-deploy SEO validator shipped in #72: 1. Crash: the orphan-page check unpacked find_internal_links() (which returns a set of path strings) as 'text, link' -> ValueError: too many values to unpack. It now iterates single link values, so all 4 checks run to completion. 2. Placeholder URLs: API-doc example links (Shopify /store/.../orders/12345, QuickBooks {REALM_ID}) were counted as broken links and blocked deploy. Added _is_placeholder_url() to skip illustrative URLs. 3. Auth-walled statuses: 401/403/429 mean 'exists but gated / rate-limited', not 'broken' — no longer treated as failures. The 52 missing-meta-description findings are real and left as-is (that's the validator doing its job); this only fixes the crash + false positives. Note: the Pages workflow (pages.yml) does NOT run this as a gate today, so this was not blocking live deploys — but it will be safe to wire in as one now.
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.
Follow-up to #72, which shipped
scripts/validate_seo.pywith a crash bug.Fixes
find_internal_links()(returns a set of path strings) astext, link→ValueError: too many values to unpack. Now iterates single values; all 4 checks complete.admin.shopify.com/store/.../orders/12345,quickbooks.api.intuit.com/.../{REALM_ID}/query) were counted as broken links and "DEPLOY BLOCKED". Added_is_placeholder_url()to skip them.Not touched
The 52 "pages with no meta description" findings are real and left as-is — that's the validator working. This PR only fixes the crash + false positives.
Blast radius
pages.ymldoes not run this script as a deploy gate today (it runsvalidate_frontmatter.py+mkdocs build), so the crash was never blocking live deploys. This makes the script safe to wire in as a gate later. Verified locally: runs to completion, external-link check now clean.Powered by CorpusIQ