Skip to content

Commit bc5c881

Browse files
committed
[8.2] Use major.minor-SNAPSHOT for STACK_VERSION
1 parent 9e4ad2e commit bc5c881

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

.ci/test-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
STACK_VERSION:
2-
- 8.2.0-SNAPSHOT
2+
- "8.2.0-SNAPSHOT"
33

44
TEST_SUITE:
55
- platinum

.github/workflows/unified-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
name: Assemble
1818
runs-on: ubuntu-latest
1919
env:
20-
STACK_VERSION: 8.2.0-SNAPSHOT
20+
STACK_VERSION: "8.2-SNAPSHOT"
2121
steps:
2222
- name: Checkout
2323
uses: actions/checkout@v2

utils/bump-version.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,30 @@ def main():
5454
print(f"Couldn't match the given stack version {stack_version!r}")
5555
exit(1)
5656

57+
# Pad the version value with .0 until there
58+
# we have the major, minor, and patch.
59+
for _ in range(3):
60+
if len(python_version.split(".")) >= 3:
61+
break
62+
python_version += ".0"
63+
5764
find_and_replace(
5865
path=SOURCE_DIR / "elasticsearch/_version.py",
5966
pattern=r"__versionstr__ = \"[0-9]+[0-9\.]*[0-9](?:\+dev)?\"",
6067
replace=f'__versionstr__ = "{python_version}"',
6168
)
69+
70+
# These values should always be the 'major.minor-SNAPSHOT'
71+
major_minor_version = ".".join(python_version.split(".")[:2])
6272
find_and_replace(
6373
path=SOURCE_DIR / ".ci/test-matrix.yml",
64-
pattern=r"STACK_VERSION:\s+\- [0-9]+[0-9\.]*[0-9]-SNAPSHOT",
65-
replace=f"STACK_VERSION:\n - {stack_version}",
74+
pattern=r'STACK_VERSION:\s+\- "[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"',
75+
replace=f'STACK_VERSION:\n - "{major_minor_version}.0-SNAPSHOT"',
6676
)
6777
find_and_replace(
6878
path=SOURCE_DIR / ".github/workflows/unified-release.yml",
69-
pattern=r"stack_version: \['[0-9]+[0-9\.]*[0-9]-SNAPSHOT'\]",
70-
replace=f"stack_version: ['{stack_version}']",
79+
pattern=r'STACK_VERSION:\s+"[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"',
80+
replace=f'STACK_VERSION: "{major_minor_version}-SNAPSHOT"',
7181
)
7282

7383

0 commit comments

Comments
 (0)