Repository navigation
Conversation
Add RequestComponentTest.testAllProductionActionsAreRouted, which scans the classpath with Guava ClassPath for every concrete @action class compiled from the same production code source as RequestComponent (excluding @action classes defined in tests), and compares it against the @action classes exposed by RequestComponent's zero-argument Runnable factory methods (the same methods Router turns into routes). Any unrouted production action must be listed in KNOWN_UNROUTED_ACTIONS. The test fails in both directions with actionable messages: a new @action that is not registered in RequestComponent (and routing.txt), or a stale allowlist entry for an action that has since been wired up or deleted. Sanity checks ensure the scan finds known actions and that every routed action is a discovered production action. CheckBulkComplianceAction is currently the only unrouted production @action; it is allowlisted with a TODO pointing at its tracking bug. BUG= http://b/587437992
CydeWeys
enabled auto-merge
November 19, 2026 20:34
This branch has not been deployed
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.
Why
RequestComponentTest.testRoutingMaponly checks the routes that are alreadydeclared in
RequestComponentagainst therouting.txtgolden file. It nevercatches an
@Actionclass that is missing fromRequestComponent. Such aclass compiles and has unit tests, but no request can ever reach it. That is
how
CheckBulkComplianceActionhas stayed unrouted and unscheduled since itwas added in 2022.
What
This adds
RequestComponentTest.testAllProductionActionsAreRouted, which:ClassPathto scangoogle.registry.*(nested classes included,e.g.
ReadinessProbeAction.ReadinessProbeActionPubApi) for every concrete@Actionclass. It keeps only classes whoseCodeSourcematchesRequestComponent's, so test-only@Actionclasses are excluded withoutrelying on class-name heuristics.
@Actionclasses thatRequestComponentexposes. It uses thesame rule
Routeruses to build routes: zero-arg factory methods that returna
Runnableannotated with@Action.KNOWN_UNROUTED_ACTIONSallowlist in both directions:
@Actionthat isn't wired up fails with: register it inRequestComponent(and updaterouting.txt).from
KNOWN_UNROUTED_ACTIONS.actions must be found, and every routed action must be one of the
discovered production actions.
CheckBulkComplianceActionis currently the only unrouted production@Action. It is allowlisted with a TODO for b/261763205.Testing
CheckBulkComplianceActionfromthe allowlist fails with the "not wired" message. Adding a routed action to
the allowlist fails with the "stale entry" message.
./gradlew :core:standardTestpasses. The new test runs in about 2 seconds.runPresubmits,spotlessCheck, andjavaIncrementalFormatCheckpass.BUG= http://b/587437992
This change is