Skip to content

[Entitlements] Add test entitlement bootstrap and initialization classes #127814

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

Conversation

ldematte
Copy link
Contributor

@ldematte ldematte commented May 7, 2025

Entitlement bootstrap and initialization for tests.
It loads the agent, use the TestBuildInfo files to create a test ScopeResolver and to locate and load policies and descriptors for plugins and server.
To be used in BootstrapForTesting.

@ldematte ldematte requested a review from a team as a code owner May 7, 2025 10:13
@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v9.1.0 labels May 7, 2025
@ldematte ldematte marked this pull request as draft May 7, 2025 10:15
@ldematte ldematte added WIP :Core/Infra/Entitlements Entitlements infrastructure and removed needs:triage Requires assignment of a team area label labels May 7, 2025
pluginPolicies,
null, // TestScopeResolver.createScopeResolver
Map.of(), // TODO: a map that always return nulls? Replace with functor
ENTITLEMENTS_MODULE, // TODO: this will need to change -- encapsulate it when we extract isTriviallyAllowed
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh interesting. What do you have in mind here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you go with Ryan's suggestion to replace the methods altogether, this will be part of the prod code -- the test code could just test for package name like junit or gradle. I'll wait and see how that evolves :)

ldematte added a commit that referenced this pull request May 8, 2025
Preliminary step for test entitlement initialization, extracted from #127814
ldematte added a commit to ldematte/elasticsearch that referenced this pull request May 8, 2025
Preliminary step for test entitlement initialization, extracted from elastic#127814
ldematte added a commit to ldematte/elasticsearch that referenced this pull request May 8, 2025
Preliminary step for test entitlement initialization, extracted from elastic#127814
ldematte added a commit to ldematte/elasticsearch that referenced this pull request May 8, 2025
Preliminary step for test entitlement initialization, extracted from elastic#127814
elasticsearchmachine pushed a commit that referenced this pull request May 8, 2025
Preliminary step for test entitlement initialization, extracted from #127814
elasticsearchmachine pushed a commit that referenced this pull request May 8, 2025
Preliminary step for test entitlement initialization, extracted from #127814
elasticsearchmachine pushed a commit that referenced this pull request May 8, 2025
Preliminary step for test entitlement initialization, extracted from #127814
ywangd pushed a commit to ywangd/elasticsearch that referenced this pull request May 9, 2025
Preliminary step for test entitlement initialization, extracted from elastic#127814
jfreden pushed a commit to jfreden/elasticsearch that referenced this pull request May 12, 2025
Preliminary step for test entitlement initialization, extracted from elastic#127814
Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

A few general comments, looks pretty good

@ldematte ldematte added auto-backport Automatically create backport pull requests when merged v8.19.0 and removed WIP labels May 22, 2025
@ldematte ldematte marked this pull request as ready for review May 22, 2025 12:16
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label May 22, 2025
@prdoyle
Copy link
Contributor

prdoyle commented May 29, 2025

Looks like we'll proceed with this in #128625.

@prdoyle prdoyle closed this May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged :Core/Infra/Entitlements Entitlements infrastructure Team:Core/Infra Meta label for core/infra team >test Issues or PRs that are addressing/adding tests v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants