Skip to content

Commit 4813459

Browse files
committed
Merge remote-tracking branch 'origin/main' into rhidp-15075-cluster-free-e2e-harness
# Conflicts: # e2e-tests/package.json
2 parents 39ab02f + 5c9e678 commit 4813459

179 files changed

Lines changed: 12187 additions & 10927 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/images/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Base image from Microsoft Playwright
22
# Playwright v1.59.1-noble includes Node 24.14.1
3-
FROM mcr.microsoft.com/playwright:v1.60.0-noble@sha256:beddddcf96f19abec078cd2f3da676f40abd460e0e734ad5eed73627ce161d33
3+
FROM mcr.microsoft.com/playwright:v1.61.1-noble@sha256:824f1a789072e648c62541c2cfa4479c4061a290d5c27766d67dc1dcbc19b321
44

55
# Set environment variables for the container
66
ENV CI=1 \

.ci/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"prettier:fix": "npx prettier --write **/*.{sh,md,yaml,yml}"
1212
},
1313
"devDependencies": {
14-
"prettier": "3.8.3",
14+
"prettier": "3.8.4",
1515
"prettier-plugin-sh": "0.18.1",
1616
"shellcheck": "4.1.0"
1717
},

.ci/pipelines/jobs/ocp-nightly.sh

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -47,35 +47,17 @@ run_standard_deployment_tests() {
4747
}
4848

4949
run_runtime_config_change_tests() {
50-
# Deploy `showcase-runtime` to run tests that require configuration changes at runtime
51-
52-
# Create the namespace first (this will delete/recreate it)
53-
namespace::configure "${NAME_SPACE_RUNTIME}"
54-
55-
# Configure external PostgreSQL credentials and certificates for runtime namespace
56-
# This creates postgres-crt and postgres-cred secrets needed by values-showcase-postgres.yaml
57-
# IMPORTANT: Must be called AFTER namespace is created but BEFORE helm install
58-
configure_external_postgres_db "${NAME_SPACE_RUNTIME}"
59-
60-
# Deploy RHDH with Helm (skip namespace creation since we already did it)
61-
helm::uninstall "${NAME_SPACE_RUNTIME}" "${RELEASE_NAME}"
62-
oc apply -f "$DIR/resources/postgres-db/dynamic-plugins-root-PVC.yaml" -n "${NAME_SPACE_RUNTIME}"
63-
# shellcheck disable=SC2046
64-
helm upgrade -i "${RELEASE_NAME}" -n "${NAME_SPACE_RUNTIME}" \
65-
"${HELM_CHART_URL}" --version "${CHART_VERSION}" \
66-
-f "$DIR/resources/postgres-db/values-showcase-postgres.yaml" \
67-
--set global.clusterRouterBase="${K8S_CLUSTER_ROUTER_BASE}" \
68-
$(helm::get_image_params)
69-
70-
# Configure schema-mode environment (opt-in: tests skip if env not configured)
71-
if configure_schema_mode_runtime_env "${NAME_SPACE_RUNTIME}" "${RELEASE_NAME}" helm; then
72-
log::info "Schema-mode environment configured successfully; schema-mode tests will run"
73-
else
74-
log::warn "Schema-mode environment not configured; schema-mode tests will skip (this is expected if PostgreSQL is not available)"
75-
fi
76-
50+
# Runtime tests handle their own deployment via TypeScript (runtime-deploy.ts).
51+
# The first test file (config-map.spec.ts) calls ensureRuntimeDeployed() which:
52+
# - Creates the namespace
53+
# - Deploys RHDH with Helm + internal PostgreSQL sub-chart
54+
# - Configures schema-mode env vars for port-forwarding
55+
# Subsequent test files reuse the existing deployment (workers: 1).
56+
#
57+
# The CI wrapper only needs to set environment variables and invoke Playwright.
58+
59+
export INSTALL_METHOD="helm"
7760
local runtime_url="https://${RELEASE_NAME}-developer-hub-${NAME_SPACE_RUNTIME}.${K8S_CLUSTER_ROUTER_BASE}"
78-
# Run tests - allow failures since schema-mode tests are opt-in
7961
testing::run_tests "${RELEASE_NAME}" "${NAME_SPACE_RUNTIME}" "${PW_PROJECT_SHOWCASE_RUNTIME}" "${runtime_url}" || true
8062
}
8163

.ci/pipelines/jobs/ocp-operator.sh

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -68,48 +68,15 @@ initiate_operator_deployments_osd_gcp() {
6868
}
6969

7070
run_operator_runtime_config_change_tests() {
71-
# Deploy `showcase-runtime` to run tests that require configuration changes at runtime.
72-
# Uses enableLocalDb=false with external Crunchy PostgreSQL for both runtime and schema-mode tests.
73-
namespace::configure "${NAME_SPACE_RUNTIME}"
74-
71+
# Runtime tests handle their own deployment via TypeScript (runtime-deploy.ts).
72+
# The first test file (config-map.spec.ts) calls ensureRuntimeDeployed() which:
73+
# - Creates the namespace
74+
# - Deploys RHDH via the operator with internal PostgreSQL
75+
# - Configures schema-mode env vars for port-forwarding
76+
# Subsequent test files reuse the existing deployment (workers: 1).
77+
#
78+
# INSTALL_METHOD=operator is already exported in handle_ocp_operator().
7579
local runtime_url="https://backstage-${RELEASE_NAME}-${NAME_SPACE_RUNTIME}.${K8S_CLUSTER_ROUTER_BASE}"
76-
local postgres_ready
77-
postgres_ready=false
78-
79-
# Set up real external PostgreSQL (Crunchy) instead of placeholder secrets.
80-
# Creates postgres-cred and postgres-crt secrets in NAME_SPACE_RUNTIME.
81-
# IMPORTANT: Must be called AFTER namespace is created but BEFORE operator deployment.
82-
namespace::configure "${NAME_SPACE_POSTGRES_DB}"
83-
if configure_external_postgres_db "${NAME_SPACE_RUNTIME}"; then
84-
postgres_ready=true
85-
# Add RHDH_RUNTIME_URL to postgres-cred (rds-app-config.yaml references it for baseUrl).
86-
# configure_external_postgres_db creates postgres-cred with POSTGRES_* keys only.
87-
local runtime_url_b64
88-
runtime_url_b64=$(common::base64_encode "${runtime_url}")
89-
oc patch secret postgres-cred -n "${NAME_SPACE_RUNTIME}" \
90-
--type=json \
91-
-p "[{\"op\":\"add\",\"path\":\"/data/RHDH_RUNTIME_URL\",\"value\":\"${runtime_url_b64}\"}]"
92-
else
93-
log::warn "External PostgreSQL setup failed; falling back to placeholder secrets (schema-mode tests will skip)"
94-
create_postgres_cred_secret "${NAME_SPACE_RUNTIME}" "tmp" "tmp" "RHDH_RUNTIME_URL=${runtime_url}"
95-
oc apply -f "$DIR/resources/postgres-db/postgres-crt.yaml" -n "${NAME_SPACE_RUNTIME}"
96-
fi
97-
98-
config::create_app_config_map "$DIR/resources/postgres-db/rds-app-config.yaml" "${NAME_SPACE_RUNTIME}"
99-
config::create_dynamic_plugins_config "${DIR}/resources/postgres-db/values-showcase-postgres.yaml" "/tmp/configmap-dynamic-plugins-runtime.yaml"
100-
oc apply -f /tmp/configmap-dynamic-plugins-runtime.yaml -n "${NAME_SPACE_RUNTIME}"
101-
deploy_rhdh_operator "${NAME_SPACE_RUNTIME}" "${DIR}/resources/rhdh-operator/rhdh-start-runtime.yaml" "true"
102-
103-
# Configure schema-mode environment variables (opt-in: tests skip if not configured).
104-
# Only attempt if external PostgreSQL was set up successfully.
105-
if [[ "${postgres_ready}" == "true" ]]; then
106-
if configure_schema_mode_runtime_env "${NAME_SPACE_RUNTIME}" "${RELEASE_NAME}" operator; then
107-
log::info "Schema-mode environment configured successfully; schema-mode tests will run"
108-
else
109-
log::warn "Schema-mode environment not configured; schema-mode tests will skip (this is expected if PostgreSQL is not available)"
110-
fi
111-
fi
112-
11380
testing::run_tests "${RELEASE_NAME}" "${NAME_SPACE_RUNTIME}" "${PW_PROJECT_SHOWCASE_RUNTIME}" "${runtime_url}" || true
11481
}
11582

.ci/pipelines/lib/schema-mode-env.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ configure_schema_mode_runtime_env() {
2424
local forward_via_pod=0
2525
local rhdh_psql_svc_name="redhat-developer-hub-postgresql"
2626

27-
local -a helm_svc_candidates=(
27+
# Service candidates: Helm sub-chart pattern first, then operator pattern
28+
local -a svc_candidates=(
2829
"${release_name}-postgresql"
2930
"${rhdh_psql_svc_name}"
31+
"backstage-psql-${release_name}"
3032
)
3133
local hsvc
32-
for hsvc in "${helm_svc_candidates[@]}"; do
34+
for hsvc in "${svc_candidates[@]}"; do
3335
if oc get svc "${hsvc}" -n "${runtime_namespace}" &> /dev/null; then
3436
postgres_service="${hsvc}"
3537
forward_namespace="${runtime_namespace}"
@@ -38,9 +40,11 @@ configure_schema_mode_runtime_env() {
3840
done
3941

4042
if [[ -n "${postgres_service}" ]]; then
43+
# Secret candidates: Helm pattern first, then operator pattern
4144
local -a secret_candidates=(
4245
"${release_name}-postgresql"
4346
"${rhdh_psql_svc_name}"
47+
"backstage-psql-secret-${release_name}"
4448
"postgres-cred"
4549
)
4650
local sec
@@ -49,6 +53,9 @@ configure_schema_mode_runtime_env() {
4953
continue
5054
fi
5155
admin_password=$(oc get secret "${sec}" -n "${runtime_namespace}" -o jsonpath='{.data.postgres-password}' 2> /dev/null | base64 -d || true)
56+
if [[ -z "${admin_password}" ]]; then
57+
admin_password=$(oc get secret "${sec}" -n "${runtime_namespace}" -o jsonpath='{.data.POSTGRESQL_ADMIN_PASSWORD}' 2> /dev/null | base64 -d || true)
58+
fi
5259
if [[ -z "${admin_password}" ]]; then
5360
admin_password=$(oc get secret "${sec}" -n "${runtime_namespace}" -o jsonpath='{.data.POSTGRES_PASSWORD}' 2> /dev/null | base64 -d || true)
5461
fi

.ci/pipelines/resources/postgres-db/rds-app-config.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.ci/pipelines/resources/postgres-db/values-showcase-postgres.yaml

Lines changed: 0 additions & 90 deletions
This file was deleted.

.ci/pipelines/resources/rhdh-operator/rhdh-start-runtime.yaml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.ci/pipelines/utils.sh

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ configure_external_postgres_db() {
260260
fi
261261

262262
# Create postgres-crt secret for Backstage deployment (Helm/Operator)
263-
# This secret is referenced by rhdh-start-runtime.yaml and values-showcase-postgres.yaml
263+
# This secret is referenced by RBAC deployment values and operator CRs
264264
if ! oc create secret generic postgres-crt \
265265
--from-file=postgres-crt.pem=postgres-ca \
266266
--dry-run=client -o yaml | oc apply -f - --namespace="${project}"; then
@@ -433,7 +433,7 @@ cluster_setup_k8s_helm() {
433433
# Functions: base_deployment, rbac_deployment, initiate_deployments,
434434
# base_deployment_osd_gcp, rbac_deployment_osd_gcp, initiate_deployments_osd_gcp,
435435
# initiate_upgrade_base_deployments, initiate_upgrade_deployments,
436-
# initiate_runtime_deployment, initiate_sanity_plugin_checks_deployment,
436+
# initiate_sanity_plugin_checks_deployment,
437437
# apply_yaml_files, deploy_test_backstage_customization_provider,
438438
# deploy_redis_cache, configure_external_postgres_db
439439
# ==============================================================================
@@ -650,22 +650,6 @@ initiate_upgrade_deployments() {
650650
save_all_pod_logs "$namespace"
651651
}
652652

653-
initiate_runtime_deployment() {
654-
local release_name=$1
655-
local namespace=$2
656-
namespace::configure "${namespace}"
657-
helm::uninstall "${namespace}" "${release_name}"
658-
659-
oc apply -f "$DIR/resources/postgres-db/dynamic-plugins-root-PVC.yaml" -n "${namespace}"
660-
661-
# shellcheck disable=SC2046
662-
helm upgrade -i "${release_name}" -n "${namespace}" \
663-
"${HELM_CHART_URL}" --version "${CHART_VERSION}" \
664-
-f "$DIR/resources/postgres-db/values-showcase-postgres.yaml" \
665-
--set global.clusterRouterBase="${K8S_CLUSTER_ROUTER_BASE}" \
666-
$(helm::get_image_params)
667-
}
668-
669653
initiate_sanity_plugin_checks_deployment() {
670654
local release_name=$1
671655
local name_space_sanity_plugins_check=$2

0 commit comments

Comments
 (0)