Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/get-server-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: get-maintenance-versions
uses: hazelcast/hazelcast/.github/actions/get-supported-maintenance-versions@master
- id: calculate-minimum-supported-version
run: echo "VERSION=$(echo '${{ steps.get-maintenance-versions.outputs.versions }}' | jq '.[0]')" >> ${GITHUB_OUTPUT}
- name: Checkout to scripts
uses: actions/checkout@v6
- name: Set server matrix
Expand All @@ -21,4 +25,5 @@ jobs:
echo "matrix=$(
python \
get_server_matrix.py \
--minimum-version ${{ steps.calculate-minimum-supported-version.outputs.VERSION }} \
)" >> ${GITHUB_OUTPUT}
17 changes: 12 additions & 5 deletions get_server_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
from util import (
MajorMinorVersionFilter,
ServerReleaseParser,
SupportedReleaseFilter,
get_latest_patch_releases,
ReleaseFilter,
Version
ReleaseFilter
)


Expand All @@ -17,13 +15,22 @@ def parse_args() -> argparse.Namespace:
description="Returns the server version matrix as a JSON array"
)

parser.add_argument(
"--minimum-version",
dest="minimum_version",
action="store",
type=str,
required=True,
help="Minimum server version",
)

return parser.parse_args()


if __name__ == "__main__":
args = parse_args()
unsupported_versions = []
filters: List[ReleaseFilter] = [MajorMinorVersionFilter((5, 2)), SupportedReleaseFilter(unsupported_versions)]
minimum_major_version, minimum_minor_version = map(int, args.minimum_version.split("."))
filters: List[ReleaseFilter] = [MajorMinorVersionFilter((minimum_major_version, minimum_minor_version))]
server_release_parser = ServerReleaseParser(filters)
releases = server_release_parser.get_all_releases()
latest_patch_releases = get_latest_patch_releases(releases)
Expand Down
7 changes: 3 additions & 4 deletions util.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
IMDG_CLIENTS = (
"https://raw.githubusercontent.com/hazelcast/rel-scripts/master/imdg-clients.txt"
)
IMDG_SERVERS = "https://raw.githubusercontent.com/hazelcast/rel-scripts/master/imdg-enterprise.txt"
HAZELCAST_SERVERS = "https://raw.githubusercontent.com/hazelcast/rel-scripts/master/hazelcast-enterprise.txt"

CLIENT_HEADER = "======= %s Client\n---\n(.*?)\n---\n==="
Expand Down Expand Up @@ -236,21 +235,21 @@ def parse_version_and_tag(release_info: str) -> Optional[Tuple[str, str]]:

class ServerReleaseParser(AbstractReleaseParser):
def get_source_urls(self) -> List[str]:
return [IMDG_SERVERS, HAZELCAST_SERVERS]
return [HAZELCAST_SERVERS]

def parse_raw_data(self, raw_data: str) -> List[Release]:
stable_match = re.search(CURRENT_STABLE_SERVER_PATTERN, raw_data)
if not stable_match:
raise ValueError(
"Cannot find a match on the server data "
"located at %s for the current stable version." % IMDG_SERVERS
"located at %s for the current stable version." % HAZELCAST_SERVERS
)

previous_match = re.search(PREVIOUS_STABLE_SERVER_PATTERN, raw_data)
if not previous_match:
raise ValueError(
"Cannot find a match on the server data "
"located at %s for the previous stable versions." % IMDG_SERVERS
"located at %s for the previous stable versions." % HAZELCAST_SERVERS
)

all_releases = []
Expand Down