forked from hazelcast/client-compatibility-suites
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_server_matrix.py
34 lines (27 loc) · 957 Bytes
/
get_server_matrix.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import argparse
import json
from typing import List
from util import (
MajorVersionFilter,
ServerReleaseParser,
SupportedReleaseFilter,
get_latest_patch_releases,
ReleaseFilter,
Version
)
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description="Returns the server version matrix as a JSON array"
)
return parser.parse_args()
if __name__ == "__main__":
args = parse_args()
unsupported_versions = [Version("5.0"), Version("5.1")]
filters: List[ReleaseFilter] = [MajorVersionFilter([5]), SupportedReleaseFilter(unsupported_versions)]
server_release_parser = ServerReleaseParser(filters)
releases = server_release_parser.get_all_releases()
latest_patch_releases = get_latest_patch_releases(releases)
latest_patch_release_strings = [
r.version.version_str for r in latest_patch_releases
]
print(json.dumps(latest_patch_release_strings))