Skip to content

Commit a314158

Browse files
Tausif RahmanEvergreen Agent
Tausif Rahman
authored and
Evergreen Agent
committed
SERVER-78250 Implement fallback for releases.yml
1 parent 248f55a commit a314158

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

buildscripts/resmokelib/multiversionconstants.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import requests
66

77
import structlog
8+
import buildscripts.resmokelib.config as _config
89

910
from buildscripts.resmokelib.multiversion.multiversion_service import (
1011
MongoReleases, MongoVersion, MultiversionService, MONGO_VERSION_YAML, RELEASES_YAML)
@@ -38,9 +39,20 @@ def generate_mongo_version_file():
3839

3940
def generate_releases_file():
4041
"""Generate the releases constants file."""
41-
# Copy the 'releases.yml' file from the source tree.
42-
with open(RELEASES_YAML, "wb") as file:
43-
file.write(requests.get(MASTER_RELEASES_FILE).content)
42+
try:
43+
# Get the latest releases.yml from github
44+
with open(RELEASES_YAML, "wb") as file:
45+
file.write(requests.get(MASTER_RELEASES_FILE).content)
46+
except Exception as exc:
47+
LOGGER.warning(f"Could not get releases.yml file: {MASTER_RELEASES_FILE}")
48+
49+
# If this fails in CI we want to be aware and fix this
50+
if _config.EVERGREEN_TASK_ID:
51+
raise exc
52+
53+
# Fallback to the current releases.yml
54+
releases_yaml_path = os.path.join("src", "mongo", "util", "version", "releases.yml")
55+
shutil.copyfile(releases_yaml_path, RELEASES_YAML)
4456

4557

4658
def in_git_root_dir():

0 commit comments

Comments
 (0)