Skip to content

Conversation

@ldematte
Copy link
Contributor

@ldematte ldematte commented May 7, 2025

Preliminary step for test entitlement initialization, extracted from #127814

@ldematte ldematte requested a review from a team as a code owner May 7, 2025 10:16
@ldematte ldematte added >refactoring auto-backport Automatically create backport pull requests when merged v8.19.0 v9.1.0 :Core/Infra/Entitlements Entitlements infrastructure v8.18.2 v9.0.2 labels May 7, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label May 7, 2025
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@prdoyle prdoyle left a comment

Choose a reason for hiding this comment

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

LGTM. A couple of thoughts I had while reviewing...

final Class<?> initClazz;
try {
initClazz = Class.forName("org.elasticsearch.entitlement.initialization.EntitlementInitialization");
initClazz = Class.forName(agentArgs);
Copy link
Contributor

Choose a reason for hiding this comment

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

Making the arguments just be the name of the class, rather than some kind of option flags, doesn't allow much evolution in the future, but then, we are in control of all of this code and change it in the future if need be, just like we did this time, so it doesn't actually matter much.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had exactly the same conversation in my head :D wondering if I should do that, and thinking we can change this any time anyway, so I decided to let it like this for now. Unless you or someone else feels strongly about this.

}

private static String findAgentJar() {
public static String findAgentJar() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why this became public, but I presume that will become clear in an upcoming PR.

Copy link
Member

Choose a reason for hiding this comment

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

This can be package private, right? The TestEntitlementBootstrap can be in the same entitlement bootstrap package (split packages are ok when using the classpath)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes sorry this change slipped in (see the linked PR).
If split packages are OK for tests (as we use the classpath) I will change them the package of TestEntitlementBootstrap etc. and make this (and other method/classes) package-private then.

@ldematte ldematte merged commit 2d9fc30 into elastic:main May 8, 2025
17 checks passed
@ldematte ldematte deleted the entitlements/test-entitlements-bootstrap branch May 8, 2025 08:22
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
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.19
8.18
9.0

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
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 >refactoring Team:Core/Infra Meta label for core/infra team v8.18.2 v8.19.0 v9.0.2 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants