Class VersionCollection


  • public class VersionCollection
    extends java.lang.Object
    A container for elasticsearch supported version information used in BWC testing. Parse the Java source file containing the versions declarations and use the known rules to figure out which are all the version the current one is wire and index compatible with. On top of this, figure out which of these are unreleased and provide the branch they can be built from. Note that in this context, currentVersion is the unreleased version this build operates on. At any point in time there will surely be four such unreleased versions being worked on, thus currentVersion will be one of these. Considering:
    M, M > 0
    last released major
    N, N > 0
    last released minor
    • the unreleased major, M+1.0.0 on the `master` branch
    • the unreleased minor, M.N.0 on the `M.x` (x is literal) branch
    • the unreleased bugfix, M.N.c (c > 0) on the `M.b` branch
    • the unreleased maintenance, M-1.d.e ( d > 0, e > 0) on the `(M-1).d` branch
    In addition to these, there will be a fifth one when a minor reaches feature freeze, we call this the staged version:
    • the unreleased staged, M.N-2.0 (N > 2) on the `M.(N-2)` branch
    Each build is only concerned with versions before it, as those are the ones that need to be tested for backwards compatibility. We never look forward, and don't add forward facing version number to branches of previous version. Each branch has a current version, and expected compatible versions are parsed from the server code's Version` class. We can reliably figure out which the unreleased versions are due to the convention of always adding the next unreleased version number to server in all branches when a version is released. E.x when M.N.c is released M.N.c+1 is added to the Version class mentioned above in all the following branches: `M.b`, `M.x` and `master` so we can reliably assume that the leafs of the version tree are unreleased. This convention is enforced by checking the versions we consider to be unreleased against an authoritative source (maven central). We are then able to map the unreleased version to branches in git and Gradle projects that are capable of checking out and building them, so we can include these in the testing plan as well.
    • Constructor Detail

      • VersionCollection

        public VersionCollection​(java.util.List<java.lang.String> versionLines)
      • VersionCollection

        protected VersionCollection​(java.util.List<java.lang.String> versionLines,
                                    org.elasticsearch.gradle.Version currentVersionProperty)
    • Method Detail

      • getUnreleased

        public java.util.List<org.elasticsearch.gradle.Version> getUnreleased()
      • compareToAuthoritative

        public void compareToAuthoritative​(java.util.List<org.elasticsearch.gradle.Version> authoritativeReleasedVersions)
      • getIndexCompatible

        public java.util.List<org.elasticsearch.gradle.Version> getIndexCompatible()
      • getWireCompatible

        public java.util.List<org.elasticsearch.gradle.Version> getWireCompatible()
      • getUnreleasedIndexCompatible

        public java.util.List<org.elasticsearch.gradle.Version> getUnreleasedIndexCompatible()
      • getUnreleasedWireCompatible

        public java.util.List<org.elasticsearch.gradle.Version> getUnreleasedWireCompatible()