open-telemetry / open-telemetry/opentelemetry-java-instrumentation

Apply visible-for-testing comments consistently

Open
#20,049 0 comments 0 reactions 1 assignee View on GitHub

@trask is already working on this.

Since Sep 9, 2026.

enhancement needs triage
Dominant language
Java
Stars
2.6k
Forks
1.2k
Avg merge
2d 18h
Merged PRs (30d)
228

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.