Skip to content

Commit 2faa128

Browse files
kevinAlbsblink1073
andauthored
Reinterpret latest to mean "latest build" (#607)
Co-authored-by: Steven Silvester <steve.silvester@mongodb.com>
1 parent b694507 commit 2faa128

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

.evergreen/mongodl.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def iter_available(
518518
AND (:edition IS NULL OR edition=:edition)
519519
AND (
520520
CASE
521-
WHEN :version='latest'
521+
WHEN :version='latest-release'
522522
THEN 1
523523
WHEN :version='latest-stable'
524524
THEN mdb_version_not_rc(version)
@@ -804,7 +804,7 @@ def _latest_build_url(
804804
if "rhel" in target:
805805
# Some RHEL targets include a minor version, like "rhel93". Check the URL of the latest release.
806806
latest_release_url = _published_build_url(
807-
cache, "latest", target, arch, edition, component
807+
cache, "latest-release", target, arch, edition, component
808808
)
809809
got = re.search(r"rhel[0-9][0-9]", latest_release_url)
810810
if got is not None:
@@ -835,7 +835,7 @@ def _dl_component(
835835
latest_build_branch: "str|None",
836836
) -> ExpandResult:
837837
LOGGER.info(f"Download {component} {version}-{edition} for {target}-{arch}")
838-
if version == "latest-build":
838+
if version in ("latest-build", "latest"):
839839
dl_url = _latest_build_url(
840840
cache, target, arch, edition, component, latest_build_branch
841841
)
@@ -845,13 +845,13 @@ def _dl_component(
845845
cache, version, target, arch, edition, component
846846
)
847847
except ValueError:
848-
if component == "crypt_shared" and version != "latest":
848+
if component == "crypt_shared" and version != "latest-release":
849849
warnings.warn(
850-
"No matching version of crypt_shared found, using 'latest'",
850+
"No matching version of crypt_shared found, using 'latest-release'",
851851
stacklevel=2,
852852
)
853-
version = "latest"
854-
# The target will be macos on latest.
853+
version = "latest-release"
854+
# The target will be macos on latest-release.
855855
if target == "osx":
856856
target = "macos"
857857
else:
@@ -1086,12 +1086,12 @@ def main(argv=None):
10861086
dl_grp.add_argument(
10871087
"--version",
10881088
"-V",
1089-
default="latest",
1090-
help='The product version to download. Use "latest" to download '
1089+
default="latest-build",
1090+
help='The product version to download. Use "latest-release" to download '
10911091
"the newest available version (including release candidates). Use "
10921092
'"latest-stable" to download the newest version, excluding release '
10931093
'candidates. Use "rapid" to download the latest rapid release. '
1094-
' Use "latest-build" to download the most recent build of '
1094+
' Use "latest-build" or "latest" to download the most recent build of '
10951095
'the named component. Use "--list" to list available versions.',
10961096
)
10971097
dl_grp.add_argument(

.evergreen/tests/test-cli.sh

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export VALIDATE_DISTROS=1
6666
./mongodl --edition enterprise --version rapid --component archive --test
6767
./mongodl --edition enterprise --version latest --component archive --out ${DOWNLOAD_DIR}
6868
./mongodl --edition enterprise --version latest-build --component archive --test
69+
./mongodl --edition enterprise --version latest-release --component archive --test
6970
./mongodl --edition enterprise --version v6.0-perf --component cryptd --test
7071
./mongodl --edition enterprise --version v8.0-perf --component cryptd --test
7172

0 commit comments

Comments
 (0)