Skip to content

Conversation

@fmeum
Copy link
Collaborator

@fmeum fmeum commented Jan 10, 2026

This reverts commit 7111cbf, which in turn reverted cecc26b.

The regression is fixed by adding an additional fallback to a repo mapping lookup for the main repo to accommodate the tests in rules_cc and rules_java. The restructuring of the checks also results in a further improvement down to a 1% slowdown incurred by the checks (vs. 10-20% before this change).

This reverts commit 7111cbf, with an additional fallback to a repo mapping lookup for the main repo to accomodate the tests in rules_cc and rules_java.
@fmeum fmeum marked this pull request as ready for review January 10, 2026 13:00
@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Jan 10, 2026
@fmeum fmeum requested review from Wyverald, Copilot and hvadehra and removed request for hvadehra January 10, 2026 13:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR relands a previously reverted performance optimization that avoids expensive repository mapping lookups when checking builtin API access restrictions. The original regression has been fixed by adding a fallback to repo mapping lookup specifically for the main repository case to accommodate tests in rules_cc and rules_java.

Changes:

  • Introduced reposMatch() helper method that optimizes repository name matching by avoiding RepositoryMapping.get() calls in most cases
  • Replaced string-based comparison with constant-based comparison for the _builtins repository check
  • Added import for RepositoryName class

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fmeum
Copy link
Collaborator Author

fmeum commented Jan 10, 2026

@bazel-io fork 9.0.0

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

Labels

awaiting-review PR is awaiting review from an assigned reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant