Skip to content

Fix logic to determine unreleased versions#39059

Closed
alpar-t wants to merge 1 commit intoelastic:masterfrom
alpar-t:fix-verifyVersion-38708
Closed

Fix logic to determine unreleased versions#39059
alpar-t wants to merge 1 commit intoelastic:masterfrom
alpar-t:fix-verifyVersion-38708

Conversation

@alpar-t
Copy link
Copy Markdown
Contributor

@alpar-t alpar-t commented Feb 18, 2019

Around this time we have a bugfix that's too majors behind master.
The logic to determine unreleased versions was not accounting for this.

The logic didn't account to have two unreleased minors 6.7 and 7.1 and
a staged minor 7.0, thus the change to only consider index compatible
versions.
This is fine since the point of the logic is to be able to set up BWC
tests we will not care for mote than one major behind and as such will
have fewer versions to map to gradle projects making the logic valid
again.

Since master is not index compatible with the versions the build previously failed to identify, the bwc tests were not affected.

Closes #38708

Arround this time we have a bugfix that's too majors behind master.
The logic to determine unreleased versions was not accounting for this.

The logic didn't account to have two unreleased minors  6.7 and 7.1 and
a staged minor 7.0, thus the change to only consider index compatible
versions.
This is fine since the point of the logic is to be able to set up BWC
tests we will not care for mote than one major behind and as such will
have fewer versions to map to gradle projects making the logic valid
again.
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra

@rjernst
Copy link
Copy Markdown
Member

rjernst commented Feb 18, 2019

What is the actual problem trying to be solved? Master should not need to know anything about 6.7, from the bwc compat standpoint. I think making version collection know about 3 major versions should not be necessary. Instead, we could ignore these older versions when reading Version.java?

@alpar-t
Copy link
Copy Markdown
Contributor Author

alpar-t commented Feb 19, 2019

@rjernst the problem being solved is verifyVersions failing because VersionCollections doesn't mark the older versions as unreleased.
We could change that check to only care about index compatible, or just ignore anything past that point ( which this change already does to some extent ), but this information is still useful as master is the only one that has the complete picture, and I'm planing to use this information about unreleased versions to implement some additional checks in CI

}

public List<Version> getUnreleased() {
protected List<Version> getUnreleased() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We reduced visibility on this, but we still use this method if a couple of places outside this class and its tests. We now have this weirdness where VersionCollections.unreleased and VersionCollections.getUnreleased are different sets. Maybe we should rename the former to make it clear it includes on index compatible versions? We might also consider refactoring external usages.

}
}

// Special case when we are about to release a new major, we have branched and incremented versions
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As @rjernst mentioned, what do we actually use these versions for? They are never included in any of the BWC tests. Basically, if an unreleased version isn't wire or index compatible it's kind of irrelevant isn't it?

Copy link
Copy Markdown
Contributor

@mark-vieira mark-vieira left a comment

Choose a reason for hiding this comment

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

I have some concerns that the logic in the class, which is already pretty complex and difficult to reason about, is starting to balloon even more. It might be worth reexamining its true purpose (which is to determine the BWC test matrix) and perhaps do some refactoring to simplify it to that use case rather than attempt to be a generic repository of all ES version info.

@alpar-t
Copy link
Copy Markdown
Contributor Author

alpar-t commented Feb 27, 2019

@mark-vieira @rjernst the reason I kept these version around is that I want to implement a new check for PRs against older branches that tests forwards comparability.
Today, one can merge into 7.x and break master, and we don't have any checks in place to prevent this.
Master is the only one that knows about all versions, so this new check would check out master and call a task to dump a map of version to the next unreleased branch ( ex '6.7' -> '7.0', '7.1' -> master) so we can then check out the relevant target version (e.x. if the PR is against6.7we check out7.x) and run bwc tests on that branch, but pointing the ref of the6.7` branch to the PR.

I completely agree on the complexity and need of refactor and all for it, but would like to keep it separate from this PR ( I will look at getUnreleased that's an oversight as I didn't find the usages when I changed it ). This code was rewritten from Groovy not long ago and it underwent multiple revisions before that too, that first time when you look at it is a great time to improve on and the tests should give you enough confidence in doing so, unfortunately I came to know it too well and it's harder for me to see how to simplify it.

@alpar-t
Copy link
Copy Markdown
Contributor Author

alpar-t commented Mar 4, 2019

Closing this in favor of a simpler approach in #39624

@alpar-t alpar-t closed this Mar 4, 2019
@alpar-t alpar-t deleted the fix-verifyVersion-38708 branch March 4, 2019 07:45
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Delivery/Build Build or test infrastructure >non-issue Team:Delivery Meta label for Delivery team v7.2.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Branch consistency fails in verifyVersion

5 participants