Skip to content

Apply visible-for-testing comments consistently #20049

Description

@trask

Is your feature request related to a problem? Please describe.

Production Java members whose visibility is broader solely for direct test access do not consistently explain that exception to the repository's minimal-visibility rule. This makes it harder to distinguish intentional test access from visibility that can be tightened.

Describe the solution you'd like

After #20048 merges, audit production Java sources for members accessed directly only by tests and add // visible for testing immediately above their declarations. Check usages before changing each member so the comment is not added when production code also requires the visibility.

Describe alternatives you've considered

Changing member visibility is not part of this cleanup because tests may need direct access. An annotation would add dependencies or require a repository-wide annotation convention where the existing comment already has broad precedent.

Additional context

#20048 adds this convention to the always-loaded agent knowledge guidance. The rule came from review feedback on #19868.

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestneeds triageNew issue that requires triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions