-
Notifications
You must be signed in to change notification settings - Fork 2.3k
ARO-HCP: add optional hypershift in-place upgrade E2E workflow #80778
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
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,8 @@ | ||
| approvers: | ||
| - aro-hcp-sl-approvers | ||
| - geoberle | ||
| - deads2k | ||
| reviewers: | ||
| - aro-hcp-sl-reviewers | ||
| - geoberle | ||
| - deads2k |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/bin/bash | ||
| set -o errexit | ||
| set -o nounset | ||
| set -o pipefail | ||
|
|
||
| ref="${GIT_REF:-${PULL_PULL_SHA:-}}" | ||
| if [[ -z "${ref}" ]]; then | ||
| echo "ERROR: PR head ref unknown; set GIT_REF or run on a presubmit with PULL_PULL_SHA" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Checking out PR head ${ref}" | ||
| git fetch --tags origin "${ref}" 2>/dev/null || git fetch origin "${ref}" | ||
| git fetch --unshallow origin 2>/dev/null || true | ||
| git checkout "${ref}" || { | ||
| echo "ERROR: failed to checkout ${ref}" | ||
| exit 1 | ||
| } | ||
| git rev-parse HEAD | ||
| echo "${ref}" > "${SHARED_DIR}/git-checkout-ref" | ||
| git rev-parse HEAD > "${SHARED_DIR}/git-checkout-sha" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "path": "aro-hcp/git/checkout-head/aro-hcp-git-checkout-head-ref.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "aro-hcp-sl-approvers", | ||
| "geoberle", | ||
| "deads2k" | ||
| ], | ||
| "reviewers": [ | ||
| "aro-hcp-sl-reviewers", | ||
| "geoberle", | ||
| "deads2k" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ref: | ||
| as: aro-hcp-git-checkout-head | ||
| from: aro-hcp-e2e-tools | ||
| commands: aro-hcp-git-checkout-head-commands.sh | ||
| grace_period: 15s | ||
| resources: | ||
| requests: | ||
| cpu: 100m | ||
| memory: 256Mi | ||
| env: | ||
| - name: GIT_REF | ||
| default: "" | ||
| documentation: |- | ||
| Override for the PR head. When empty, uses PULL_PULL_SHA from the Prow job. | ||
| documentation: |- | ||
| Checkout the PR head revision after baseline tests and before in-place operator upgrade. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| approvers: | ||
| - aro-hcp-sl-approvers | ||
| - geoberle | ||
| - deads2k | ||
| reviewers: | ||
| - aro-hcp-sl-reviewers | ||
| - geoberle | ||
| - deads2k |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| #!/bin/bash | ||
| set -o errexit | ||
| set -o nounset | ||
| set -o pipefail | ||
|
|
||
| ref="${GIT_REF:-main}" | ||
| if [[ -z "${GIT_REF:-}" ]]; then | ||
| echo "GIT_REF unset; using default ref=${ref}" | ||
| fi | ||
|
|
||
| echo "Checking out ${ref}" | ||
| git fetch --tags origin "${ref}" 2>/dev/null || git fetch origin "${ref}" | ||
| git fetch --unshallow origin 2>/dev/null || true | ||
| git checkout "${ref}" || { | ||
|
Comment on lines
+12
to
+14
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify this script advertises SHA support but currently hard-fails on fetch.
rg -n 'Git ref to checkout \(branch, tag, or SHA\)|git fetch --tags origin "\$\{ref\}"|git fetch origin "\$\{ref\}"|git checkout "\$\{ref\}"' \
ci-operator/step-registry/aro-hcp/git/checkout/aro-hcp-git-checkout-ref.yaml \
ci-operator/step-registry/aro-hcp/git/checkout/aro-hcp-git-checkout-commands.shRepository: openshift/release Length of output: 489 🏁 Script executed: cat -n ci-operator/step-registry/aro-hcp/git/checkout/aro-hcp-git-checkout-commands.shRepository: openshift/release Length of output: 721 🏁 Script executed: # Check for similar fetch patterns in step registry
rg 'git fetch.*\$\{ref\}.*\|\|' ci-operator/step-registry/ -A1 -B1
# Also check if there's any documentation about git fetch limitations with SHAs
rg 'SHA|commit.*hash|fetch.*tag' ci-operator/step-registry/aro-hcp/git/checkout/ -A2 -B2Repository: openshift/release Length of output: 2525 🏁 Script executed: # Check if these are the only two occurrences and examine the checkout-head variant
cat -n ci-operator/step-registry/aro-hcp/git/checkout-head/aro-hcp-git-checkout-head-commands.shRepository: openshift/release Length of output: 794 Fetch pattern hard-fails on SHA refs when remote rejects SHA-based fetches. The step documentation explicitly allows SHA refs ("Git ref to checkout (branch, tag, or SHA)"), but line 12 fails hard if the remote does not support fetching by SHA. With Make all fetch attempts best-effort, then explicitly verify the ref is locally resolvable: Suggested patch- git fetch --tags origin "${ref}" 2>/dev/null || git fetch origin "${ref}"
+ git fetch --tags origin 2>/dev/null || true
+ git fetch origin "${ref}" 2>/dev/null || true
+ git rev-parse --verify --quiet "${ref}^{commit}" >/dev/null || {
+ echo "ERROR: ref ${ref} is not available locally after fetch"
+ exit 1
+ }Note: The same pattern exists in 🤖 Prompt for AI Agents |
||
| echo "ERROR: failed to checkout ${ref}" | ||
| exit 1 | ||
| } | ||
| git rev-parse HEAD | ||
| echo "${ref}" > "${SHARED_DIR}/git-checkout-ref" | ||
| git rev-parse HEAD > "${SHARED_DIR}/git-checkout-sha" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "path": "aro-hcp/git/checkout/aro-hcp-git-checkout-ref.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "aro-hcp-sl-approvers", | ||
| "geoberle", | ||
| "deads2k" | ||
| ], | ||
| "reviewers": [ | ||
| "aro-hcp-sl-reviewers", | ||
| "geoberle", | ||
| "deads2k" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| ref: | ||
| as: aro-hcp-git-checkout | ||
| from: aro-hcp-e2e-tools | ||
| commands: aro-hcp-git-checkout-commands.sh | ||
| grace_period: 15s | ||
| resources: | ||
| requests: | ||
| cpu: 100m | ||
| memory: 256Mi | ||
| env: | ||
| - name: GIT_REF | ||
| default: "main" | ||
| documentation: |- | ||
| Git ref to checkout (branch, tag, or SHA). Defaults to main for the base | ||
| provision phase. Override via job env when a different base ref is needed. | ||
| documentation: |- | ||
| Fetch and checkout the base git ref before regional provision. Defaults to main | ||
| so infrastructure is bootstrapped from the stable branch; later steps checkout | ||
| the PR head for upgrade validation. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| approvers: | ||
| - geoberle | ||
| - mmazur | ||
| - roivaz | ||
| - venkateshsredhat | ||
| - deads2k | ||
| reviewers: | ||
| - geoberle | ||
| - mmazur | ||
| - roivaz | ||
| - venkateshsredhat | ||
| - deads2k |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "path": "aro-hcp/local-e2e-upgrade/aro-hcp-local-e2e-upgrade-workflow.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "geoberle", | ||
| "mmazur", | ||
| "roivaz", | ||
| "venkateshsredhat", | ||
| "deads2k" | ||
| ], | ||
| "reviewers": [ | ||
| "geoberle", | ||
| "mmazur", | ||
| "roivaz", | ||
| "venkateshsredhat", | ||
| "deads2k" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| workflow: | ||
| as: aro-hcp-local-e2e-upgrade | ||
| steps: | ||
| allow_best_effort_post_steps: true | ||
| leases: | ||
| - env: LEASED_MSI_MOCK_SP | ||
| resource_type: aro-hcp-msi-mock-cs-sp-dev | ||
| pre: | ||
| - ref: aro-hcp-lease-acquire | ||
| - ref: aro-hcp-git-checkout | ||
| - ref: aro-hcp-write-config | ||
| - ref: aro-hcp-provision-environment | ||
| test: | ||
| - ref: aro-hcp-test-local-pre-upgrade | ||
| - ref: aro-hcp-git-checkout-head | ||
| - ref: aro-hcp-upgrade-infra | ||
| - ref: aro-hcp-test-local-post-upgrade | ||
| post: | ||
| - ref: aro-hcp-gather-provision-failure | ||
| - ref: aro-hcp-gather-visualization | ||
| - ref: aro-hcp-gather-test-visualization | ||
| - ref: aro-hcp-gather-custom-link-tools | ||
| - ref: aro-hcp-gather-observability | ||
| - ref: aro-hcp-gather-snapshot | ||
| - ref: aro-hcp-deprovision-environment | ||
| - ref: aro-hcp-lease-release | ||
| documentation: |- | ||
| Acquire runtime leases, checkout main (or GIT_REF override), provision regional infrastructure, run upgrade/create tests, checkout the PR head, | ||
| rerun pipeline/RP.HypershiftOperator using hypershift.image and hypershift.sharedIngressImage | ||
| digests from PR-head config/config.yaml, then run upgrade/post-infra tests. | ||
| Uses the dedicated aro-hcp-dev-upgrade-westus3-slot pool (Dev - 03, slot_count: 1) | ||
| so the provisioned cluster persists isolated across both upgrade suite phases. | ||
| Override GIT_REF on git-checkout steps via job env when needed. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| approvers: | ||
| - geoberle | ||
| - mmazur | ||
| - roivaz | ||
| - venkateshsredhat | ||
| - deads2k | ||
| reviewers: | ||
| - geoberle | ||
| - mmazur | ||
| - roivaz | ||
| - venkateshsredhat | ||
| - deads2k |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #!/bin/bash | ||
| set -o errexit | ||
| set -o nounset | ||
| set -o pipefail | ||
|
|
||
| : "${ARO_HCP_SUITE_NAME:?ARO_HCP_SUITE_NAME must be set}" | ||
|
|
||
| # Must match aro-hcp-test-local-pre-upgrade: post-infra loads cluster state via setup.go. | ||
| export SETUP_FILEPATH="${SETUP_FILEPATH:-${SHARED_DIR}/e2e-setup.json}" | ||
| if [[ ! -f "${SETUP_FILEPATH}" ]]; then | ||
| printf 'Missing e2e setup file: %s (upgrade/create must run in a prior step)\n' "${SETUP_FILEPATH}" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| env_file="${SHARED_DIR}/aro-hcp-slot.env" | ||
| if [[ ! -f "${env_file}" ]]; then | ||
| printf 'Missing runtime lease export file: %s\n' "${env_file}" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # shellcheck disable=SC1090 | ||
| source "${env_file}" | ||
|
|
||
| export LOCATION="${SELECTED_LOCATION:-${LOCATION:-}}" | ||
| : "${LOCATION:?LOCATION must be provided by SELECTED_LOCATION or the legacy runtime slot export file}" | ||
|
|
||
| export CLUSTER_PROFILE_DIR="/var/run/aro-hcp-${VAULT_SECRET_PROFILE}" | ||
|
|
||
| export AZURE_CLIENT_ID; AZURE_CLIENT_ID=$(cat "${CLUSTER_PROFILE_DIR}/client-id") | ||
| export AZURE_TENANT_ID; AZURE_TENANT_ID=$(cat "${CLUSTER_PROFILE_DIR}/tenant") | ||
| export AZURE_CLIENT_SECRET; AZURE_CLIENT_SECRET=$(cat "${CLUSTER_PROFILE_DIR}/client-secret") | ||
| export INFRA_SUBSCRIPTION_ID; INFRA_SUBSCRIPTION_ID=$(cat "${CLUSTER_PROFILE_DIR}/infra-${ARO_HCP_DEPLOY_ENV}-subscription-id") | ||
| export DEPLOY_ENV="${ARO_HCP_DEPLOY_ENV}" | ||
|
|
||
| az login --service-principal -u "${AZURE_CLIENT_ID}" -p "${AZURE_CLIENT_SECRET}" --tenant "${AZURE_TENANT_ID}" --output none | ||
|
|
||
| unset GOFLAGS | ||
|
|
||
| # This block prepares the environment to run the tests in. | ||
| # It runs against INFRA_SUBSCRIPTION. | ||
| az account set --subscription "${INFRA_SUBSCRIPTION_ID}" | ||
| make -C dev-infrastructure/ svc.aks.kubeconfig.pipeline SVC_KUBECONFIG_FILE=../kubeconfig DEPLOY_ENV="${DEPLOY_ENV}" | ||
| export KUBECONFIG=kubeconfig | ||
| export AZURE_TOKEN_CREDENTIALS=prod | ||
| FRONTEND_ADDRESS="https://$(kubectl get virtualservice -n aro-hcp aro-hcp-vs-frontend -o jsonpath='{.spec.hosts[0]}')" | ||
| make frontend-grant-ingress DEPLOY_ENV="${DEPLOY_ENV}" | ||
|
|
||
| # This block runs the tests against CUSTOMER_SUBSCRIPTION. | ||
| az account set --subscription "${CUSTOMER_SUBSCRIPTION}" | ||
| make e2e-local/setup FRONTEND_ADDRESS="${FRONTEND_ADDRESS}" | ||
|
|
||
| ./test/aro-hcp-tests run-suite "${ARO_HCP_SUITE_NAME}" \ | ||
| --junit-path="${ARTIFACT_DIR}/junit.xml" \ | ||
| --html-path="${ARTIFACT_DIR}/extension-test-result-summary.html" \ | ||
| --max-concurrency 100 | ||
|
|
||
| junit_shared_name="${E2E_JUNIT_SHARED_NAME:-junit-e2e-suite.xml.gz}" | ||
| gzip -c "${ARTIFACT_DIR}/junit.xml" > "${SHARED_DIR}/${junit_shared_name}" |
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.
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/release
Length of output: 269
🏁 Script executed:
Repository: openshift/release
Length of output: 794
🏁 Script executed:
Repository: openshift/release
Length of output: 267
🏁 Script executed:
Repository: openshift/release
Length of output: 471
🏁 Script executed:
Repository: openshift/release
Length of output: 43
🏁 Script executed:
Repository: openshift/release
Length of output: 353
🏁 Script executed:
Repository: openshift/release
Length of output: 1278
🏁 Script executed:
Repository: openshift/release
Length of output: 1640
🏁 Script executed:
Repository: openshift/release
Length of output: 3074
🏁 Script executed:
Repository: openshift/release
Length of output: 43
🏁 Script executed:
Repository: openshift/release
Length of output: 567
🏁 Script executed:
Repository: openshift/release
Length of output: 3076
🏁 Script executed:
# Look at the step reference file to understand environment setup cat ci-operator/step-registry/aro-hcp/git/checkout-head/aro-hcp-git-checkout-head-ref.yamlRepository: openshift/release
Length of output: 523
Soften git fetch for commit SHA refs to prevent presubmit failures.
When
PULL_PULL_SHAis used (standard for presubmits),${ref}is a commit SHA. Git cannot fetch raw commit SHAs directly—only branch/tag names. The hard-fail on line 13 will always fail for SHA refs and break the step, even though the commit is already available locally after clonerefs clones the PR. The fallback also fails for the same reason.Change line 13-14 to soft-fail all fetches and verify the ref exists locally before checkout:
Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents