From 171fd5150ab9985913fe36c6f4e95f2c95ff7589 Mon Sep 17 00:00:00 2001 From: Alejandro Gullon Date: Tue, 20 Jan 2026 12:51:06 +0100 Subject: [PATCH 1/7] update gitops version to latest available --- test/bin/common_versions.sh | 2 +- test/bin/pyutils/generate_common_versions.py | 28 +++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/test/bin/common_versions.sh b/test/bin/common_versions.sh index d22a0417ef..5ba70f8aaf 100644 --- a/test/bin/common_versions.sh +++ b/test/bin/common_versions.sh @@ -139,7 +139,7 @@ export CNCF_SONOBUOY_VERSION=v0.57.3 export CNCF_SYSTEMD_LOGS_VERSION=v0.4 # The current version of the microshift-gitops package. -export GITOPS_VERSION=1.16 +export GITOPS_VERSION=1.18 # The brew release versions needed for release regression testing BREW_Y0_RELEASE_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/4.${MINOR_VERSION}-zstream/${UNAME_M}/")" diff --git a/test/bin/pyutils/generate_common_versions.py b/test/bin/pyutils/generate_common_versions.py index a0accc1cea..73757ac211 100755 --- a/test/bin/pyutils/generate_common_versions.py +++ b/test/bin/pyutils/generate_common_versions.py @@ -24,9 +24,6 @@ # The version of systemd-logs image included in the sonobuoy release. CNCF_SYSTEMD_LOGS_VERSION = "v0.4" -# The current version of the microshift-gitops package. -GITOPS_VERSION = "1.16" - # Set the release type to ec, rc or zstream LATEST_RELEASE_TYPE = "ec" @@ -211,6 +208,26 @@ def get_release_version_string(repo, var_name): return None +def get_gitops_version(minor_version): + """ + Get the version of the microshift-gitops package. + Versions compatible with MicroShift: https://access.redhat.com/product-life-cycles?product=Red%20Hat%20OpenShift%20GitOps + """ + url = "https://access.redhat.com/product-life-cycles/api/v1/products" + params = {"name": "Red Hat OpenShift GitOps"} + try: + resp = requests.get(url, params=params, timeout=10) + resp.raise_for_status() + data = resp.json() + for version in data.get("data", [{}])[0].get("versions", []): + if version.get("openshift_compatibility") and f"4.{minor_version}" in version["openshift_compatibility"]: + return version.get("name", "") + except Exception as e: + import logging + logging.warning(f"Could not fetch GitOps version for OCP 4.{minor_version}: {e}") + return "" + + def generate_common_versions(minor_version): previous_minor_version = minor_version - 1 yminus2_minor_version = minor_version - 2 @@ -258,6 +275,10 @@ def generate_common_versions(minor_version): # The 'rhocp_minor_y2' should always be the y-2 minor version number. rhocp_minor_y2 = yminus2_minor_version + # The current version of the microshift-gitops package. + logging.info("Getting GITOPS_VERSION") + gitops_version = get_gitops_version(minor_version) + template_path = pathlib.Path(__file__).resolve().parent / '../../assets/common_versions.sh.template' with open(template_path, 'r') as f: @@ -276,6 +297,7 @@ def generate_common_versions(minor_version): rhocp_minor_y1=rhocp_minor_y1, rhocp_minor_y1_beta=rhocp_minor_y1_beta, rhocp_minor_y2=rhocp_minor_y2, + GITOPS_VERSION=gitops_version, CNCF_SONOBUOY_VERSION=CNCF_SONOBUOY_VERSION, CNCF_SYSTEMD_LOGS_VERSION=CNCF_SYSTEMD_LOGS_VERSION, GITOPS_VERSION=GITOPS_VERSION, From 7e0e71a567fc7fa8dcd611af08acac652d1ab8c4 Mon Sep 17 00:00:00 2001 From: Alejandro Gullon Date: Tue, 20 Jan 2026 12:51:44 +0100 Subject: [PATCH 2/7] update the gitops RF test to install app from the docs --- test/suites/gitops/gitops.robot | 17 ++++++---- test/suites/gitops/spring-petclinic-app.yaml | 35 ++++++++++++++++++++ test/suites/gitops/test-deployment.yaml | 19 ----------- 3 files changed, 45 insertions(+), 26 deletions(-) create mode 100644 test/suites/gitops/spring-petclinic-app.yaml delete mode 100644 test/suites/gitops/test-deployment.yaml diff --git a/test/suites/gitops/gitops.robot b/test/suites/gitops/gitops.robot index edd453e57f..40bc37fb67 100644 --- a/test/suites/gitops/gitops.robot +++ b/test/suites/gitops/gitops.robot @@ -3,8 +3,8 @@ Documentation MicroShift GitOps tests Resource ../../resources/microshift-process.resource -Suite Setup Setup Suite With Namespace -Suite Teardown Teardown Suite With Namespace +Suite Setup Setup Suite +Suite Teardown Teardown Suite *** Test Cases *** @@ -15,9 +15,12 @@ Verify GitOps Pods Start Correctly ... All Pods Should Be Running openshift-gitops Verify Workload Deployed Correctly - [Documentation] Deploys workload and waits for ready status + [Documentation] Deploys an application and waits for it to be Healthy + ... using the example from official docs: https://docs.redhat.com/en/documentation/red_hat_build_of_microshift/4.20/html/running_applications/microshift-gitops#microshift-gitops-adding-apps_microshift-gitops - VAR ${manifest_path}= ${CURDIR}/test-deployment.yaml - Oc Apply -f ${manifest_path} -n ${NAMESPACE} - Wait Until Keyword Succeeds 5min 10s - ... Named Deployment Should Be Available test-app + VAR ${manifest_path}= ${CURDIR}/spring-petclinic-app.yaml + Oc Apply -f ${manifest_path} + Wait Until Resource Exists applications openshift-gitops spring-petclinic + Oc Wait + ... -n openshift-gitops application spring-petclinic + ... --for=jsonpath='{.status.sync.status}'=Synced --timeout=300s diff --git a/test/suites/gitops/spring-petclinic-app.yaml b/test/suites/gitops/spring-petclinic-app.yaml new file mode 100644 index 0000000000..f00e491fc0 --- /dev/null +++ b/test/suites/gitops/spring-petclinic-app.yaml @@ -0,0 +1,35 @@ +kind: AppProject +apiVersion: argoproj.io/v1alpha1 +metadata: + name: default + namespace: openshift-gitops +spec: + clusterResourceWhitelist: + - group: '*' + kind: '*' + destinations: + - namespace: '*' + server: '*' + sourceRepos: + - '*' +--- +kind: Application +apiVersion: argoproj.io/v1alpha1 +metadata: + name: spring-petclinic + namespace: openshift-gitops +spec: + destination: + namespace: spring-petclinic + server: https://kubernetes.default.svc + project: default + source: + directory: + recurse: true + path: app + repoURL: https://github.com/siamaksade/openshift-gitops-getting-started + syncPolicy: + automated: {} + syncOptions: + - CreateNamespace=true + - ServerSideApply=true diff --git a/test/suites/gitops/test-deployment.yaml b/test/suites/gitops/test-deployment.yaml deleted file mode 100644 index 17c72fc397..0000000000 --- a/test/suites/gitops/test-deployment.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: test-app -spec: - replicas: 1 - selector: - matchLabels: - app: test-app - template: - metadata: - labels: - app: test-app - spec: - containers: - - name: test-app - image: registry.redhat.io/ubi8/httpd-24:latest - ports: - - containerPort: 8080 From 8d6eaa7bc331232c27ba68846a9985a41d6f9095 Mon Sep 17 00:00:00 2001 From: Alejandro Gullon Date: Tue, 20 Jan 2026 14:52:43 +0100 Subject: [PATCH 3/7] fix GITOPS_VERSION var --- test/bin/pyutils/generate_common_versions.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/bin/pyutils/generate_common_versions.py b/test/bin/pyutils/generate_common_versions.py index 73757ac211..40c74e9679 100755 --- a/test/bin/pyutils/generate_common_versions.py +++ b/test/bin/pyutils/generate_common_versions.py @@ -297,10 +297,9 @@ def generate_common_versions(minor_version): rhocp_minor_y1=rhocp_minor_y1, rhocp_minor_y1_beta=rhocp_minor_y1_beta, rhocp_minor_y2=rhocp_minor_y2, - GITOPS_VERSION=gitops_version, CNCF_SONOBUOY_VERSION=CNCF_SONOBUOY_VERSION, CNCF_SYSTEMD_LOGS_VERSION=CNCF_SYSTEMD_LOGS_VERSION, - GITOPS_VERSION=GITOPS_VERSION, + GITOPS_VERSION=gitops_version, LATEST_RELEASE_TYPE=LATEST_RELEASE_TYPE, ARCH=ARCH ) From b91a8abf350be140b089ac5bb8fd5a28210197dc Mon Sep 17 00:00:00 2001 From: Alejandro Gullon Date: Tue, 20 Jan 2026 16:17:35 +0100 Subject: [PATCH 4/7] improve gitops RF test --- test/suites/gitops/gitops.robot | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/test/suites/gitops/gitops.robot b/test/suites/gitops/gitops.robot index 40bc37fb67..6c2ef14fce 100644 --- a/test/suites/gitops/gitops.robot +++ b/test/suites/gitops/gitops.robot @@ -7,6 +7,13 @@ Suite Setup Setup Suite Suite Teardown Teardown Suite +*** Variables *** +${APPLICATION_MANIFEST_PATH} ${CURDIR}/spring-petclinic-app.yaml +${APPLICATION_NAMESPACE} spring-petclinic +${APPLICATION_NAME} spring-petclinic +${GITOPS_NAMESPACE} openshift-gitops + + *** Test Cases *** Verify GitOps Pods Start Correctly [Documentation] Waits for pods to enter a running state @@ -14,13 +21,28 @@ Verify GitOps Pods Start Correctly Wait Until Keyword Succeeds 2min 10s ... All Pods Should Be Running openshift-gitops -Verify Workload Deployed Correctly +Verify Application Deployed Correctly [Documentation] Deploys an application and waits for it to be Healthy ... using the example from official docs: https://docs.redhat.com/en/documentation/red_hat_build_of_microshift/4.20/html/running_applications/microshift-gitops#microshift-gitops-adding-apps_microshift-gitops + [Setup] Setup Application Deployment - VAR ${manifest_path}= ${CURDIR}/spring-petclinic-app.yaml - Oc Apply -f ${manifest_path} - Wait Until Resource Exists applications openshift-gitops spring-petclinic + Wait Until Resource Exists applications ${APPLICATION_NAME} ${GITOPS_NAMESPACE} timeout=120s Oc Wait - ... -n openshift-gitops application spring-petclinic + ... -n ${GITOPS_NAMESPACE} application ${APPLICATION_NAME} ... --for=jsonpath='{.status.sync.status}'=Synced --timeout=300s + Oc Wait + ... -n ${APPLICATION_NAMESPACE} pod --selector=app=${APPLICATION_NAME} + ... --for=condition=Ready --timeout=300s + + [Teardown] Teardown Application Deployment + + +*** Keywords *** +Setup Application Deployment + [Documentation] Setup the application deployment + Oc Apply -f ${APPLICATION_MANIFEST_PATH} + +Teardown Application Deployment + [Documentation] Teardown the application deployment + Oc Delete -f ${APPLICATION_MANIFEST_PATH} + Oc Delete ns ${APPLICATION_NAMESPACE} From e742b19d23b44e12f405ee9fe1dd661092995958 Mon Sep 17 00:00:00 2001 From: Alejandro Gullon Date: Tue, 20 Jan 2026 17:44:41 +0100 Subject: [PATCH 5/7] fix get_gitops_version() --- test/bin/common_versions.sh | 2 +- test/bin/pyutils/generate_common_versions.py | 26 ++++++++++++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/test/bin/common_versions.sh b/test/bin/common_versions.sh index 5ba70f8aaf..a72b204e16 100644 --- a/test/bin/common_versions.sh +++ b/test/bin/common_versions.sh @@ -139,7 +139,7 @@ export CNCF_SONOBUOY_VERSION=v0.57.3 export CNCF_SYSTEMD_LOGS_VERSION=v0.4 # The current version of the microshift-gitops package. -export GITOPS_VERSION=1.18 +export GITOPS_VERSION=1.19 # The brew release versions needed for release regression testing BREW_Y0_RELEASE_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/4.${MINOR_VERSION}-zstream/${UNAME_M}/")" diff --git a/test/bin/pyutils/generate_common_versions.py b/test/bin/pyutils/generate_common_versions.py index 40c74e9679..4473f50e57 100755 --- a/test/bin/pyutils/generate_common_versions.py +++ b/test/bin/pyutils/generate_common_versions.py @@ -10,6 +10,7 @@ import argparse import logging import pathlib +import time sys.path.append(str(pathlib.Path(__file__).resolve().parent / '../../../scripts/pyutils')) import gitutils # noqa: E402 @@ -215,17 +216,26 @@ def get_gitops_version(minor_version): """ url = "https://access.redhat.com/product-life-cycles/api/v1/products" params = {"name": "Red Hat OpenShift GitOps"} - try: - resp = requests.get(url, params=params, timeout=10) - resp.raise_for_status() - data = resp.json() + for attempt in range(1, 4): + try: + resp = requests.get(url, params=params, timeout=10) + resp.raise_for_status() + except Exception as e: + logging.warning(f"Attempt {attempt} failed with error: {e}. Retrying...") + time.sleep(2) + continue + break + + if attempt == 3: + logging.error(f"Failed to fetch data from {url} after 3 attempts") + return "" + data = resp.json() + while minor_version >= 18: for version in data.get("data", [{}])[0].get("versions", []): if version.get("openshift_compatibility") and f"4.{minor_version}" in version["openshift_compatibility"]: + logging.info(f"Latest GitOps version: {version.get('name', '')} which is compatible with OCP {version['openshift_compatibility']}") return version.get("name", "") - except Exception as e: - import logging - logging.warning(f"Could not fetch GitOps version for OCP 4.{minor_version}: {e}") - return "" + minor_version -= 1 def generate_common_versions(minor_version): From 91fbc9e22701ab7e0ce279119617230d0f3b4e04 Mon Sep 17 00:00:00 2001 From: Alejandro Gullon Date: Wed, 21 Jan 2026 09:49:28 +0100 Subject: [PATCH 6/7] Update common_versions.sh --- test/bin/common_versions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/bin/common_versions.sh b/test/bin/common_versions.sh index a72b204e16..c99978f85c 100644 --- a/test/bin/common_versions.sh +++ b/test/bin/common_versions.sh @@ -81,8 +81,8 @@ export FAKE_NEXT_MINOR_VERSION=$(( "${MINOR_VERSION}" + 1 )) # # For a release branch, the current release repository should come from the # official 'rhocp' stream. -CURRENT_RELEASE_REPO="" -CURRENT_RELEASE_VERSION="" +CURRENT_RELEASE_REPO="https://mirror.openshift.com/pub/openshift-v4/${UNAME_M}/microshift/ocp-dev-preview/latest-4.22/el9/os" +CURRENT_RELEASE_VERSION="$(get_vrel_from_beta "${CURRENT_RELEASE_REPO}")" export CURRENT_RELEASE_REPO export CURRENT_RELEASE_VERSION From f07be08058bd5c472c15615fc031fbc75c6a8f4e Mon Sep 17 00:00:00 2001 From: Alejandro Gullon Date: Thu, 22 Jan 2026 13:14:25 +0100 Subject: [PATCH 7/7] improve gitops check versions loop --- test/bin/pyutils/generate_common_versions.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/bin/pyutils/generate_common_versions.py b/test/bin/pyutils/generate_common_versions.py index 4473f50e57..3f96e05803 100755 --- a/test/bin/pyutils/generate_common_versions.py +++ b/test/bin/pyutils/generate_common_versions.py @@ -230,12 +230,14 @@ def get_gitops_version(minor_version): logging.error(f"Failed to fetch data from {url} after 3 attempts") return "" data = resp.json() - while minor_version >= 18: - for version in data.get("data", [{}])[0].get("versions", []): - if version.get("openshift_compatibility") and f"4.{minor_version}" in version["openshift_compatibility"]: - logging.info(f"Latest GitOps version: {version.get('name', '')} which is compatible with OCP {version['openshift_compatibility']}") - return version.get("name", "") - minor_version -= 1 + for current_microshift_minor_version in range(minor_version, minor_version - 4, -1): + for gitops_version_from_api_docs in data.get("data", [{}])[0].get("versions", []): + gitops_version_ocp_compatibility = gitops_version_from_api_docs.get("openshift_compatibility") + gitops_version_number = gitops_version_from_api_docs.get("name") + if f"4.{current_microshift_minor_version}" in gitops_version_ocp_compatibility: + logging.info(f"Latest GitOps version: {gitops_version_number} which is compatible with OCP {gitops_version_ocp_compatibility}") + return gitops_version_number + return "" def generate_common_versions(minor_version):