From 056f3532de8913d22104970fb21fde79d1bfa7fa Mon Sep 17 00:00:00 2001 From: Nathan Coleman Date: Tue, 18 Jul 2023 12:35:54 -0500 Subject: [PATCH 1/3] Remove mxschmitt/action-tmate from conformance testing workflows --- .github/workflows/conformance.yml | 18 +----------------- .github/workflows/conformance_with_build.yml | 18 +----------------- internal/testing/conformance/README.md | 4 ---- 3 files changed, 2 insertions(+), 38 deletions(-) diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 50c932708..5208031f7 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -4,18 +4,7 @@ on: schedule: - cron: '0 0 * * *' - workflow_dispatch: - inputs: - debug_enabled: - description: 'Start tmate session if any step fails' - required: false - type: boolean - default: false # GitHub parses this value to string, see https://github.com/actions/runner/issues/1483 - debug_timeout_minutes: - description: 'How many minutes should the tmate session close itself after?' - required: false - type: string # No support for numeric value - default: '10' + workflow_dispatch: {} env: GO_VERSION: "1.19" @@ -123,11 +112,6 @@ jobs: working-directory: "gateway-api/conformance" run: go test -v -timeout 10m ./ --gateway-class=consul-api-gateway - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 # TSCCR: no entry for repository "mxschmitt/action-tmate" - if: failure() && github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' - timeout-minutes: ${{ fromJSON(github.event.inputs.debug_timeout_minutes) }} - - name: Report Status if: always() && github.ref == 'refs/heads/main' uses: ravsamhq/notify-slack-action@v1 # TSCCR: no entry for repository "ravsamhq/notify-slack-action" diff --git a/.github/workflows/conformance_with_build.yml b/.github/workflows/conformance_with_build.yml index 9bb8af8d3..d57ebdf74 100644 --- a/.github/workflows/conformance_with_build.yml +++ b/.github/workflows/conformance_with_build.yml @@ -7,18 +7,7 @@ on: push: branches: ["conformance/*"] - workflow_dispatch: - inputs: - debug_enabled: - description: 'Start tmate session if any step fails' - required: false - type: boolean - default: false # GitHub parses this value to string, see https://github.com/actions/runner/issues/1483 - debug_timeout_minutes: - description: 'How many minutes should the tmate session close itself after?' - required: false - type: string # No support for numeric value - default: '10' + workflow_dispatch: {} env: GO_VERSION: "1.19" @@ -130,8 +119,3 @@ jobs: - name: Run tests working-directory: "gateway-api/conformance" run: go test -v -timeout 10m ./ --gateway-class=consul-api-gateway - - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 # TSCCR: no entry for repository "mxschmitt/action-tmate" - if: failure() && github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' - timeout-minutes: ${{ fromJSON(github.event.inputs.debug_timeout_minutes) }} diff --git a/internal/testing/conformance/README.md b/internal/testing/conformance/README.md index 8ab8abca6..cbac76a32 100644 --- a/internal/testing/conformance/README.md +++ b/internal/testing/conformance/README.md @@ -20,7 +20,3 @@ need for these patches. The conformance tests are run nightly in GitHub Actions using the workflow [here](/.github/workflows/conformance.yml). You may also run the workflow on demand from this repo's Actions tab, by following the `conformance/*` branch naming convention, or by adding the `pr/run-conformance` label to your pull request. - -## Tips - -- If you need shell access to debug any steps in the workflow, [mxschmitt/action-tmate](https://github.com/mxschmitt/action-tmate) can be added before/after any step. From d2d5248784d50d72b13cd4563f1ce1d4c4765512 Mon Sep 17 00:00:00 2001 From: Nathan Coleman Date: Tue, 18 Jul 2023 15:22:21 -0500 Subject: [PATCH 2/3] Remove workflow for preparing release We no longer use this due to permissions limitations on the token provided by Actions which does not have SSO enabled --- .github/workflows/prepare_release.yml | 131 -------------------------- 1 file changed, 131 deletions(-) delete mode 100644 .github/workflows/prepare_release.yml diff --git a/.github/workflows/prepare_release.yml b/.github/workflows/prepare_release.yml deleted file mode 100644 index 8218ce4bc..000000000 --- a/.github/workflows/prepare_release.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: prepare_release - -on: - workflow_dispatch: - inputs: - new-min-consul-version: - description: 'The new minimum version of Consul (no "v" prefix)' - required: true - type: string - new-min-consul-k8s-version: - description: 'The new minimum version of Consul K8s (no "v" prefix)' - required: true - type: string - -jobs: - update-versions: - runs-on: ubuntu-latest - env: - NEW_CONSUL_REQ: ${{ github.event.inputs.new-min-consul-version }} - NEW_CONSUL_K8S_REQ: ${{ github.event.inputs.new-min-consul-k8s-version }} - - permissions: - contents: write # for peter-evans/create-pull-request to create branch - pull-requests: write # for peter-evans/create-pull-request to create a PR - - steps: - - - name: Checkout consul-api-gateway - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - with: - fetch-depth: "0" - - - name: Set version being released - run: | - VERSION=$(make version) - echo "NEW_API_GATEWAY_VERSION<> $GITHUB_ENV - echo "$VERSION" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - - name: Update deployment.yaml - uses: jacobtomlinson/gha-find-replace@f485fdc3f67a6d87ae6e3d11e41f648c26d7aee3 # TSCCR: no entry for repository "jacobtomlinson/gha-find-replace" - with: - include: config/deployment/deployment.yaml - find: 'image: hashicorp/consul-api-gateway:[0-9\.]+' - replace: 'image: hashicorp/consul-api-gateway:${{ env.NEW_API_GATEWAY_VERSION }}' - - - name: Update example-setup.md - uses: jacobtomlinson/gha-find-replace@f485fdc3f67a6d87ae6e3d11e41f648c26d7aee3 # TSCCR: no entry for repository "jacobtomlinson/gha-find-replace" - with: - include: 'dev/docs/example-setup.md' - find: 'ref=v[0-9\.]+' - replace: 'ref=v${{ env.NEW_API_GATEWAY_VERSION }}' - - - name: Update supported-features.md - uses: jacobtomlinson/gha-find-replace@f485fdc3f67a6d87ae6e3d11e41f648c26d7aee3 # TSCCR: no entry for repository "jacobtomlinson/gha-find-replace" - with: - include: 'dev/docs/supported-features.md' - find: 'Consul API Gateway version: \*\*v[0-9\.]+\*\*' - replace: 'Consul API Gateway version: **v${{ env.NEW_API_GATEWAY_VERSION }}**' - - - name: Update README.md (Consul version) - uses: jacobtomlinson/gha-find-replace@f485fdc3f67a6d87ae6e3d11e41f648c26d7aee3 # TSCCR: no entry for repository "jacobtomlinson/gha-find-replace" - with: - include: 'README.md' - find: 'The installed version of Consul must be `v[0-9\.]+` or greater.' - replace: 'The installed version of Consul must be `v${{ env.NEW_CONSUL_REQ }}` or greater.' - - - name: Update README.md (Consul K8s version) - uses: jacobtomlinson/gha-find-replace@f485fdc3f67a6d87ae6e3d11e41f648c26d7aee3 # TSCCR: no entry for repository "jacobtomlinson/gha-find-replace" - with: - include: 'README.md' - find: 'The Consul Helm chart must be version `[0-9\.]+` or greater.' - replace: 'The Consul Helm chart must be version `${{ env.NEW_CONSUL_K8S_REQ }}` or greater.' - - - name: Setup Go - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 - with: - go-version: 1.19 - - - name: Regenerate golden files - run: make generate-golden-files - - - name: Get current date - id: get-current-date - run: echo "::set-output name=date::$(date +'%B %d, %Y')" - - - name: Generate changelog patch - id: generate-changelog-patch - run: | # Pass via environment variable to keep multiline in tact - export LAST_RELEASE_GIT_TAG=$(git tag --sort=committerdate | tail -1) - CHANGELOG_PATCH=$(make changelog) - echo "CHANGELOG_PATCH<> $GITHUB_ENV - echo "$CHANGELOG_PATCH" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - - name: Update CHANGELOG.md - uses: jacobtomlinson/gha-find-replace@f485fdc3f67a6d87ae6e3d11e41f648c26d7aee3 # TSCCR: no entry for repository "jacobtomlinson/gha-find-replace" - with: - include: 'CHANGELOG.md' - find: | - ## UNRELEASED - - replace: | - ## UNRELEASED - - ## ${{ env.NEW_API_GATEWAY_VERSION }} (${{ steps.get-current-date.outputs.date }}) - ${{ env.CHANGELOG_PATCH }} - regex: false - - - name: Create pull request - id: create-pr - uses: peter-evans/create-pull-request@5b4a9f6a9e2af26e5f02351490b90d01eb8ec1e5 # v5.0.0 - with: - body: | - Consul API Gateway version being released: `${{ env.NEW_API_GATEWAY_VERSION }}` - Now requires: - - consul: `${{ env.NEW_CONSUL_REQ }}` - - consul-k8s: `${{ env.NEW_CONSUL_K8S_REQ }}` - branch: 'v${{ env.NEW_API_GATEWAY_VERSION }}-release-prep' - commit-message: | - Prepare for release of v${{ env.NEW_API_GATEWAY_VERSION }} - Consul API Gateway version being released: `${{ env.NEW_API_GATEWAY_VERSION }}` - Now requires: - - consul: `${{ env.NEW_CONSUL_REQ }}` - - consul-k8s: `${{ env.NEW_CONSUL_K8S_REQ }}` - delete-branch: true - labels: 'pr/no-changelog' - title: 'Prepare for release of v${{ env.NEW_API_GATEWAY_VERSION }}' - - - name: Output link to PR - run: echo '[Resulting PR](${{ steps.create-pr.outputs.pull-request-url }})' >> $GITHUB_STEP_SUMMARY From 33700ba453d35cc8302df257f738045bddb9d302 Mon Sep 17 00:00:00 2001 From: Nathan Coleman Date: Tue, 18 Jul 2023 15:41:23 -0500 Subject: [PATCH 3/3] Replace ravsamhq/notify-slack-action w/ official Slack action --- .github/workflows/conformance.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 5208031f7..edbc103f6 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -112,16 +112,19 @@ jobs: working-directory: "gateway-api/conformance" run: go test -v -timeout 10m ./ --gateway-class=consul-api-gateway - - name: Report Status + - name: Report status if: always() && github.ref == 'refs/heads/main' - uses: ravsamhq/notify-slack-action@v1 # TSCCR: no entry for repository "ravsamhq/notify-slack-action" - with: - status: ${{ job.status }} - message_format: '{emoji} *{workflow}/${{ matrix.cluster-type }} - ${{ matrix.config.name }}* {status_message} in <{repo_url}|{repo}> on <{commit_url}|{commit_sha}>' - mention_groups: '!here' - mention_groups_when: 'failure,warnings' + uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0 env: + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} + with: + payload: | + { + "Message": "conformance/${{ matrix.cluster-type }} - ${{ matrix.config.name }} ${{ job.status }}", + "Repository": "", + "Commit": "${{ github.sha }}", + } - name: Tear down EKS cluster if: always() && matrix.cluster-type == 'eks'