-
Notifications
You must be signed in to change notification settings - Fork 2.3k
INTEROP-9416: OPP Q3 Batch 2 - Step improvements + review finding fixes #83813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
2ef52bb
248c9c1
1135498
6d69f25
188e817
cdd8be6
80d939b
e5f28f3
4b2d6b5
c1438c2
5e29d38
a0b4e41
41de223
83e68d3
7958bf7
949918a
cfffdf8
c983bac
aa0f9f2
d1d5a4a
850c7f7
5fdc5f8
1b56bba
27b9e01
678a274
4b69011
1af6687
6cb76fd
fe72c79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| approvers: | ||
| - cspi-qe-ocp-lp | ||
| - dtthuynh | ||
| - vboulos | ||
| options: {} | ||
| reviewers: | ||
| - cspi-qe-ocp-lp | ||
| - dtthuynh | ||
| - vboulos |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # acm-tests-clc-smoke-ref<!-- omit from toc --> | ||
|
|
||
| ## Table of Contents<!-- omit from toc --> | ||
| - [Purpose](#purpose) | ||
| - [Process](#process) | ||
| - [Requirements](#requirements) | ||
| - [Infrastructure](#infrastructure) | ||
| - [Environment Variables](#environment-variables) | ||
|
|
||
| ## Purpose | ||
|
|
||
| Smoke-scoped variant of [acm-tests-clc-create](../clc-create/README.md) with a right-sized timeout and strict failure handling for OPP interop. | ||
|
|
||
| The full `acm-tests-clc-create` step already creates only 1 AWS managed cluster (~50 min actual runtime) but carries a 28800s (8h) timeout and suppresses failures with `|| :`. This step: | ||
| - Reduces the timeout to 5400s (90 min), giving ~80% headroom over the observed average. | ||
| - Propagates failures so downstream steps (`acm-fetch-managed-clusters`, `acm-opp-app`) fail fast instead of running against a missing cluster. | ||
|
|
||
| > **IMPORTANT** | ||
| > You must use the [acm-tests-clc-destroy-ref](../clc-destroy/README.md) as a post step when using this step. If you do not and succeed in running this step then you will leave clusters running on the ACM QE team's cloud. | ||
|
|
||
| ## Process | ||
|
|
||
| - Copies secret options file needed for test execution. | ||
| - Injects AWS credentials from the cluster profile into options.yaml. | ||
| - Sets dynamic variables based on the provisioned hub cluster. | ||
| - Runs `execute_clc_interop_commands.sh` which invokes Cypress with tag filter `@create+aws+-sno+-@clusterpool` (controlled by `TEST_STAGE=OCPInterop-create` inside the image). | ||
|
|
||
| ## Requirements | ||
|
|
||
| ### Infrastructure | ||
|
|
||
| - An existing OpenShift cluster to act as the target Hub. | ||
| - "advanced-cluster-management" operator installed (see [`install-operators`](../../../install-operators/README.md)). | ||
| - MCH custom resource installed (see [acm-mch step](../mch/README.md)). | ||
|
|
||
| ### Environment Variables | ||
|
|
||
| - Please see [acm-tests-clc-smoke-ref.yaml](acm-tests-clc-smoke-ref.yaml) env section. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #!/bin/bash | ||
| set -euxo pipefail; shopt -s inherit_errexit | ||
|
|
||
| typeset secretsDir="/tmp/secrets" | ||
| typeset optionFile="./options.yaml" | ||
| typeset awsCredFile="${CLUSTER_PROFILE_DIR}/.awscred" | ||
|
|
||
| if [[ "${SKIP_OCP_DEPLOY:-false}" == "true" ]]; then | ||
| cp "${secretsDir}/ci/kubeconfig" "${SHARED_DIR}/kubeconfig" | ||
| cp "${secretsDir}/ci/kubeadmin-password" "${SHARED_DIR}/kubeadmin-password" | ||
| fi | ||
|
|
||
| cp "${secretsDir}/clc-interop/secret-options-yaml" "${optionFile}" | ||
|
|
||
| if [[ -f "${awsCredFile}" ]]; then | ||
| typeset awsAccKeyID= | ||
| typeset awsAccKeyToken= | ||
|
|
||
| set +x | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win Document each tracing-disabled scope. Lines 19 and 45 disable tracing while the script processes AWS credentials and the kubeadmin password. Add a comment before each As per coding guidelines, “keep the tracing-disabled scope minimal, add clear comments when disabling tracing.” Proposed fix- set +x
+ # Disable tracing while AWS credentials are read and written into options.yaml.
+ set +x
...
-set +x
+# Disable tracing while the kubeadmin password is loaded and passed to CLC.
+set +xAlso applies to: 45-45 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| awsAccKeyID="$(sed -nE 's/^\s*aws_access_key_id\s*=\s*//p;T;q' "${awsCredFile}")" | ||
| awsAccKeyToken="$(sed -nE 's/^\s*aws_secret_access_key\s*=\s*//p;T;q' "${awsCredFile}")" | ||
|
|
||
| if [[ -z "${awsAccKeyID}" ]] || [[ -z "${awsAccKeyToken}" ]]; then | ||
| echo "ERROR: Failed to extract AWS credentials from ${awsCredFile}" 1>&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| yq -o json eval . "${optionFile}" | | ||
| jq -c \ | ||
| --arg awsAccKeyID "${awsAccKeyID}" \ | ||
| --rawfile awsAccKeyToken <(printf '%s' "${awsAccKeyToken}") \ | ||
| ' | ||
| .options.connections.apiKeys.aws|=( | ||
| .awsAccessKeyID=$awsAccKeyID | | ||
| .awsSecretAccessKeyID=($awsAccKeyToken | rtrimstr("\n")) | ||
| ) | ||
| ' | | ||
| yq -p json -o yaml eval . > "${optionFile}.tmp" | ||
| mv -f "${optionFile}.tmp" "${optionFile}" | ||
| set -x | ||
|
|
||
| unset awsAccKeyID awsAccKeyToken | ||
| fi | ||
|
|
||
| set +x | ||
| export CYPRESS_OPTIONS_HUB_PASSWORD= | ||
| CYPRESS_OPTIONS_HUB_PASSWORD="$(cat "${SHARED_DIR}/kubeadmin-password")" | ||
|
|
||
| typeset clcStatus=0 | ||
|
|
||
| CYPRESS_BASE_URL="$(oc whoami --show-console)" \ | ||
| CYPRESS_HUB_API_URL="$(oc whoami --show-server)" \ | ||
| CYPRESS_CLC_OCP_IMAGE_VERSION="$(cat "${secretsDir}/clc/ocp_image_version")" \ | ||
| CLOUD_PROVIDERS="$(cat "${secretsDir}/clc/ocp_cloud_providers")" \ | ||
| bash +x ./execute_clc_interop_commands.sh || clcStatus=$? | ||
| set -x | ||
|
|
||
| unset CYPRESS_OPTIONS_HUB_PASSWORD | ||
|
|
||
| cp -r reports "${ARTIFACT_DIR}/" | ||
| exit "${clcStatus}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "path": "acm/tests/clc-smoke/acm-tests-clc-smoke-ref.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "cspi-qe-ocp-lp", | ||
| "dtthuynh", | ||
| "vboulos" | ||
| ], | ||
| "reviewers": [ | ||
| "cspi-qe-ocp-lp", | ||
| "dtthuynh", | ||
| "vboulos" | ||
| ] | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Correct the best-effort behavior description.
The README says CLC failures make downstream steps fail fast. The ref sets
best_effort: trueand states that independent downstream validations continue. State that the script returns the CLC status for reporting, while CI can continue independent validations.🤖 Prompt for AI Agents