From 645b18b9831a55eaca72e69ec38be70622196b15 Mon Sep 17 00:00:00 2001 From: Omar Al Jaljuli Date: Wed, 8 Jan 2025 16:56:15 +0400 Subject: [PATCH 1/5] chore(e2e): cleanup operator e2e script and config (#2131) --- .ibm/pipelines/jobs/operator.sh | 6 +----- .../cluster_role_binding/cluster-role-binding-ocm.yaml | 3 --- .ibm/pipelines/utils.sh | 6 ++++++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.ibm/pipelines/jobs/operator.sh b/.ibm/pipelines/jobs/operator.sh index 77fce1f0c5..5752b28e0a 100644 --- a/.ibm/pipelines/jobs/operator.sh +++ b/.ibm/pipelines/jobs/operator.sh @@ -56,15 +56,11 @@ initiate_operator_deployments() { handle_operator() { oc_login - API_SERVER_URL=$(oc whoami --show-server) - ENCODED_API_SERVER_URL=$(echo "${API_SERVER_URL}" | base64) - ENCODED_CLUSTER_NAME=$(echo "my-cluster" | base64) - export K8S_CLUSTER_ROUTER_BASE=$(oc get route console -n openshift-console -o=jsonpath='{.spec.host}' | sed 's/^[^.]*\.//') local url="https://backstage-${RELEASE_NAME}-${NAME_SPACE}.${K8S_CLUSTER_ROUTER_BASE}" local rbac_url="https://backstage-${RELEASE_NAME_RBAC}-${NAME_SPACE_RBAC}.${K8S_CLUSTER_ROUTER_BASE}" - cluster_setup + cluster_setup_operator initiate_operator_deployments check_and_test "${RELEASE_NAME}" "${NAME_SPACE}" "${url}" check_and_test "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC}" "${rbac_url}" diff --git a/.ibm/pipelines/resources/cluster_role_binding/cluster-role-binding-ocm.yaml b/.ibm/pipelines/resources/cluster_role_binding/cluster-role-binding-ocm.yaml index bca2481f39..5d03de760d 100644 --- a/.ibm/pipelines/resources/cluster_role_binding/cluster-role-binding-ocm.yaml +++ b/.ibm/pipelines/resources/cluster_role_binding/cluster-role-binding-ocm.yaml @@ -16,6 +16,3 @@ subjects: - kind: ServiceAccount name: rhdh-k8s-plugin namespace: showcase-operator-nightly - - kind: ServiceAccount - name: rhdh-k8s-plugin - namespace: showcase-op-rbac-nightly \ No newline at end of file diff --git a/.ibm/pipelines/utils.sh b/.ibm/pipelines/utils.sh index 3eb19640a5..8d8044f59d 100755 --- a/.ibm/pipelines/utils.sh +++ b/.ibm/pipelines/utils.sh @@ -679,6 +679,12 @@ cluster_setup() { add_helm_repos } +cluster_setup_operator() { + install_pipelines_operator + install_acm_operator + install_crunchy_postgres_operator +} + initiate_deployments() { configure_namespace ${NAME_SPACE} From 2686c24f1d5fedbece496919e123188ea86e880c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbyn=C4=9Bk=20Dr=C3=A1pela?= <61500440+zdrapela@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:57:50 +0100 Subject: [PATCH 2/5] chore(ci): fix droute error handling for nightly (#2152) * chore(ci): fix droute error handling for nightly * Test * Revert "Test" This reverts commit df9ff0f1190e109030ed7d72d05d719f1eec8a30. * Change logs * Only write out error on the last try --- .ibm/pipelines/utils.sh | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.ibm/pipelines/utils.sh b/.ibm/pipelines/utils.sh index 8d8044f59d..8ccc5cf4b3 100755 --- a/.ibm/pipelines/utils.sh +++ b/.ibm/pipelines/utils.sh @@ -107,33 +107,30 @@ droute_send() { local max_attempts=5 local wait_seconds=1 for ((i = 1; i <= max_attempts; i++)); do + echo "Attempt ${i} of ${max_attempts} to send test results through Data Router." if output=$(oc exec -n "${droute_project}" "${droute_pod_name}" -- /bin/bash -c " /tmp/droute-linux-amd64 send --metadata ${temp_droute}/${metadata_output} \ --url '${DATA_ROUTER_URL}' \ --username '${DATA_ROUTER_USERNAME}' \ --password '${DATA_ROUTER_PASSWORD}' \ --results '${temp_droute}/${JUNIT_RESULTS}' \ - --verbose" 2>&1) && - DATA_ROUTER_REQUEST_ID=$(echo "$output" | grep "request:" | awk '{print $2}') && - [ -n "$DATA_ROUTER_REQUEST_ID" ]; then - - echo "Test results successfully sent through Data Router." - echo "Request ID: $DATA_ROUTER_REQUEST_ID" - return 0 + --verbose" 2>&1); then + if DATA_ROUTER_REQUEST_ID=$(echo "$output" | grep "request:" | awk '{print $2}') && + [ -n "$DATA_ROUTER_REQUEST_ID" ]; then + echo "Test results successfully sent through Data Router." + echo "Request ID: $DATA_ROUTER_REQUEST_ID" + break + fi fi - if ((i <= max_attempts)); then - echo "Attempt ${i} of ${max_attempts}: Error sending test results through Data Router." - echo "Error details: $output" - sleep "${wait_seconds}" - else + if ((i == max_attempts)); then echo "Failed to send test results after ${max_attempts} attempts." - echo "Last error: $output" + echo "Last Data Router error details:" + echo "${output}" echo "Troubleshooting steps:" echo "1. Restart $droute_pod_name in $droute_project project/namespace" echo "2. Check the Data Router documentation: https://spaces.redhat.com/pages/viewpage.action?pageId=115488042" echo "3. Ask for help at Slack: #forum-dno-datarouter" - return 1 fi done From c69f73202cd694ede9e3dd99c59234fc1ee2328a Mon Sep 17 00:00:00 2001 From: Nick Boldt Date: Wed, 8 Jan 2025 18:08:41 -0400 Subject: [PATCH 3/5] chore(migrate) switch from janus-idp secrets and quay publishing paths to rhd and quay.io/rhdh-community (#2159) Signed-off-by: Nick Boldt --- .github/workflows/next-build-image.yaml | 4 ++-- .github/workflows/pr-build-image.yaml | 6 +++--- .github/workflows/update-backstage.yaml | 4 ++-- .github/workflows/versioned-build-image.yaml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/next-build-image.yaml b/.github/workflows/next-build-image.yaml index 723c64c663..5fc0691662 100644 --- a/.github/workflows/next-build-image.yaml +++ b/.github/workflows/next-build-image.yaml @@ -55,9 +55,9 @@ jobs: uses: ./.github/actions/docker-build with: registry: ${{ env.REGISTRY }} - username: ${{ vars.QUAY_USERNAME }} + username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_TOKEN }} - imageName: ${{ github.repository }} + imageName: rhdh-community/rhdh imageTags: | type=raw,value=next type=sha,prefix=next- diff --git a/.github/workflows/pr-build-image.yaml b/.github/workflows/pr-build-image.yaml index 788d2a47db..f3f2f03546 100644 --- a/.github/workflows/pr-build-image.yaml +++ b/.github/workflows/pr-build-image.yaml @@ -67,9 +67,9 @@ jobs: uses: ./.github/actions/docker-build with: registry: ${{ env.REGISTRY }} - username: ${{ vars.QUAY_USERNAME }} + username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_TOKEN }} - imageName: ${{ github.repository }} + imageName: rhdh-community/rhdh imageTags: | type=ref,prefix=pr-,event=pr type=ref,prefix=pr-,suffix=-${{ env.SHORT_SHA }},event=pr @@ -85,5 +85,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'The image is available at:\n* [`quay.io/${{ github.repository }}:pr-${{ github.event.number }}`](https://quay.io/${{ github.repository }}:pr-${{ github.event.number }}) or\n* [`quay.io/${{ github.repository }}:pr-${{ github.event.number }}-${{ env.SHORT_SHA }}`](https://quay.io/${{ github.repository }}:pr-${{ github.event.number }}-${{ env.SHORT_SHA }})' + body: 'The image is available at:\n* [`quay.io/rhdh-community/rhdh:pr-${{ github.event.number }}`](https://quay.io/rhdh-community/rhdh:pr-${{ github.event.number }}) or\n* [`quay.io/rhdh-community/rhdh:pr-${{ github.event.number }}-${{ env.SHORT_SHA }}`](https://quay.io/rhdh-community/rhdh:pr-${{ github.event.number }}-${{ env.SHORT_SHA }})' }) diff --git a/.github/workflows/update-backstage.yaml b/.github/workflows/update-backstage.yaml index 46dfa7afce..45348ed192 100644 --- a/.github/workflows/update-backstage.yaml +++ b/.github/workflows/update-backstage.yaml @@ -46,8 +46,8 @@ jobs: id: generate-token uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0 with: - app-id: ${{ vars.JANUS_IDP_GITHUB_APP_ID }} - private-key: ${{ secrets.JANUS_IDP_GITHUB_APP_PRIVATE_KEY }} + app-id: ${{ secrets.RHDH_GITHUB_APP_ID }} + private-key: ${{ secrets.RHDH_GITHUB_APP_PRIVATE_KEY }} - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 diff --git a/.github/workflows/versioned-build-image.yaml b/.github/workflows/versioned-build-image.yaml index 5045cd09db..0c570b136b 100644 --- a/.github/workflows/versioned-build-image.yaml +++ b/.github/workflows/versioned-build-image.yaml @@ -57,9 +57,9 @@ jobs: uses: ./.github/actions/docker-build with: registry: ${{ env.REGISTRY }} - username: ${{ vars.QUAY_USERNAME }} + username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_TOKEN }} - imageName: ${{ github.repository }} + imageName: rhdh-community/rhdh imageTags: | type=raw,value=latest,enable=${{ env.is_latest }} type=semver,pattern={{version}} From ebdd2242cb575fcff3d49c982ea062a035e46b66 Mon Sep 17 00:00:00 2001 From: Nick Boldt Date: Wed, 8 Jan 2025 22:14:56 -0400 Subject: [PATCH 4/5] chore: misc fixes as part of migration (RHIDP-1022) (#2160) Signed-off-by: Nick Boldt --- .github/actions/docker-build/action.yaml | 2 +- .github/workflows/next-build-image.yaml | 2 +- .github/workflows/pr-build-image.yaml | 4 ++-- .github/workflows/techdocs.yaml | 2 +- .github/workflows/update-backstage.yaml | 2 +- .github/workflows/versioned-build-image.yaml | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/actions/docker-build/action.yaml b/.github/actions/docker-build/action.yaml index 0297576773..93d7f662b2 100644 --- a/.github/actions/docker-build/action.yaml +++ b/.github/actions/docker-build/action.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 The Janus IDP Authors +# Copyright Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/next-build-image.yaml b/.github/workflows/next-build-image.yaml index 5fc0691662..2b53754dc0 100644 --- a/.github/workflows/next-build-image.yaml +++ b/.github/workflows/next-build-image.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 The Janus IDP Authors +# Copyright Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/pr-build-image.yaml b/.github/workflows/pr-build-image.yaml index f3f2f03546..44578c7c56 100644 --- a/.github/workflows/pr-build-image.yaml +++ b/.github/workflows/pr-build-image.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 The Janus IDP Authors +# Copyright Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ jobs: - name: Get the latest commits from base branch run: | - git remote add base-origin https://github.com/janus-idp/backstage-showcase || true + git remote add base-origin https://github.com/${{ github.repository }} || true git config user.name "${{ github.event.pull_request.user.login }}" git config user.email "${{ github.event.pull_request.user.email }}" echo "Updating PR with latest commits from ${{ github.event.pull_request.base.ref }} ..." diff --git a/.github/workflows/techdocs.yaml b/.github/workflows/techdocs.yaml index 2475cac993..736c328c2f 100644 --- a/.github/workflows/techdocs.yaml +++ b/.github/workflows/techdocs.yaml @@ -1,4 +1,4 @@ -# Copyright 2023-2024 The Janus IDP Authors +# Copyright Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/update-backstage.yaml b/.github/workflows/update-backstage.yaml index 45348ed192..d43364993f 100644 --- a/.github/workflows/update-backstage.yaml +++ b/.github/workflows/update-backstage.yaml @@ -1,4 +1,4 @@ -# Copyright 2024 The Janus IDP Authors +# Copyright Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/versioned-build-image.yaml b/.github/workflows/versioned-build-image.yaml index 0c570b136b..40067b49e6 100644 --- a/.github/workflows/versioned-build-image.yaml +++ b/.github/workflows/versioned-build-image.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 The Janus IDP Authors +# Copyright 2023-2025 The RHDH Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# on push of a tag, trigger a container build for that tag and push to http://quay.io/janus-idp/backstage-showcase +# on push of a tag, trigger a container build for that tag and push to http://quay.io/rhdh-community/rhdh name: Versioned on: From d1caf62474893790bcd6f03eaf3e8b99d7d70c94 Mon Sep 17 00:00:00 2001 From: Nick Boldt Date: Wed, 8 Jan 2025 22:16:16 -0400 Subject: [PATCH 5/5] chore: delete techdocs publishing job that hasn't worked in 9mo (#2161) Signed-off-by: Nick Boldt --- .github/workflows/techdocs.yaml | 80 --------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 .github/workflows/techdocs.yaml diff --git a/.github/workflows/techdocs.yaml b/.github/workflows/techdocs.yaml deleted file mode 100644 index 736c328c2f..0000000000 --- a/.github/workflows/techdocs.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright Red Hat, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: Publish TechDocs Site - -on: - push: - branches: - - main - paths: - - "docs/**" - - "mkdocs.yaml" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - publish-techdocs-site: - name: Publish techdocs site - runs-on: ubuntu-latest - - env: - TECHDOCS_S3_BUCKET_NAME: ${{ secrets.BUCKET_NAME }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: ${{ secrets.AWS_REGION }} - ENTITY_NAMESPACE: 'default' - ENTITY_KIND: 'Component' - ENTITY_NAME: 'backstage-showcase' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 - with: - node-version-file: '.nvmrc' - registry-url: 'https://registry.npmjs.org' - - - name: Setup local Turbo cache - uses: dtinth/setup-github-actions-caching-for-turbo@v1 - - - name: Install dependencies - uses: backstage/actions/yarn-install@25145dd4117d50e1da9330e9ed2893bc6b75373e # v0.6.15 - with: - cache-prefix: ${{ runner.os }}-v20 - - - name: Lint - run: | - yarn run prettier:check - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.9' - - - name: Install techdocs-cli - run: sudo npm install -g @techdocs/cli - - - name: Install mkdocs and mkdocs plugins - run: python -m pip install mkdocs-techdocs-core==1.* - - - name: Generate docs site - run: techdocs-cli generate --no-docker --verbose - - - name: Publish docs site - run: techdocs-cli publish --publisher-type awsS3 --storage-name $TECHDOCS_S3_BUCKET_NAME --entity $ENTITY_NAMESPACE/$ENTITY_KIND/$ENTITY_NAME