From b6ef62dd5e69c55a31312df8abc50fa683187392 Mon Sep 17 00:00:00 2001 From: J0zi Date: Fri, 11 Jun 2021 16:55:34 +0200 Subject: [PATCH 1/4] get actual labels Signed-off-by: J0zi --- .../operator_ci_installation_label.yaml | 39 ------------------ ...operator_test_report_openshift_status.yaml | 41 +++++++++++++++++++ 2 files changed, 41 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/operator_ci_installation_label.yaml diff --git a/.github/workflows/operator_ci_installation_label.yaml b/.github/workflows/operator_ci_installation_label.yaml deleted file mode 100644 index 9ad58406ce..0000000000 --- a/.github/workflows/operator_ci_installation_label.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: Installation final label -env: - OP_TEST_LABELS: "${{ join(github.event.pull_request.labels.*.name, ' ') }}" -on: - pull_request_target: -# pull_request: - types: [labeled] - -jobs: - installation-final-label: - runs-on: ubuntu-latest - steps: - - name: Detect installation failure - id: detect-failure - run: | - INSTALLATION_FAILED=0 - INSTALLATION_VALID=0 - VALID_INSTALLATIONS=0 - echo "Labels:" - echo "$OP_TEST_LABELS" - for label in $(echo $OP_TEST_LABELS); do [[ $label == installation-faile* ]] && INSTALLATION_FAILED=1; done - [[ $INSTALLATION_FAILED == '1' ]] && echo "::set-output name=installation-failed::$INSTALLATION_FAILED" - for label in $(echo $OP_TEST_LABELS); do [[ $label == installation-validated-* ]] && let "VALID_INSTALLATIONS=VALID_INSTALLATIONS+1"; done - [[ $VALID_INSTALLATIONS == '3' ]] && echo "::set-output name=installation-is-valid::1" && echo "Enough green installations - [OK]" - echo "VALID_INSTALLATIONS: $VALID_INSTALLATIONS" - - - name: Add installation final label - uses: actions/github-script@v3 - if: ( steps.detect-failure.outputs.installation-failed != '1' && steps.detect-failure.outputs.installation-is-valid == '1' ) - continue-on-error: true - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - github.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: [ 'installation-validated' ] - }) diff --git a/.github/workflows/operator_test_report_openshift_status.yaml b/.github/workflows/operator_test_report_openshift_status.yaml index 29ccf8f720..f2d0e00eb7 100644 --- a/.github/workflows/operator_test_report_openshift_status.yaml +++ b/.github/workflows/operator_test_report_openshift_status.yaml @@ -45,7 +45,48 @@ jobs: repo: context.repo.repo, labels: context.payload.client_payload.add_labels }) + + - uses: actions/github-script@v4 + id: labels + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const labels = await github.issues.listLabelsOnIssue({ + issue_number: context.payload.issue.number, + owner: context.repo.owner, + repo: context.repo.repo + }) + console.log(labels.data) + return labels.data + + - name: Add installation final label + uses: actions/github-script@v3 + if: | + (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.6')) && + (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.7')) && + (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.8')) && + (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.6')) && + (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.7')) && + (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.8')) + continue-on-error: true + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: [ 'installation-validated' ] + }) + - uses: actions/github-script@v3 + if: | + (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.6')) && + (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.7')) && + (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.8')) && + (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.6')) && + (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.7')) && + (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.8')) with: github-token: ${{ secrets.FRAMEWORK_MERGE }} script: | From 2367631a8025335f98d6b4d8cd7a7f411d1f9ab3 Mon Sep 17 00:00:00 2001 From: J0zi Date: Fri, 11 Jun 2021 16:57:20 +0200 Subject: [PATCH 2/4] test Signed-off-by: J0zi --- .github/workflows/operator_test_report_openshift_status.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/operator_test_report_openshift_status.yaml b/.github/workflows/operator_test_report_openshift_status.yaml index f2d0e00eb7..7b1beb79b5 100644 --- a/.github/workflows/operator_test_report_openshift_status.yaml +++ b/.github/workflows/operator_test_report_openshift_status.yaml @@ -100,3 +100,4 @@ jobs: }) } } + From 1d208172952344647ae80ba0c494aaef5a8012f3 Mon Sep 17 00:00:00 2001 From: J0zi Date: Fri, 11 Jun 2021 17:13:23 +0200 Subject: [PATCH 3/4] info Signed-off-by: J0zi --- scripts/ci/openshift-deploy-core.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ci/openshift-deploy-core.sh b/scripts/ci/openshift-deploy-core.sh index bfecc56c1a..d92adac6df 100755 --- a/scripts/ci/openshift-deploy-core.sh +++ b/scripts/ci/openshift-deploy-core.sh @@ -192,3 +192,5 @@ echo "OP_NAME=$OP_NAME" echo "OP_VER=$OP_VER" if [ $ANSIBLE_STATUS -gt 0 ]; then echo "Ansible failed, see output above"; exit 1; fi + +#remove special settings for 4.6 \ No newline at end of file From 102e22410a25fc75bc71640e1d14dc5ad3d3f340 Mon Sep 17 00:00:00 2001 From: J0zi Date: Mon, 14 Jun 2021 11:45:13 +0200 Subject: [PATCH 4/4] exchanging labels Signed-off-by: J0zi --- .../operator_test_report_openshift_status.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/operator_test_report_openshift_status.yaml b/.github/workflows/operator_test_report_openshift_status.yaml index 7b1beb79b5..a8df512477 100644 --- a/.github/workflows/operator_test_report_openshift_status.yaml +++ b/.github/workflows/operator_test_report_openshift_status.yaml @@ -62,10 +62,10 @@ jobs: - name: Add installation final label uses: actions/github-script@v3 if: | - (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.6')) && + (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed')) && (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.7')) && (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.8')) && - (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.6')) && + (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated')) && (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.7')) && (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.8')) continue-on-error: true @@ -76,15 +76,15 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - labels: [ 'installation-validated' ] + labels: [ 'installation-validated-4.6' ] }) - uses: actions/github-script@v3 if: | - (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.6')) && + (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed')) && (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.7')) && (!contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-failed-4.8')) && - (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.6')) && + (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated')) && (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.7')) && (contains(fromJSON(steps.labels.outputs.result).*.name, 'installation-validated-4.8')) with: