diff --git a/.github/workflows/get-server-matrix.yaml b/.github/workflows/get-server-matrix.yaml index 5bc94c22..caceed68 100644 --- a/.github/workflows/get-server-matrix.yaml +++ b/.github/workflows/get-server-matrix.yaml @@ -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 @@ -21,4 +25,5 @@ jobs: echo "matrix=$( python \ get_server_matrix.py \ + --minimum-version ${{ steps.calculate-minimum-supported-version.outputs.VERSION }} \ )" >> ${GITHUB_OUTPUT} diff --git a/get_server_matrix.py b/get_server_matrix.py index f19e38ae..9439b0b8 100644 --- a/get_server_matrix.py +++ b/get_server_matrix.py @@ -5,10 +5,8 @@ from util import ( MajorMinorVersionFilter, ServerReleaseParser, - SupportedReleaseFilter, get_latest_patch_releases, - ReleaseFilter, - Version + ReleaseFilter ) @@ -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) diff --git a/util.py b/util.py index 120982c3..efbc308e 100644 --- a/util.py +++ b/util.py @@ -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===" @@ -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 = []