visitAllLinks: add a shouldVisit filter - #137
Merged
Merged
Conversation
Not every reachable link is one the crawl should assert on. The case that prompted this: docs sites give demo components real-looking links whose route calls transition.abort(), so clicking one keeps the reader in place. Those targets aren't meaningfully visitable — in AuditBoard's docs app, visiting them makes visit() reject with TransitionAborted, so seven otherwise-green pages failed the crawl with no app bug behind it. shouldVisit(url) returns false to skip a target entirely: not navigated, not asserted on, and not traversed for further links. It also covers sharding a large crawl across CI jobs and excluding areas covered by dedicated tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merged
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.
Not every reachable link is one the crawl should assert on.
The case that prompted this: docs sites give demo components real-looking links whose route calls
transition.abort(), so clicking one keeps the reader on the page instead of yanking them to a stub. Those targets aren't meaningfully visitable — in AuditBoard's docs app, visiting them makesvisit()reject withTransitionAborted, so 7 otherwise-green pages failed the crawl with no app bug behind them. There was no way to tell the crawler "these are deliberately inert".Returning
falseskips the target entirely: not navigated to, not asserted on, and not traversed for further links. Beyond inert demo links it also covers sharding a large crawl across CI jobs (shouldVisit: (url) => hash(url) % SHARDS === INDEX) and excluding areas that have dedicated tests.Tests: the test-app gains an
/inert-demo-targetroute that aborts its transition, linked from the application template; every crawl in the suite now filters it out (realistic usage), and a new test asserts the filtered target is never visited while everything else still is, plus that a reject-everything filter visits nothing. Disabling the filter makes that test fail. 10/10 passing, lint clean.One note on the fixture: a top-level aborting route in this test-app resolves rather than rejecting, so it demonstrates the filtering contract rather than reproducing the
TransitionAbortedrejection specifically — that came from a nested aborting route in a real app.🤖 Generated with Claude Code