diff --git a/.ci/pipelines/env_variables.sh b/.ci/pipelines/env_variables.sh index 3b8013395e..fe549b9808 100755 --- a/.ci/pipelines/env_variables.sh +++ b/.ci/pipelines/env_variables.sh @@ -131,7 +131,6 @@ AZURE_DB_CERTIFICATES_PATH="/tmp/secrets/azure-db-certificates.pem" JUNIT_RESULTS="junit-results.xml" -SLACK_DATA_ROUTER_WEBHOOK_URL=$(cat /tmp/secrets/SLACK_DATA_ROUTER_WEBHOOK_URL) REDIS_USERNAME=temp REDIS_USERNAME_ENCODED=$(printf "%s" $REDIS_USERNAME | base64 | tr -d '\n') REDIS_PASSWORD=test123 diff --git a/.ci/pipelines/jobs/auth-providers.sh b/.ci/pipelines/jobs/auth-providers.sh index 1bbeabe5da..31530c974c 100644 --- a/.ci/pipelines/jobs/auth-providers.sh +++ b/.ci/pipelines/jobs/auth-providers.sh @@ -14,7 +14,6 @@ source "$DIR"/lib/common.sh handle_auth_providers() { local retry_operator_installation="${1:-1}" common::oc_login - wait_for_cluster_ready configure_namespace "${OPERATOR_MANAGER}" install_rhdh_operator "${OPERATOR_MANAGER}" "$retry_operator_installation" wait_for_backstage_crd "default" diff --git a/.ci/pipelines/jobs/ocp-nightly.sh b/.ci/pipelines/jobs/ocp-nightly.sh index 070cdec402..b2a08bee4f 100644 --- a/.ci/pipelines/jobs/ocp-nightly.sh +++ b/.ci/pipelines/jobs/ocp-nightly.sh @@ -15,7 +15,6 @@ handle_ocp_nightly() { export NAME_SPACE_POSTGRES_DB="${NAME_SPACE_POSTGRES_DB:-postgress-external-db-nightly}" common::oc_login - wait_for_cluster_ready K8S_CLUSTER_ROUTER_BASE=$(oc get route console -n openshift-console -o=jsonpath='{.spec.host}' | sed 's/^[^.]*\.//') export K8S_CLUSTER_ROUTER_BASE diff --git a/.ci/pipelines/jobs/ocp-operator.sh b/.ci/pipelines/jobs/ocp-operator.sh index d9ca782aa9..bdd6f97ae4 100644 --- a/.ci/pipelines/jobs/ocp-operator.sh +++ b/.ci/pipelines/jobs/ocp-operator.sh @@ -45,8 +45,6 @@ initiate_operator_deployments() { initiate_operator_deployments_osd_gcp() { log::info "Initiating Operator-backed deployments on OSD-GCP (orchestrator disabled)" - prepare_operator - configure_namespace "${NAME_SPACE}" deploy_test_backstage_customization_provider "${NAME_SPACE}" local rhdh_base_url="https://backstage-${RELEASE_NAME}-${NAME_SPACE}.${K8S_CLUSTER_ROUTER_BASE}" @@ -100,7 +98,6 @@ handle_ocp_operator() { export NAME_SPACE_RUNTIME="${NAME_SPACE_RUNTIME:-showcase-runtime}" common::oc_login - wait_for_cluster_ready K8S_CLUSTER_ROUTER_BASE=$(oc get route console -n openshift-console -o=jsonpath='{.spec.host}' | sed 's/^[^.]*\.//') export K8S_CLUSTER_ROUTER_BASE diff --git a/.ci/pipelines/jobs/ocp-pull.sh b/.ci/pipelines/jobs/ocp-pull.sh index 4373fdb11a..57a5fa5462 100644 --- a/.ci/pipelines/jobs/ocp-pull.sh +++ b/.ci/pipelines/jobs/ocp-pull.sh @@ -14,8 +14,6 @@ handle_ocp_pull() { log::info "Configuring namespace: ${NAME_SPACE}" common::oc_login - wait_for_cluster_ready - log::info "OCP version: $(oc version)" K8S_CLUSTER_ROUTER_BASE=$(oc get route console -n openshift-console -o=jsonpath='{.spec.host}' | sed 's/^[^.]*\.//') export K8S_CLUSTER_ROUTER_BASE diff --git a/.ci/pipelines/jobs/upgrade.sh b/.ci/pipelines/jobs/upgrade.sh index 76f4e40dcf..026c869128 100644 --- a/.ci/pipelines/jobs/upgrade.sh +++ b/.ci/pipelines/jobs/upgrade.sh @@ -33,7 +33,6 @@ handle_ocp_helm_upgrade() { export TAG_NAME_BASE=$previous_release_version common::oc_login - wait_for_cluster_ready K8S_CLUSTER_ROUTER_BASE=$(oc get route console -n openshift-console -o=jsonpath='{.spec.host}' | sed 's/^[^.]*\.//') export K8S_CLUSTER_ROUTER_BASE diff --git a/.ci/pipelines/utils.sh b/.ci/pipelines/utils.sh index 7aad65cc31..399a4a6f8f 100755 --- a/.ci/pipelines/utils.sh +++ b/.ci/pipelines/utils.sh @@ -765,7 +765,7 @@ metadata: name: dynamic-plugins data: dynamic-plugins.yaml: |" > ${final_file} - yq '.global.dynamic' ${base_file} | sed -e 's/^/ /' >> ${final_file} + yq '.global.dynamic' ${base_file} | sed -e 's/^/ /' -e 's/{{ "{{" }}inherit{{ "}}" }}/{{inherit}}/g' >> ${final_file} } create_conditional_policies_operator() { @@ -1408,29 +1408,6 @@ force_delete_namespace() { log::success "Namespace '${project}' successfully deleted." } -# Wait for the cluster API server to be fully responsive after login. -# Clusters resuming from hibernation may accept login but have degraded API availability. -wait_for_cluster_ready() { - local max_attempts=${1:-20} - local wait_seconds=${2:-15} - - log::info "Checking cluster API server readiness..." - - for ((i = 1; i <= max_attempts; i++)); do - if oc get nodes &> /dev/null && oc get route console -n openshift-console &> /dev/null; then - log::success "Cluster API server is ready" - return 0 - fi - if [[ $i -lt $max_attempts ]]; then - log::warn "Cluster API not fully ready (attempt ${i}/${max_attempts}). Retrying in ${wait_seconds}s..." - sleep "$wait_seconds" - fi - done - - log::error "Cluster API server did not become ready after ${max_attempts} attempts ($((max_attempts * wait_seconds))s)" - return 1 -} - is_openshift() { oc get routes.route.openshift.io &> /dev/null || kubectl get routes.route.openshift.io &> /dev/null } diff --git a/.ci/pipelines/value_files/diff-values_showcase-rbac_AKS.yaml b/.ci/pipelines/value_files/diff-values_showcase-rbac_AKS.yaml index c56af19527..8e88328d4d 100644 --- a/.ci/pipelines/value_files/diff-values_showcase-rbac_AKS.yaml +++ b/.ci/pipelines/value_files/diff-values_showcase-rbac_AKS.yaml @@ -6,7 +6,31 @@ route: enabled: false global: dynamic: - plugins: [] + plugins: + # These plugins correspond to tests that are ignored in showcase-rbac-k8s project + # See e2e-tests/playwright.config.ts SHOWCASE_RBAC_K8S config + + # Tekton not in showcase-rbac-k8s testMatch + - package: ./dynamic-plugins/dist/backstage-community-plugin-tekton + disabled: true + + # Adoption Insights not in showcase-rbac-k8s testMatch + - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-adoption-insights + disabled: true + - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-adoption-insights-backend-dynamic + disabled: true + - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-analytics-module-adoption-insights-dynamic + disabled: true + + # Orchestrator tests ignored on showcase-rbac-k8s: e2e-tests/playwright/e2e/plugins/orchestrator/*.spec.ts + - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator:{{ "{{" }}inherit{{ "}}" }}' + disabled: true + - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-backend:{{ "{{" }}inherit{{ "}}" }}' + disabled: true + - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-scaffolder-backend-module-orchestrator:{{ "{{" }}inherit{{ "}}" }}' + disabled: true + - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-form-widgets:{{ "{{" }}inherit{{ "}}" }}' + disabled: true upstream: backstage: appConfig: diff --git a/.ci/pipelines/value_files/diff-values_showcase-rbac_EKS.yaml b/.ci/pipelines/value_files/diff-values_showcase-rbac_EKS.yaml index f8ae7eb0fb..445e37c084 100644 --- a/.ci/pipelines/value_files/diff-values_showcase-rbac_EKS.yaml +++ b/.ci/pipelines/value_files/diff-values_showcase-rbac_EKS.yaml @@ -6,7 +6,31 @@ route: enabled: false global: dynamic: - plugins: [] + plugins: + # These plugins correspond to tests that are ignored in showcase-rbac-k8s project + # See e2e-tests/playwright.config.ts SHOWCASE_RBAC_K8S config + + # Tekton not in showcase-rbac-k8s testMatch + - package: ./dynamic-plugins/dist/backstage-community-plugin-tekton + disabled: true + + # Adoption Insights not in showcase-rbac-k8s testMatch + - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-adoption-insights + disabled: true + - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-adoption-insights-backend-dynamic + disabled: true + - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-analytics-module-adoption-insights-dynamic + disabled: true + + # Orchestrator tests ignored on showcase-rbac-k8s: e2e-tests/playwright/e2e/plugins/orchestrator/*.spec.ts + - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator:{{ "{{" }}inherit{{ "}}" }}' + disabled: true + - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-backend:{{ "{{" }}inherit{{ "}}" }}' + disabled: true + - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-scaffolder-backend-module-orchestrator:{{ "{{" }}inherit{{ "}}" }}' + disabled: true + - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-form-widgets:{{ "{{" }}inherit{{ "}}" }}' + disabled: true upstream: backstage: appConfig: diff --git a/.ci/pipelines/value_files/diff-values_showcase-rbac_GKE.yaml b/.ci/pipelines/value_files/diff-values_showcase-rbac_GKE.yaml index 2c1eb9e2c9..31f7008b81 100644 --- a/.ci/pipelines/value_files/diff-values_showcase-rbac_GKE.yaml +++ b/.ci/pipelines/value_files/diff-values_showcase-rbac_GKE.yaml @@ -1,12 +1,40 @@ # This file is for GKE installation only. # It is applied by `helm upgrade` after the `values-showcase.yaml` is applied and only contains complementary differences for GKE. # Note, that it overwrites the whole key that is present in this file. -# e.g. global.dynamic.plugins key is completely overwritten by the content of this file. +# The only exception is global.dynamic.plugins, that gets merged with the base file. route: enabled: false global: dynamic: - plugins: [] + plugins: + # Disable plugins to save disk space on GKE + # These plugins correspond to tests that are ignored in showcase-rbac-k8s project + # See e2e-tests/playwright.config.ts SHOWCASE_RBAC_K8S config + + # Tekton - not installed on K8s clusters (AKS/EKS/GKE) + # Not in showcase-rbac-k8s testMatch + - package: ./dynamic-plugins/dist/backstage-community-plugin-tekton + disabled: true + + # Adoption Insights - large plugin (~300MB) causing disk space issues + # Not in showcase-rbac-k8s testMatch + - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-adoption-insights + disabled: true + - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-adoption-insights-backend-dynamic + disabled: true + - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-analytics-module-adoption-insights-dynamic + disabled: true + + # Orchestrator - large OCI plugins causing disk space issues + # Tests ignored on showcase-rbac-k8s: e2e-tests/playwright/e2e/plugins/orchestrator/*.spec.ts + - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator:{{ "{{" }}inherit{{ "}}" }}' + disabled: true + - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-backend:{{ "{{" }}inherit{{ "}}" }}' + disabled: true + - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-scaffolder-backend-module-orchestrator:{{ "{{" }}inherit{{ "}}" }}' + disabled: true + - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-form-widgets:{{ "{{" }}inherit{{ "}}" }}' + disabled: true upstream: backstage: appConfig: diff --git a/.ci/pipelines/value_files/diff-values_showcase-sanity-plugins.yaml b/.ci/pipelines/value_files/diff-values_showcase-sanity-plugins.yaml index 462056e26e..e6cb89a34f 100644 --- a/.ci/pipelines/value_files/diff-values_showcase-sanity-plugins.yaml +++ b/.ci/pipelines/value_files/diff-values_showcase-sanity-plugins.yaml @@ -4,13 +4,13 @@ global: # sanity check https://issues.redhat.com/browse/RHIDP-5301 - package: ./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-gitlab-org-dynamic disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-backstage-plugin-github-insights:bs_1.45.3__3.4.1!roadiehq-backstage-plugin-github-insights + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-backstage-plugin-github-insights:{{ "{{" }}inherit{{ "}}" }}' disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-backstage-plugin-security-insights:bs_1.45.3__3.3.1!roadiehq-backstage-plugin-security-insights + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-backstage-plugin-security-insights:{{ "{{" }}inherit{{ "}}" }}' disabled: false - package: ./dynamic-plugins/dist/backstage-plugin-scaffolder-backend-module-gitlab-dynamic disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/immobiliarelabs-backstage-plugin-gitlab:bs_1.45.3__6.13.0!immobiliarelabs-backstage-plugin-gitlab + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/immobiliarelabs-backstage-plugin-gitlab:{{ "{{" }}inherit{{ "}}" }}' disabled: false - package: ./dynamic-plugins/dist/roadiehq-backstage-plugin-argo-cd-backend-dynamic disabled: false @@ -35,15 +35,15 @@ global: - name: argoInstance1 url: "temp" token: "temp" - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-argocd:bs_1.45.3__2.4.0 + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-argocd:{{ "{{" }}inherit{{ "}}" }}' disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-scaffolder-backend-module-azure:bs_1.45.3__0.2.15!backstage-plugin-scaffolder-backend-module-azure + - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-scaffolder-backend-module-azure:bs_1.45.3__0.2.15 disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-azure-devops-backend:bs_1.45.3__0.23.0!backstage-community-plugin-azure-devops-backend + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-azure-devops-backend:{{ "{{" }}inherit{{ "}}" }}' disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-azure-devops:bs_1.45.3__0.23.0!backstage-community-plugin-azure-devops + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-azure-devops:{{ "{{" }}inherit{{ "}}" }}' disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-jenkins-backend:bs_1.45.3__0.22.0!backstage-community-plugin-jenkins-backend + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-jenkins-backend:{{ "{{" }}inherit{{ "}}" }}' disabled: false pluginConfig: jenkins: @@ -52,7 +52,7 @@ global: baseUrl: "temp" username: "temp" apiKey: "temp" - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-jenkins:bs_1.45.3__0.26.0!backstage-community-plugin-jenkins + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-jenkins:{{ "{{" }}inherit{{ "}}" }}' disabled: false - package: ./dynamic-plugins/dist/backstage-plugin-notifications disabled: false @@ -70,7 +70,7 @@ global: disabled: false - package: ./dynamic-plugins/dist/backstage-plugin-signals disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-sonarqube-backend:bs_1.45.3__0.15.0!backstage-community-plugin-sonarqube-backend + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-sonarqube-backend:{{ "{{" }}inherit{{ "}}" }}' disabled: false pluginConfig: sonarqube: @@ -79,7 +79,7 @@ global: instanceKey: "mySonarqube" baseUrl: "https://default-sonarqube.example.com" apiKey: "123456789abcdef0123456789abcedf012" - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-sonarqube:bs_1.45.3__0.21.0!backstage-community-plugin-sonarqube + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-sonarqube:{{ "{{" }}inherit{{ "}}" }}' disabled: false - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-dynamic-home-page disabled: false @@ -95,9 +95,9 @@ global: backstage.plugin-techdocs-module-addons-contrib: techdocsAddons: - importName: ReportIssue - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/pagerduty-backstage-plugin:bs_1.45.3__0.16.4!pagerduty-backstage-plugin + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/pagerduty-backstage-plugin:{{ "{{" }}inherit{{ "}}" }}' disabled: true - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/pagerduty-backstage-plugin-backend:bs_1.45.3__0.10.1!pagerduty-backstage-plugin-backend + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/pagerduty-backstage-plugin-backend:{{ "{{" }}inherit{{ "}}" }}' disabled: true pluginConfig: pagerDuty: @@ -106,13 +106,13 @@ global: clientId: "temp" clientSecret: "temp" subDomain: "temp" - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-scaffolder-backend-module-gerrit:bs_1.45.3__0.2.15!backstage-plugin-scaffolder-backend-module-gerrit + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-scaffolder-backend-module-gerrit:{{ "{{" }}inherit{{ "}}" }}' disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-scaffolder-backend-module-utils:bs_1.45.3__4.1.1!roadiehq-scaffolder-backend-module-utils + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-scaffolder-backend-module-utils:{{ "{{" }}inherit{{ "}}" }}' disabled: false - package: ./dynamic-plugins/dist/backstage-community-plugin-scaffolder-backend-module-kubernetes-dynamic disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-scaffolder-backend-module-quay:bs_1.45.3__2.14.0!backstage-community-plugin-scaffolder-backend-module-quay + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-scaffolder-backend-module-quay:{{ "{{" }}inherit{{ "}}" }}' disabled: false - package: ./dynamic-plugins/dist/backstage-community-plugin-scaffolder-backend-module-regex-dynamic disabled: false @@ -126,9 +126,9 @@ global: username: "temp" # The password to use for authentication. password: "temp" - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-scaffolder-backend-module-sonarqube:bs_1.45.3__2.11.0!backstage-community-plugin-scaffolder-backend-module-sonarqube + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-scaffolder-backend-module-sonarqube:{{ "{{" }}inherit{{ "}}" }}' disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-3scale-backend:bs_1.45.3__3.10.0!backstage-community-plugin-3scale-backend + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-3scale-backend:{{ "{{" }}inherit{{ "}}" }}' disabled: true pluginConfig: catalog: @@ -137,7 +137,7 @@ global: default: baseUrl: "temp" accessToken: "temp" - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-scaffolder-backend-module-bitbucket-cloud:bs_1.45.3__0.2.15!backstage-plugin-scaffolder-backend-module-bitbucket-cloud + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-scaffolder-backend-module-bitbucket-cloud:{{ "{{" }}inherit{{ "}}" }}' disabled: false pluginConfig: # https://backstage.io/docs/integrations/bitbucketCloud/discovery#configuration @@ -146,17 +146,17 @@ global: bitbucketCloud: default: # identifies your ingested dataset workspace: "temp" - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-dynatrace:bs_1.45.3__10.12.1!backstage-community-plugin-dynatrace + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-dynatrace:{{ "{{" }}inherit{{ "}}" }}' disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-backstage-plugin-jira:bs_1.45.3__2.14.0!roadiehq-backstage-plugin-jira + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-backstage-plugin-jira:{{ "{{" }}inherit{{ "}}" }}' disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-backstage-plugin-datadog:bs_1.45.3__2.6.0!roadiehq-backstage-plugin-datadog + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-backstage-plugin-datadog:{{ "{{" }}inherit{{ "}}" }}' disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-nexus-repository-manager:bs_1.45.3__1.19.3!backstage-community-plugin-nexus-repository-manager + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-nexus-repository-manager:{{ "{{" }}inherit{{ "}}" }}' disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-jfrog-artifactory:bs_1.45.3__1.24.0!backstage-community-plugin-jfrog-artifactory + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-jfrog-artifactory:{{ "{{" }}inherit{{ "}}" }}' disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-lighthouse:bs_1.45.3__0.16.0!backstage-community-plugin-lighthouse + - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-lighthouse:{{ "{{" }}inherit{{ "}}" }}' disabled: false - package: ./dynamic-plugins/dist/backstage-community-plugin-analytics-provider-segment disabled: false diff --git a/.ci/pipelines/value_files/diff-values_showcase_AKS.yaml b/.ci/pipelines/value_files/diff-values_showcase_AKS.yaml index 21b3f19a6a..f0bd5c1728 100644 --- a/.ci/pipelines/value_files/diff-values_showcase_AKS.yaml +++ b/.ci/pipelines/value_files/diff-values_showcase_AKS.yaml @@ -9,7 +9,12 @@ global: plugins: - package: ./dynamic-plugins/dist/backstage-community-plugin-catalog-backend-module-scaffolder-relation-processor-dynamic disabled: false - # Disable orchestrator plugins for AKS + + # Tekton not installed on K8s clusters + - package: ./dynamic-plugins/dist/backstage-community-plugin-tekton + disabled: true + + # Orchestrator tests ignored on showcase-k8s - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator:{{ "{{" }}inherit{{ "}}" }}' disabled: true - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-backend:{{ "{{" }}inherit{{ "}}" }}' diff --git a/.ci/pipelines/value_files/diff-values_showcase_EKS.yaml b/.ci/pipelines/value_files/diff-values_showcase_EKS.yaml index a1e8c6495b..a10ff6046c 100644 --- a/.ci/pipelines/value_files/diff-values_showcase_EKS.yaml +++ b/.ci/pipelines/value_files/diff-values_showcase_EKS.yaml @@ -11,7 +11,12 @@ global: plugins: - package: ./dynamic-plugins/dist/backstage-community-plugin-catalog-backend-module-scaffolder-relation-processor-dynamic disabled: false - # Disable orchestrator plugins for EKS + + # Tekton not installed on K8s clusters + - package: ./dynamic-plugins/dist/backstage-community-plugin-tekton + disabled: true + + # Orchestrator tests ignored on showcase-k8s - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator:{{ "{{" }}inherit{{ "}}" }}' disabled: true - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-backend:{{ "{{" }}inherit{{ "}}" }}' diff --git a/.ci/pipelines/value_files/diff-values_showcase_GKE.yaml b/.ci/pipelines/value_files/diff-values_showcase_GKE.yaml index 96a17c64dc..af5d7ea7bf 100644 --- a/.ci/pipelines/value_files/diff-values_showcase_GKE.yaml +++ b/.ci/pipelines/value_files/diff-values_showcase_GKE.yaml @@ -9,7 +9,7 @@ global: plugins: # Disable plugins to save disk space on GKE # These plugins correspond to tests that are ignored in showcase-k8s project - # See e2e-tests/playwright.config.ts lines 109-125 + # See e2e-tests/playwright.config.ts SHOWCASE_K8S config # Tekton - test ignored # Test file: e2e-tests/playwright/e2e/plugins/tekton/tekton.spec.ts @@ -23,16 +23,6 @@ global: - package: ./dynamic-plugins/dist/backstage-community-plugin-ocm disabled: true - # Dynamic Home Page - test ignored - # Test file: e2e-tests/playwright/e2e/dynamic-home-page-customization.spec.ts - - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-dynamic-home-page - disabled: true - - # Scorecard - test ignored - # Test file: e2e-tests/playwright/e2e/plugins/scorecard/scorecard.spec.ts - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-scorecard:bs_1.45.3__2.3.5 - disabled: true - # Adoption Insights - large plugin (~300MB) causing disk space issues # This plugin IS tested on showcase-k8s normally, but disabled on GKE to save disk space # Test skipped on GKE: e2e-tests/playwright/e2e/plugins/adoption-insights/adoption-insights.spec.ts diff --git a/.ci/pipelines/value_files/values_showcase.yaml b/.ci/pipelines/value_files/values_showcase.yaml index cee24f5a43..73c3def4df 100644 --- a/.ci/pipelines/value_files/values_showcase.yaml +++ b/.ci/pipelines/value_files/values_showcase.yaml @@ -125,7 +125,7 @@ global: disabled: false - package: ./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-dynamic disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-application-provider-test:bs_1.45.3__0.6.0!red-hat-developer-hub-backstage-plugin-application-provider-test + - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-application-provider-test:bs_1.45.3__0.6.0 pluginConfig: dynamicPlugins: frontend: @@ -138,7 +138,7 @@ global: importName: TestProviderOne - mountPoint: application/provider importName: TestProviderTwo - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-application-listener-test:bs_1.45.3__0.6.0!red-hat-developer-hub-backstage-plugin-application-listener-test + - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-application-listener-test:bs_1.45.3__0.6.0 pluginConfig: dynamicPlugins: frontend: @@ -234,7 +234,7 @@ global: - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-global-header disabled: false # Enable an extra header test plugin - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-global-header-test:bs_1.45.3__0.7.0!red-hat-developer-hub-backstage-plugin-global-header-test + - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-global-header-test:bs_1.45.3__0.7.0 pluginConfig: dynamicPlugins: frontend: diff --git a/e2e-tests/.gitignore b/e2e-tests/.gitignore index 8b26a2fa9d..00179375cd 100644 --- a/e2e-tests/.gitignore +++ b/e2e-tests/.gitignore @@ -69,6 +69,9 @@ site # e2e test results junit-results.xml +# Local e2e test run files +.local-test + # auth-providers local runs files **/app-config.test.yaml **/dynamic-plugins.test.yaml diff --git a/e2e-tests/playwright/e2e/audit-log/log-utils.ts b/e2e-tests/playwright/e2e/audit-log/log-utils.ts index 6f5bf73f1f..a01e3b06d8 100644 --- a/e2e-tests/playwright/e2e/audit-log/log-utils.ts +++ b/e2e-tests/playwright/e2e/audit-log/log-utils.ts @@ -7,6 +7,7 @@ import { type EventStatus, type EventSeverityLevel, } from "./logs"; +import { getBackstageDeploySelector } from "../../utils/helper"; export class LogUtils { /** @@ -187,11 +188,14 @@ export class LogUtils { maxRetries: number = 4, retryDelay: number = 2000, ): Promise { - const podSelector = - "app.kubernetes.io/component=backstage,app.kubernetes.io/name=developer-hub"; + const deploySelector = getBackstageDeploySelector(); const tailNumber = 100; - let grepCommand = `oc logs -l ${podSelector} --tail=${tailNumber} -c backstage-backend -n ${namespace}`; + // Resolve the deployment by its metadata labels, then fetch logs from it. + // This works for both Helm and Operator since both set app.kubernetes.io/name + // on the Deployment (with different values), even though pod labels differ. + const deployTarget = `$(oc get deploy -n ${namespace} -l ${deploySelector} -o name)`; + let grepCommand = `oc logs ${deployTarget} --tail=${tailNumber} -c backstage-backend -n ${namespace}`; for (const word of filterWords) { grepCommand += ` | grep '${word}'`; } diff --git a/e2e-tests/playwright/utils/constants.ts b/e2e-tests/playwright/utils/constants.ts index 8fa788450b..cd18582063 100644 --- a/e2e-tests/playwright/utils/constants.ts +++ b/e2e-tests/playwright/utils/constants.ts @@ -67,3 +67,16 @@ export type JobTypePattern = (typeof JOB_TYPE_PATTERNS)[keyof typeof JOB_TYPE_PATTERNS]; export type IsOpenShiftValue = (typeof IS_OPENSHIFT_VALUES)[keyof typeof IS_OPENSHIFT_VALUES]; + +/** + * Kubernetes deployment-level label selectors for backstage. + * Both Helm and Operator set `app.kubernetes.io/name` on Deployment metadata + * (but with different values). Use these to resolve the deployment, then + * target pods via `oc logs deployment/` or `listNamespacedDeployment`. + * + * @see https://github.com/redhat-developer/rhdh-operator/blob/main/pkg/utils/utils.go + */ +export const BACKSTAGE_DEPLOY_SELECTOR = { + HELM: "app.kubernetes.io/component=backstage,app.kubernetes.io/name=developer-hub", + OPERATOR: "app.kubernetes.io/name=backstage", +} as const; diff --git a/e2e-tests/playwright/utils/helper.ts b/e2e-tests/playwright/utils/helper.ts index 55668265cc..69e646f7e3 100644 --- a/e2e-tests/playwright/utils/helper.ts +++ b/e2e-tests/playwright/utils/helper.ts @@ -1,10 +1,11 @@ import { type Page, type Locator } from "@playwright/test"; import fs from "fs"; -import type { - JobNamePattern, - JobNameRegexPattern, - JobTypePattern, - IsOpenShiftValue, +import { + BACKSTAGE_DEPLOY_SELECTOR, + type JobNamePattern, + type JobNameRegexPattern, + type JobTypePattern, + type IsOpenShiftValue, } from "./constants"; export async function downloadAndReadFile( @@ -104,3 +105,26 @@ export function skipIfJobType(jobTypePattern: JobTypePattern): boolean { export function skipIfIsOpenShift(isOpenShiftValue: IsOpenShiftValue): boolean { return process.env.IS_OPENSHIFT === isOpenShiftValue; } + +/** + * Returns whether the current job is an Operator deployment. + */ +export function isOperatorDeployment(): boolean { + return process.env.JOB_NAME?.includes("operator") ?? false; +} + +/** + * Returns the deployment-level label selector for the backstage Deployment. + * Works with `oc get deploy -l` or `listNamespacedDeployment` to resolve the + * deployment, then target pods via `oc logs deployment/`. + * + * Generalizes the auth-providers pattern from rhdh-deployment.ts which queries + * deployments (not pods) by `app.kubernetes.io/name` + `app.kubernetes.io/instance`. + * + * @returns The appropriate deployment label selector string + */ +export function getBackstageDeploySelector(): string { + return isOperatorDeployment() + ? BACKSTAGE_DEPLOY_SELECTOR.OPERATOR + : BACKSTAGE_DEPLOY_SELECTOR.HELM; +} diff --git a/e2e-tests/playwright/utils/kube-client.ts b/e2e-tests/playwright/utils/kube-client.ts index 0cc8c2ab1d..b3f2b9ed47 100644 --- a/e2e-tests/playwright/utils/kube-client.ts +++ b/e2e-tests/playwright/utils/kube-client.ts @@ -622,8 +622,11 @@ export class KubeClient { checkInterval: number = 10000, // 10 seconds ) { const endTime = Date.now() + timeout; - const labelSelector = - "app.kubernetes.io/component=backstage,app.kubernetes.io/instance=rhdh,app.kubernetes.io/name=backstage"; + + const podSelector = await this.getDeploymentPodSelector( + deploymentName, + namespace, + ); while (Date.now() < endTime) { try { @@ -642,10 +645,10 @@ export class KubeClient { ); // Check for pod failure states when expecting replicas > 0 - if (expectedReplicas > 0) { + if (expectedReplicas > 0 && podSelector) { const podFailureReason = await this.checkPodFailureStates( namespace, - labelSelector, + podSelector, ); if (podFailureReason) { console.error( @@ -658,8 +661,8 @@ export class KubeClient { } } - // Log pod conditions using label selector - await this.logPodConditions(namespace, labelSelector); + // Log pod conditions using the deployment's pod selector + await this.logPodConditions(namespace, podSelector); // Check if the expected replicas match if (availableReplicas === expectedReplicas) { @@ -701,7 +704,7 @@ export class KubeClient { // Scale down deployment to 0 replicas console.log(`Scaling down deployment ${deploymentName} to 0 replicas.`); console.log(`Deployment: ${deploymentName}, Namespace: ${namespace}`); - await this.logPodConditions(namespace); + await this.logPodConditionsForDeployment(deploymentName, namespace); await this.scaleDeployment(deploymentName, namespace, 0); await this.waitForDeploymentReady(deploymentName, namespace, 0, 300000); // 5 minutes for scale down @@ -722,7 +725,7 @@ export class KubeClient { console.error( `Error during deployment restart: Deployment '${deploymentName}' in namespace '${namespace}': ${getKubeApiErrorMessage(error)}`, ); - await this.logPodConditions(namespace); + await this.logPodConditionsForDeployment(deploymentName, namespace); await this.logDeploymentEvents(deploymentName, namespace); throw new Error( `Failed to restart deployment '${deploymentName}' in namespace '${namespace}': ${getKubeApiErrorMessage(error)}`, @@ -730,11 +733,49 @@ export class KubeClient { } } - async logPodConditions(namespace: string, labelSelector?: string) { - const selector = - labelSelector || - "app.kubernetes.io/component=backstage,app.kubernetes.io/instance=rhdh,app.kubernetes.io/name=backstage"; + /** + * Resolves the pod label selector from a deployment's spec.selector.matchLabels. + */ + private async getDeploymentPodSelector( + deploymentName: string, + namespace: string, + ): Promise { + const response = await this.appsApi.readNamespacedDeployment( + deploymentName, + namespace, + ); + const matchLabels = response.body.spec?.selector?.matchLabels || {}; + const entries = Object.entries(matchLabels); + if (entries.length === 0) { + throw new Error( + `Deployment '${deploymentName}' in namespace '${namespace}' has no matchLabels in selector`, + ); + } + return entries.map(([k, v]) => `${k}=${v}`).join(","); + } + /** + * Logs pod conditions for pods belonging to a specific deployment. + * Resolves the pod selector from the deployment's matchLabels. + */ + async logPodConditionsForDeployment( + deploymentName: string, + namespace: string, + ) { + try { + const selector = await this.getDeploymentPodSelector( + deploymentName, + namespace, + ); + await this.logPodConditions(namespace, selector); + } catch (error) { + console.warn( + `Could not resolve pod selector for deployment '${deploymentName}': ${getKubeApiErrorMessage(error)}`, + ); + } + } + + async logPodConditions(namespace: string, labelSelector: string) { try { const response = await this.coreV1Api.listNamespacedPod( namespace, @@ -742,11 +783,11 @@ export class KubeClient { undefined, undefined, undefined, - selector, + labelSelector, ); if (response.body.items.length === 0) { - console.warn(`No pods found for selector: ${selector}`); + console.warn(`No pods found for selector: ${labelSelector}`); } for (const pod of response.body.items) { @@ -758,7 +799,7 @@ export class KubeClient { } } catch (error) { console.error( - `Error while retrieving pod conditions for selector '${selector}': ${getKubeApiErrorMessage(error)}`, + `Error while retrieving pod conditions for selector '${labelSelector}': ${getKubeApiErrorMessage(error)}`, ); } }