-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Refactor: ScopeResolver #126921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Refactor: ScopeResolver #126921
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3dc5f2a
Fix: use getScopeName consistently
prdoyle db3f55f
Rename PolicyManagerTests method
prdoyle 9fb36ac
Refacor: simplify PluginsResolver.create
prdoyle baf49a3
Change PluginsResolver to ScopeResolver
prdoyle 04eb46b
Move boot layer test to ScopeResolverTests
prdoyle 75291e6
[CI] Auto commit changes from spotless
99a3d75
Merge branch 'main' into scope-resolver
prdoyle 7d17e07
Rename PolicyScope
prdoyle 1871801
Merge branch 'main' into scope-resolver
prdoyle a3fd00b
Merge remote-tracking branch 'upstream/main' into scope-resolver
prdoyle 986236a
Add ComponentKind enum
prdoyle 39fe73a
Merge remote-tracking branch 'origin/scope-resolver' into scope-resolver
prdoyle 76a433f
Merge remote-tracking branch 'upstream/main' into scope-resolver
prdoyle b175466
Package private componentName field
prdoyle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of exposing these strings, can we have constants defined in ScopeInfo for each of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh like an enum? Yeah I'd much prefer that actually. I was considering it but didn't want to hold up the PR.
I was thinking of:
Is that what you were picturing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we didn't have to support JDK 17, we could go all the way to algebraic datatypes:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about Java 17 prohibits that? Still seems doable, even if with static methods?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consuming it is harder than the enum because you can't use switch patterns until Java 21.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do we consume it in a switch? Don't we just use the two strings right now? I view the helpers as making construction if the scope more robust, and allowing us to keep some eg logging strings for server internal to entitlements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've gone with an enum plus some factory method helpers.