Skip to content

Bump TrialLicenseVersion to allow starting new trial on 9.0 #120198

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 4 commits into from
Jan 16, 2025

Conversation

jfreden
Copy link
Contributor

@jfreden jfreden commented Jan 15, 2025

You are allowed to initiate a trial only if your cluster has not already activated a trial for the current major product version. For example, if you have already activated a trial for v6.0, you cannot start a new trial until v7.0.

LicensesMetadata is a ClusterState custom that contains the license information for a cluster. If the cluster has exercised a trial there is a trial version field populated. During a major upgrade, we want to allow users to run a new trial to test the features on the new major.

This PR updates the trial version in the license to allow to start a new trial on 9.0.

When 9.0 is released we'll have no clusters that has already exercised the trial so this PR also removes some of the BWC handling that was added when trial license version was decoupled from stack version.

@jfreden jfreden added >enhancement :Security/License License functionality for commercial features labels Jan 15, 2025
@jfreden jfreden requested a review from gwbrown January 15, 2025 13:53
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

@elasticsearchmachine elasticsearchmachine added Team:Security Meta label for security team v9.0.0 labels Jan 15, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @jfreden, I've created a changelog YAML for you.

Copy link
Contributor

@gwbrown gwbrown left a comment

Choose a reason for hiding this comment

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

Left a couple minor comments but no need for another round of review after they're addressed; otherwise LGTM. Thanks!

Comment on lines 42 to 37
assertFalse(new TrialLicenseVersion(randomIntBetween(8_00_00_00, TRIAL_VERSION_CUTOVER)).ableToStartNewTrial());
assertFalse(new TrialLicenseVersion(randomIntBetween(9_00_00_00, TRIAL_VERSION_CUTOVER)).ableToStartNewTrial());
Copy link
Contributor

Choose a reason for hiding this comment

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

We should make sure these tests check trials started in 8.x.

@@ -27,12 +27,9 @@ public class TrialLicenseVersion implements ToXContentFragment, Writeable {
// generic Elasticsearch version. While it's derived from the Elasticsearch version formula for BWC, it is independent of it going
// forward. When we want users to be able to start a new trial, increment this number.
// Pkg-private for testing only.
static final int TRIAL_VERSION_CUTOVER = 8_12_00_99;
static final int TRIAL_VERSION_CUTOVER = 9_00_00_00;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be best to rename this at this point; it's not the cutover version anymore, it's the current trial version.

Also I am not asking you to change this but this version number is decoupled from the product version intentionally, so arguably the new trial version number should be 8120100. That said, I think that's confusing in practice and matching the product version isn't a bad idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Yes, I agree. I went with keeping it as 9_00_00_00.

@jfreden jfreden added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Jan 16, 2025
@elasticsearchmachine elasticsearchmachine merged commit 4735260 into elastic:main Jan 16, 2025
21 checks passed
@jfreden jfreden deleted the fix_trial_version branch January 16, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >enhancement :Security/License License functionality for commercial features Team:Security Meta label for security team v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants