Skip to content

Commit

Permalink
[7.17] Use major.minor-SNAPSHOT for STACK_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson committed Apr 14, 2022
1 parent 16d57d2 commit 12ab98a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
14 changes: 7 additions & 7 deletions .ci/test-matrix.yml
@@ -1,6 +1,6 @@
STACK_VERSION:
- 7.x-SNAPSHOT
- 8.0.0-SNAPSHOT
- "7.17.0-SNAPSHOT"
- "8.0.0-SNAPSHOT"

TEST_SUITE:
- platinum
Expand All @@ -20,13 +20,13 @@ PYTHON_CONNECTION_CLASS:

exclude:
# TODO: Remove for 7.16 branch
- STACK_VERSION: 8.0.0-SNAPSHOT
- STACK_VERSION: "8.0.0-SNAPSHOT"
PYTHON_VERSION: "3.4"
- STACK_VERSION: 8.0.0-SNAPSHOT
- STACK_VERSION: "8.0.0-SNAPSHOT"
PYTHON_VERSION: "3.5"
- STACK_VERSION: 8.0.0-SNAPSHOT
- STACK_VERSION: "8.0.0-SNAPSHOT"
PYTHON_VERSION: "3.6"
- STACK_VERSION: 8.0.0-SNAPSHOT
- STACK_VERSION: "8.0.0-SNAPSHOT"
PYTHON_VERSION: "3.7"
- STACK_VERSION: 8.0.0-SNAPSHOT
- STACK_VERSION: "8.0.0-SNAPSHOT"
PYTHON_VERSION: "3.8"
2 changes: 1 addition & 1 deletion .github/workflows/unified-release.yml
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Assemble
runs-on: ubuntu-latest
env:
STACK_VERSION: 7.17-SNAPSHOT
STACK_VERSION: "7.17-SNAPSHOT"
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
18 changes: 14 additions & 4 deletions utils/bump-version.py
Expand Up @@ -54,20 +54,30 @@ def main():
print(f"Couldn't match the given stack version {stack_version!r}")
exit(1)

# Pad the version value with .0 until there
# we have the major, minor, and patch.
for _ in range(3):
if len(python_version.split(".")) >= 3:
break
python_version += ".0"

find_and_replace(
path=SOURCE_DIR / "elasticsearch/_version.py",
pattern=r"__versionstr__ = \"[0-9]+[0-9\.]*[0-9](?:\+dev)?\"",
replace=f'__versionstr__ = "{python_version}"',
)

# These values should always be the 'major.minor-SNAPSHOT'
major_minor_version = ".".join(python_version.split(".")[:2])
find_and_replace(
path=SOURCE_DIR / ".ci/test-matrix.yml",
pattern=r"STACK_VERSION:\s+\- [0-9]+[0-9\.]*[0-9]-SNAPSHOT",
replace=f"STACK_VERSION:\n - {stack_version}",
pattern=r'STACK_VERSION:\s+\- "[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"',
replace=f'STACK_VERSION:\n - "{major_minor_version}.0-SNAPSHOT"',
)
find_and_replace(
path=SOURCE_DIR / ".github/workflows/unified-release.yml",
pattern=r"stack_version: \['[0-9]+[0-9\.]*[0-9]-SNAPSHOT'\]",
replace=f"stack_version: ['{stack_version}']",
pattern=r'STACK_VERSION:\s+"[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"',
replace=f'STACK_VERSION: "{major_minor_version}-SNAPSHOT"',
)


Expand Down

0 comments on commit 12ab98a

Please sign in to comment.