Skip to content

refactor: use centralized NOT_ACTUALLY_PUBLIC across internal targets#3920

Merged
aignas merged 5 commits into
bazel-contrib:mainfrom
rickeylev:internal-visibility-constant-plan
Jul 12, 2026
Merged

refactor: use centralized NOT_ACTUALLY_PUBLIC across internal targets#3920
aignas merged 5 commits into
bazel-contrib:mainfrom
rickeylev:internal-visibility-constant-plan

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

Currently, several internal macros, toolchain definitions, and
config settings either hardcode `["//visibility:public"]` or define
private copies like `_NOT_ACTUALLY_PUBLIC`. This scatters visibility
workarounds across the codebase and makes developer intent unclear.

To clean this up, transition internal rules across `python/private` to
use `NOT_ACTUALLY_PUBLIC` from `python/private/visibility.bzl`, and
update corresponding `bzl_library` dependencies to match.

Currently, several internal macros, toolchain definitions, and config settings either hardcode ["//visibility:public"] or define private copies like _NOT_ACTUALLY_PUBLIC. This scatters visibility workarounds and makes intention unclear.

To clean this up, transition internal rules and helper targets in python/private to use the centralized NOT_ACTUALLY_PUBLIC constant from python/private/visibility.bzl and ensure bzl_library dependencies accurately reflect the load graph.
@rickeylev rickeylev requested a review from aignas as a code owner July 11, 2026 17:50

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces hardcoded public visibility lists with a centralized NOT_ACTUALLY_PUBLIC visibility constant imported from :visibility.bzl across multiple Bazel build files and templates. The reviewer feedback suggests avoiding a cross-repository load of the private visibility file in generated toolchain content to prevent package boundary violations, and recommends updating adjacent bootstrap template targets in python/private/BUILD.bazel to use the new constant for consistency.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread python/private/toolchains_repo.bzl Outdated
Comment thread python/private/BUILD.bazel
@rickeylev rickeylev marked this pull request as draft July 11, 2026 17:59
Revert _HOST_TOOLCHAIN_BUILD_CONTENT visibility in toolchains_repo.bzl to avoid cross-repo load violations and update adjacent bootstrap template targets in python/private/BUILD.bazel to NOT_ACTUALLY_PUBLIC for consistency.
Some targets in config_settings, local_runtime_repo_setup, and runtime_env_toolchain require standard public visibility rather than NOT_ACTUALLY_PUBLIC.

To fix, revert local_runtime_repo_setup.bzl and runtime_env_toolchain.bzl to regular public visibility, restore regular public on specified targets in config_settings.bzl, and update corresponding bzl_library dependencies.
@rickeylev rickeylev marked this pull request as ready for review July 11, 2026 18:07
Multiple internal targets across config_settings, python/private, and internal tools set public visibility accompanied by comments noting they are only public for implicit dependencies or cross-repo references.

To clean this up, transition those targets to use NOT_ACTUALLY_PUBLIC from python/private/visibility.bzl, and introduce a self-contained visibility constant inside sphinxdocs to maintain strict project boundaries.
@rickeylev rickeylev marked this pull request as draft July 11, 2026 18:42
@rickeylev rickeylev requested a review from kaycebasques July 11, 2026 18:42
@rickeylev

Copy link
Copy Markdown
Collaborator Author

/review

@rickeylev rickeylev marked this pull request as ready for review July 11, 2026 22:09
@aignas aignas added this pull request to the merge queue Jul 12, 2026
Merged via the queue into bazel-contrib:main with commit 5bdec9f Jul 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants