diff options
Diffstat (limited to 'buildscripts/resmokelib/multiversion/multiversion_service.py')
| -rw-r--r-- | buildscripts/resmokelib/multiversion/multiversion_service.py | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/buildscripts/resmokelib/multiversion/multiversion_service.py b/buildscripts/resmokelib/multiversion/multiversion_service.py index 3597cc2177f..621d5ade9ae 100644 --- a/buildscripts/resmokelib/multiversion/multiversion_service.py +++ b/buildscripts/resmokelib/multiversion/multiversion_service.py @@ -25,9 +25,9 @@ def version_str(version: Version) -> str: return f"{version.major}.{version.minor}" -class FcvConstantValues(NamedTuple): +class VersionConstantValues(NamedTuple): """ - Object to hold the calculated FCV constants. + Object to hold the calculated Version constants. * latest: Latest FCV. * last_continuous: Last continuous FCV. @@ -36,6 +36,7 @@ class FcvConstantValues(NamedTuple): * requires_fcv_tag_list_continuous: List of FCVs that we need to generate a tag for against continuous versions. * fcvs_less_than_latest: List of all FCVs that are less than latest, starting from v4.0. + * eols: List of stable MongoDB versions since v2.0 that have been EOL'd. """ latest: Version @@ -44,6 +45,7 @@ class FcvConstantValues(NamedTuple): requires_fcv_tag_list: List[Version] requires_fcv_tag_list_continuous: List[Version] fcvs_less_than_latest: List[Version] + eols: List[Version] def get_fcv_tag_list(self) -> str: """Get a comma joined string of all the fcv tags.""" @@ -96,6 +98,10 @@ class FcvConstantValues(NamedTuple): last_continuous = self.get_last_continuous_fcv() return f"{base_name}-{last_continuous}" + def get_eols(self) -> List[str]: + """Get EOL'd versions as list of strings.""" + return [version_str(eol) for eol in self.eols] + class MongoVersion(BaseModel): """ @@ -132,12 +138,14 @@ class MongoReleases(BaseModel): * feature_compatibility_version: All FCVs starting with 4.0. * long_term_support_releases: All LTS releases starting with 4.0. + * eol_versions: List of stable MongoDB versions since 2.0 that have been EOL'd. * generate_fcv_lower_bound_override: Extend FCV generation down to the previous value of last LTS. """ feature_compatibility_versions: List[str] = Field(alias="featureCompatibilityVersions") long_term_support_releases: List[str] = Field(alias="longTermSupportReleases") + eol_versions: List[str] = Field(alias="eolVersions") generate_fcv_lower_bound_override: Optional[str] = Field(None, alias="generateFCVLowerBoundOverride") @@ -159,7 +167,11 @@ class MongoReleases(BaseModel): def get_lts_versions(self) -> List[Version]: """Get the Version representation of the lts versions.""" - return [Version(fcv) for fcv in self.long_term_support_releases] + return [Version(lts) for lts in self.long_term_support_releases] + + def get_eol_versions(self) -> List[Version]: + """Get the Version representation of the EOL versions.""" + return [Version(eol) for eol in self.eol_versions] class MultiversionService: @@ -175,11 +187,12 @@ class MultiversionService: self.mongo_version = mongo_version self.mongo_releases = mongo_releases - def calculate_fcv_constants(self) -> FcvConstantValues: + def calculate_version_constants(self) -> VersionConstantValues: """Calculate multiversion constants from data files.""" latest = self.mongo_version.get_version() fcvs = self.mongo_releases.get_fcv_versions() lts = self.mongo_releases.get_lts_versions() + eols = self.mongo_releases.get_eol_versions() lower_bound_override = self.mongo_releases.generate_fcv_lower_bound_override # Highest release less than latest. @@ -200,7 +213,12 @@ class MultiversionService: # All FCVs less than latest. fcvs_less_than_latest = fcvs[:bisect_left(fcvs, latest)] - return FcvConstantValues(latest=latest, last_continuous=last_continuous, last_lts=last_lts, - requires_fcv_tag_list=requires_fcv_tag_list, - requires_fcv_tag_list_continuous=requires_fcv_tag_list_continuous, - fcvs_less_than_latest=fcvs_less_than_latest) + return VersionConstantValues( + latest=latest, + last_continuous=last_continuous, + last_lts=last_lts, + requires_fcv_tag_list=requires_fcv_tag_list, + requires_fcv_tag_list_continuous=requires_fcv_tag_list_continuous, + fcvs_less_than_latest=fcvs_less_than_latest, + eols=eols, + ) |
