Skip to content

Commit bec8626

Browse files
committed
Merge branch 'master' into maciejk/use-ar-related-versions
# Conflicts: # scripts/release/build_context.py
2 parents 2eebf0f + c51b8ba commit bec8626

File tree

9 files changed

+154
-5
lines changed

9 files changed

+154
-5
lines changed

.evergreen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include:
99
variables:
1010
- &ops_manager_60_latest 6.0.27 # The order/index is important, since these are anchors. Please do not change
1111

12-
- &ops_manager_70_latest 7.0.15 # The order/index is important, since these are anchors. Please do not change
12+
- &ops_manager_70_latest 7.0.17 # The order/index is important, since these are anchors. Please do not change
1313

1414
- &ops_manager_80_latest 8.0.12 # The order/index is important, since these are anchors. Please do not change
1515

config/manager/manager.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@ spec:
162162
value: "quay.io/mongodb/mongodb-agent-ubi:107.0.15.8741-1_1.1.0"
163163
- name: RELATED_IMAGE_AGENT_IMAGE_107_0_15_8741_1_1_2_0
164164
value: "quay.io/mongodb/mongodb-agent-ubi:107.0.15.8741-1_1.2.0"
165+
- name: RELATED_IMAGE_AGENT_IMAGE_107_0_17_8771_1
166+
value: "quay.io/mongodb/mongodb-agent-ubi:107.0.17.8771-1"
167+
- name: RELATED_IMAGE_AGENT_IMAGE_107_0_17_8771_1_1_0_1
168+
value: "quay.io/mongodb/mongodb-agent-ubi:107.0.17.8771-1_1.0.1"
169+
- name: RELATED_IMAGE_AGENT_IMAGE_107_0_17_8771_1_1_1_0
170+
value: "quay.io/mongodb/mongodb-agent-ubi:107.0.17.8771-1_1.1.0"
171+
- name: RELATED_IMAGE_AGENT_IMAGE_107_0_17_8771_1_1_2_0
172+
value: "quay.io/mongodb/mongodb-agent-ubi:107.0.17.8771-1_1.2.0"
165173
- name: RELATED_IMAGE_AGENT_IMAGE_108_0_0_8694_1
166174
value: "quay.io/mongodb/mongodb-agent-ubi:108.0.0.8694-1"
167175
- name: RELATED_IMAGE_AGENT_IMAGE_108_0_0_8694_1_1_0_1
@@ -272,6 +280,8 @@ spec:
272280
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:7.0.14"
273281
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_7_0_15
274282
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:7.0.15"
283+
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_7_0_17
284+
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:7.0.17"
275285
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_8_0_0
276286
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:8.0.0"
277287
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_8_0_1

helm_chart/values-openshift.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ relatedImages:
3737
- 7.0.13
3838
- 7.0.14
3939
- 7.0.15
40+
- 7.0.17
4041
- 8.0.0
4142
- 8.0.1
4243
- 8.0.2
@@ -114,6 +115,10 @@ relatedImages:
114115
- 107.0.15.8741-1_1.0.1
115116
- 107.0.15.8741-1_1.1.0
116117
- 107.0.15.8741-1_1.2.0
118+
- 107.0.17.8771-1
119+
- 107.0.17.8771-1_1.0.1
120+
- 107.0.17.8771-1_1.1.0
121+
- 107.0.17.8771-1_1.2.0
117122
- 108.0.0.8694-1
118123
- 108.0.0.8694-1_1.0.1
119124
- 108.0.0.8694-1_1.1.0

public/mongodb-kubernetes-openshift.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,14 @@ spec:
466466
value: "quay.io/mongodb/mongodb-agent-ubi:107.0.15.8741-1_1.1.0"
467467
- name: RELATED_IMAGE_AGENT_IMAGE_107_0_15_8741_1_1_2_0
468468
value: "quay.io/mongodb/mongodb-agent-ubi:107.0.15.8741-1_1.2.0"
469+
- name: RELATED_IMAGE_AGENT_IMAGE_107_0_17_8771_1
470+
value: "quay.io/mongodb/mongodb-agent-ubi:107.0.17.8771-1"
471+
- name: RELATED_IMAGE_AGENT_IMAGE_107_0_17_8771_1_1_0_1
472+
value: "quay.io/mongodb/mongodb-agent-ubi:107.0.17.8771-1_1.0.1"
473+
- name: RELATED_IMAGE_AGENT_IMAGE_107_0_17_8771_1_1_1_0
474+
value: "quay.io/mongodb/mongodb-agent-ubi:107.0.17.8771-1_1.1.0"
475+
- name: RELATED_IMAGE_AGENT_IMAGE_107_0_17_8771_1_1_2_0
476+
value: "quay.io/mongodb/mongodb-agent-ubi:107.0.17.8771-1_1.2.0"
469477
- name: RELATED_IMAGE_AGENT_IMAGE_108_0_0_8694_1
470478
value: "quay.io/mongodb/mongodb-agent-ubi:108.0.0.8694-1"
471479
- name: RELATED_IMAGE_AGENT_IMAGE_108_0_0_8694_1_1_0_1
@@ -576,6 +584,8 @@ spec:
576584
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:7.0.14"
577585
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_7_0_15
578586
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:7.0.15"
587+
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_7_0_17
588+
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:7.0.17"
579589
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_8_0_0
580590
value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:8.0.0"
581591
- name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_8_0_1

release.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"7.0.13",
4646
"7.0.14",
4747
"7.0.15",
48+
"7.0.17",
4849
"8.0.0",
4950
"8.0.1",
5051
"8.0.2",
@@ -136,6 +137,10 @@
136137
"agent_version": "107.0.15.8741-1",
137138
"tools_version": "100.11.0"
138139
},
140+
"7.0.17": {
141+
"agent_version": "107.0.17.8771-1",
142+
"tools_version": "100.12.2"
143+
},
139144
"8.0.0": {
140145
"agent_version": "108.0.0.8694-1",
141146
"tools_version": "100.10.0"

scripts/release/build/build_info.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def load_build_info(scenario: BuildScenario,
5757
f"""
5858
Load build information based on the specified scenario.
5959
60-
:param scenario: BuildScenario enum value indicating the build scenario (e.g., PATCH, STAGING, RELEASE).
60+
:param scenario: BuildScenario enum value indicating the build scenario (e.g. "development", "patch", "staging", "release"). "development" scenario will return build info for "patch" scenario.
6161
:param repository_path: Path to the Git repository. Default is the current directory `{DEFAULT_REPOSITORY_PATH}`.
6262
:param changelog_sub_path: Path to the changelog directory relative to the repository root. Default is '{DEFAULT_CHANGELOG_PATH}'.
6363
:param initial_commit_sha: SHA of the initial commit to start from if no previous version tag is found. If not provided, it will be determined based on `{RELEASE_INITIAL_VERSION_ENV_VAR} environment variable.
@@ -75,9 +75,14 @@ def load_build_info(scenario: BuildScenario,
7575
with open("build_info.json", "r") as f:
7676
build_info = json.load(f)
7777

78+
build_info_scenario = scenario
79+
# For "development" builds, we use the "patch" scenario to get the build info
80+
if scenario == BuildScenario.DEVELOPMENT:
81+
build_info_scenario = BuildScenario.PATCH
82+
7883
images = {}
7984
for name, env_data in build_info["images"].items():
80-
data = env_data.get(scenario)
85+
data = env_data.get(build_info_scenario)
8186
if not data:
8287
# If no data is available for the scenario, skip this image
8388
continue
@@ -96,7 +101,7 @@ def load_build_info(scenario: BuildScenario,
96101

97102
binaries = {}
98103
for name, env_data in build_info["binaries"].items():
99-
data = env_data.get(scenario)
104+
data = env_data.get(build_info_scenario)
100105
if not data:
101106
# If no data is available for the scenario, skip this binary
102107
continue
@@ -110,7 +115,7 @@ def load_build_info(scenario: BuildScenario,
110115

111116
helm_charts = {}
112117
for name, env_data in build_info["helm-charts"].items():
113-
data = env_data.get(scenario)
118+
data = env_data.get(build_info_scenario)
114119
if not data:
115120
# If no data is available for the scenario, skip this helm-chart
116121
continue

scripts/release/build/build_info_test.py

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,99 @@
1111
)
1212
from scripts.release.build.build_scenario import BuildScenario
1313

14+
def test_load_build_info_development(git_repo: Repo):
15+
version = "latest"
16+
17+
expected_build_info = BuildInfo(
18+
images={
19+
"operator": ImageInfo(
20+
repository="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes",
21+
platforms=["linux/amd64"],
22+
version=version,
23+
sign=False,
24+
),
25+
"init-database": ImageInfo(
26+
repository="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes-init-database",
27+
platforms=["linux/amd64"],
28+
version=version,
29+
sign=False,
30+
),
31+
"init-appdb": ImageInfo(
32+
repository="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes-init-appdb",
33+
platforms=["linux/amd64"],
34+
version=version,
35+
sign=False,
36+
),
37+
"init-ops-manager": ImageInfo(
38+
repository="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes-init-ops-manager",
39+
platforms=["linux/amd64"],
40+
version=version,
41+
sign=False,
42+
),
43+
"database": ImageInfo(
44+
repository="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes-database",
45+
platforms=["linux/amd64"],
46+
version=version,
47+
sign=False,
48+
),
49+
"mco-tests": ImageInfo(
50+
repository="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-community-tests",
51+
platforms=["linux/amd64"],
52+
version=version,
53+
sign=False,
54+
),
55+
"meko-tests": ImageInfo(
56+
repository="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes-tests",
57+
platforms=["linux/amd64"],
58+
version=version,
59+
sign=False,
60+
),
61+
"readiness-probe": ImageInfo(
62+
repository="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes-readinessprobe",
63+
platforms=["linux/amd64"],
64+
version=version,
65+
sign=False,
66+
),
67+
"upgrade-hook": ImageInfo(
68+
repository="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes-operator-version-upgrade-post-start-hook",
69+
platforms=["linux/amd64"],
70+
version=version,
71+
sign=False,
72+
),
73+
"agent": ImageInfo(
74+
repository="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-agent-ubi",
75+
platforms=["linux/amd64"],
76+
version=version,
77+
sign=False,
78+
),
79+
"ops-manager": ImageInfo(
80+
repository="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-enterprise-ops-manager",
81+
platforms=["linux/amd64"],
82+
version="om-version-from-release.json",
83+
sign=False,
84+
),
85+
},
86+
binaries={
87+
"kubectl-mongodb": BinaryInfo(
88+
s3_store="s3://kubectl-mongodb/dev",
89+
platforms=["linux/amd64"],
90+
version=version,
91+
sign=False,
92+
)
93+
},
94+
helm_charts={
95+
"mongodb-kubernetes": HelmChartInfo(
96+
repository="268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/helm-charts",
97+
version=version,
98+
sign=False,
99+
)
100+
},
101+
)
102+
103+
build_info = load_build_info(BuildScenario.DEVELOPMENT, git_repo.working_dir)
104+
105+
assert build_info == expected_build_info
106+
14107

15108
def test_load_build_info_patch(git_repo: Repo):
16109
patch_id = "688364423f9b6c00072b3556"

scripts/release/build/build_scenario.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def get_version(self, repository_path: str, changelog_sub_path: str, initial_com
4545
repo = Repo(repository_path)
4646

4747
match self:
48+
case BuildScenario.DEVELOPMENT:
49+
# When working locally, "version_id" env variable is defined in the generated context file. It is "latest" by
50+
# default, and can be overridden with OVERRIDE_VERSION_ID
51+
return "latest"
4852
case BuildScenario.PATCH:
4953
patch_id = get_version_id()
5054
if not patch_id:

scripts/release/constants.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,37 @@ def get_initial_commit_sha() -> str | None:
1717

1818

1919
def triggered_by_git_tag() -> str | None:
20+
"""
21+
"triggered_by_git_tag" is the name of the tag that triggered this version, if applicable. It will be None for
22+
all patches except when tagging a commit on GitHub
23+
:return: tag name if the build was triggered by a git tag, otherwise None.
24+
"""
2025
return os.getenv("triggered_by_git_tag")
2126

2227

2328
def is_evg_patch() -> bool:
29+
"""
30+
A patch build is a version not triggered by a commit to a repository. "is_patch" is passed automatically by Evergreen.
31+
It either runs tasks on a base commit plus some diff if submitted by the CLI or on a git branch if created by
32+
a GitHub pull request.
33+
:return: "true" if the running task is in a patch build, otherwise "false".
34+
"""
2435
return os.getenv("is_patch", "false").lower() == "true"
2536

2637

2738
def is_running_in_evg() -> bool:
39+
"""
40+
"RUNNING_IN_EVG" is set by us in evg-private-context
41+
:return: "true" if the script is running in Evergreen, otherwise "false".
42+
"""
2843
return os.getenv("RUNNING_IN_EVG", "false").lower() == "true"
2944

3045

3146
def get_version_id() -> str | None:
3247
"""
3348
Get the version ID from the environment variable. This is typically used for patch builds in the Evergreen CI system.
49+
It is generated automatically for each task run. For example: `6899b7e35bfaee00077db986` for a manual/PR patch,
50+
or `mongodb_kubernetes_5c5a3accb47bb411682b8c67f225b61f7ad5a619` for a master merge
3451
:return: version_id (patch ID) or None if not set
3552
"""
3653
return os.getenv("version_id")

0 commit comments

Comments
 (0)