Skip to content

Commit 12ab98a

Browse files
committed
[7.17] Use major.minor-SNAPSHOT for STACK_VERSION
1 parent 16d57d2 commit 12ab98a

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

.ci/test-matrix.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
STACK_VERSION:
2-
- 7.x-SNAPSHOT
3-
- 8.0.0-SNAPSHOT
2+
- "7.17.0-SNAPSHOT"
3+
- "8.0.0-SNAPSHOT"
44

55
TEST_SUITE:
66
- platinum
@@ -20,13 +20,13 @@ PYTHON_CONNECTION_CLASS:
2020

2121
exclude:
2222
# TODO: Remove for 7.16 branch
23-
- STACK_VERSION: 8.0.0-SNAPSHOT
23+
- STACK_VERSION: "8.0.0-SNAPSHOT"
2424
PYTHON_VERSION: "3.4"
25-
- STACK_VERSION: 8.0.0-SNAPSHOT
25+
- STACK_VERSION: "8.0.0-SNAPSHOT"
2626
PYTHON_VERSION: "3.5"
27-
- STACK_VERSION: 8.0.0-SNAPSHOT
27+
- STACK_VERSION: "8.0.0-SNAPSHOT"
2828
PYTHON_VERSION: "3.6"
29-
- STACK_VERSION: 8.0.0-SNAPSHOT
29+
- STACK_VERSION: "8.0.0-SNAPSHOT"
3030
PYTHON_VERSION: "3.7"
31-
- STACK_VERSION: 8.0.0-SNAPSHOT
31+
- STACK_VERSION: "8.0.0-SNAPSHOT"
3232
PYTHON_VERSION: "3.8"

.github/workflows/unified-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
name: Assemble
1919
runs-on: ubuntu-latest
2020
env:
21-
STACK_VERSION: 7.17-SNAPSHOT
21+
STACK_VERSION: "7.17-SNAPSHOT"
2222
steps:
2323
- name: Checkout
2424
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)