From 8900de7a1b9513330e28c5493193ac55f74bdd86 Mon Sep 17 00:00:00 2001 From: Ionut Balutoiu Date: Tue, 22 Aug 2023 11:17:43 +0300 Subject: [PATCH 1/3] [integration-tests] Update `randomStringGenerator` bash function Some integration tests workflows failed with: ``` Error: Invalid format 'ORG_WEBHOOK_SECRET=***' ``` or ``` Error: Invalid format 'GARM_PASSWORD=***' ``` Workflow runs logs: * https://github.com/cloudbase/garm/actions/runs/5920389694/job/16051606203#step:7:26 * https://github.com/cloudbase/garm/actions/runs/5908193226/job/16027297143#step:7:26 This is a transient error, as it only happens sometimes. I suspect that sometimes there is some illegal sequence of characters in the random generated strings. Thus, the GitHub actions logic to parse the environment fails. This change removes the special characters that would have a special meaning in bash, from the `randomStringGenerator` function, in hopes to fix the transient issue. Signed-off-by: Ionut Balutoiu --- .github/workflows/integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 924ef3e8..9df7a729 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -31,7 +31,7 @@ jobs: - name: Generate secrets run: | function randomStringGenerator() { - tr -dc "a-zA-Z0-9@#$%^&*()_+?><~\`;'" <~;" Date: Tue, 22 Aug 2023 11:43:06 +0300 Subject: [PATCH 2/3] Silence `tr` stderr output This seems to be related to the distribution used by the GitHub `ubuntu-latest` runners, as I can't reproduce it locally on my Ubuntu 22.04 server. An useful discussion on this topic: https://stackoverflow.com/questions/48725875/is-there-a-workaround-for-this-broken-pipe-error Signed-off-by: Ionut Balutoiu --- .github/workflows/integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 9df7a729..3685bbd0 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -31,7 +31,7 @@ jobs: - name: Generate secrets run: | function randomStringGenerator() { - tr -dc "a-zA-Z0-9@#%^&*()_+?><~;" <~;" /dev/null | head -c 64 ; echo ''; } GARM_PASSWORD=$(randomStringGenerator) From 5ced5c4b1c7b03ff6c4d122959a6a6c0014f6fe6 Mon Sep 17 00:00:00 2001 From: Ionut Balutoiu Date: Tue, 22 Aug 2023 11:47:48 +0300 Subject: [PATCH 3/3] Fix spacing Remove extra spaces from the `integration-tests.yml` file. Signed-off-by: Ionut Balutoiu --- .github/workflows/integration-tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 3685bbd0..18d155a7 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -2,7 +2,7 @@ name: Integration Tests on: workflow_dispatch: {} schedule: - - cron: "0 0 * * *" + - cron: "0 0 * * *" jobs: integration-tests: @@ -38,14 +38,14 @@ jobs: REPO_WEBHOOK_SECRET=$(randomStringGenerator) ORG_WEBHOOK_SECRET=$(randomStringGenerator) - echo "::add-mask::$GARM_PASSWORD" - echo "::add-mask::$REPO_WEBHOOK_SECRET" - echo "::add-mask::$ORG_WEBHOOK_SECRET" + echo "::add-mask::$GARM_PASSWORD" + echo "::add-mask::$REPO_WEBHOOK_SECRET" + echo "::add-mask::$ORG_WEBHOOK_SECRET" echo "GARM_PASSWORD=$GARM_PASSWORD" >> $GITHUB_ENV echo "REPO_WEBHOOK_SECRET=$REPO_WEBHOOK_SECRET" >> $GITHUB_ENV echo "ORG_WEBHOOK_SECRET=$ORG_WEBHOOK_SECRET" >> $GITHUB_ENV - + - name: Set up ngrok id: ngrok uses: gabriel-samfira/ngrok-tunnel-action@v1.1 @@ -62,7 +62,7 @@ jobs: run: | set -o pipefail set -o errexit - go run ./test/integration/e2e.go 2>&1 | tee /artifacts-logs/e2e.log + go run ./test/integration/e2e.go 2>&1 | tee /artifacts-logs/e2e.log env: GARM_BASE_URL: ${{ steps.ngrok.outputs.tunnel-url }} GARM_USERNAME: admin