Skip to content

Allow repo rules to define previously reserved attributes#28453

Closed
michaelm-openai wants to merge 3 commits intobazelbuild:masterfrom
michaelm-openai:michaelm/allow-visibility-repo-rule-attr
Closed

Allow repo rules to define previously reserved attributes#28453
michaelm-openai wants to merge 3 commits intobazelbuild:masterfrom
michaelm-openai:michaelm/allow-visibility-repo-rule-attr

Conversation

@michaelm-openai
Copy link
Copy Markdown
Contributor

Fixes #28450

@github-actions github-actions Bot added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Jan 27, 2026
Copy link
Copy Markdown

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

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 allows repository rules to define attributes that were previously reserved, specifically tags, deprecation, and visibility. The implementation correctly reduces the set of reserved attribute names to just name. The change is accompanied by new integration tests that verify a repository rule can now define and use a visibility attribute. The changes are clean, correct, and improve the flexibility of repository rule definitions. I have no specific comments as the implementation and tests look good.

@meteorcloudy meteorcloudy requested a review from Wyverald January 28, 2026 16:07
@meteorcloudy meteorcloudy added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Mar 4, 2026
@Wyverald Wyverald requested a review from fmeum March 5, 2026 23:09
Maps.filterKeys(kwargs, k -> !LEGACY_BUILTIN_ATTRIBUTES.contains(k)),
Maps.filterKeys(
kwargs,
k -> !RESERVED_ATTRIBUTES.contains(k)),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: Since name is already handled specially above, we could just get rid of RESERVED_ATTRIBUTES and just check for name (extracted into a String constant) directly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

/gemini Remove RESERVED_ATTRIBUTES and just check whether k is not equal to "name".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hoped that would work, oh well. Manually made the update.

@copybara-service copybara-service Bot closed this in 7fa3196 Mar 6, 2026
@github-actions github-actions Bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[9.0.0] Can't define attributes for repository rules that should only be reserved for build rules

3 participants