From 64894c574dd45ad222fc53fdca5f62d622d1a864 Mon Sep 17 00:00:00 2001 From: Jan Macku Date: Fri, 20 Oct 2023 13:32:22 +0200 Subject: [PATCH 1/2] ci: enable source-git automation to validate reviews and ci results rhel-only Related: RHEL-1087 --- .github/pull-request-validator.yml | 4 ++++ .../source-git-automation-on-demand.yml | 14 ++++++++++---- .github/workflows/source-git-automation.yml | 18 +++++++++++++++++- 3 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 .github/pull-request-validator.yml diff --git a/.github/pull-request-validator.yml b/.github/pull-request-validator.yml new file mode 100644 index 0000000000..4bb5bbec12 --- /dev/null +++ b/.github/pull-request-validator.yml @@ -0,0 +1,4 @@ +labels: + missing-review: pr/needs-review + changes-requested: pr/changes-requested + missing-failing-ci: pr/needs-ci diff --git a/.github/workflows/source-git-automation-on-demand.yml b/.github/workflows/source-git-automation-on-demand.yml index 92a65c8cc7..e70ba4857a 100644 --- a/.github/workflows/source-git-automation-on-demand.yml +++ b/.github/workflows/source-git-automation-on-demand.yml @@ -73,7 +73,8 @@ jobs: with: pr-number: ${{ matrix.pr-number }} - - id: commit-linter + - if: ${{ !cancelled() }} + id: commit-linter name: Lint Commits uses: redhat-plumbers-in-action/advanced-commit-linter@v2 with: @@ -81,7 +82,8 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} # Validates tracker, changes tracker status, updates PR title - - id: tracker-validator + - if: ${{ !cancelled() }} + id: tracker-validator name: Validate Tracker uses: redhat-plumbers-in-action/tracker-validator@v1 with: @@ -95,5 +97,9 @@ jobs: jira-api-token: ${{ secrets.JIRA_API_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }} - # TODO: merge PR if all checks passed - # TODO: add comment to Tracker that PR was merged ... + - if: ${{ !cancelled() }} + name: Pull Request Validator + uses: redhat-plumbers-in-action/pull-request-validator@v1 + with: + pr-metadata: ${{ steps.metadata.outputs.metadata }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/source-git-automation.yml b/.github/workflows/source-git-automation.yml index 16c6f83d77..9faaaca099 100644 --- a/.github/workflows/source-git-automation.yml +++ b/.github/workflows/source-git-automation.yml @@ -47,7 +47,8 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} # Validates tracker, changes tracker status, updates PR title - tracker-validation: + tracker-validator: + if: ${{ !cancelled() }} needs: [ download-metadata, commit-linter ] runs-on: ubuntu-latest @@ -68,3 +69,18 @@ jobs: jira-instance: https://issues.redhat.com jira-api-token: ${{ secrets.JIRA_API_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }} + + pull-request-validator: + needs: [ download-metadata ] + runs-on: ubuntu-latest + + permissions: + checks: write + pull-requests: write + + steps: + - name: Pull Request Validator + uses: redhat-plumbers-in-action/pull-request-validator@v1 + with: + pr-metadata: ${{ needs.download-metadata.outputs.pr-metadata }} + token: ${{ secrets.GITHUB_TOKEN }} From e241a33f5bc628dbd900f97696fe8b267a1502d6 Mon Sep 17 00:00:00 2001 From: Jan Macku Date: Fri, 20 Oct 2023 13:33:38 +0200 Subject: [PATCH 2/2] ci: remove Mergify config - replaced by Pull Request Validator rhel-only Related: RHEL-1087 --- .mergify.yml | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 .mergify.yml diff --git a/.mergify.yml b/.mergify.yml deleted file mode 100644 index 624eb7291d..0000000000 --- a/.mergify.yml +++ /dev/null @@ -1,32 +0,0 @@ -# doc: https://docs.mergify.com ---- - -pull_request_rules: - - name: Add `needs-ci` label on CI fail - conditions: - - label!=ci-waived - - or: - # Unit tests - - -check-success=build (stream8, GCC) - - -check-success=build (stream8, GCC_ASAN) - # CentOS Stream CI - - -check-success=CentOS CI (CentOS Stream 8) - actions: - label: - add: - - needs-ci - - - name: Remove `needs-ci` label on CI success - conditions: - - or: - - label=ci-waived - - and: - # Unit tests - - check-success=build (stream8, GCC) - - check-success=build (stream8, GCC_ASAN) - # CentOS Stream CI - - check-success=CentOS CI (CentOS Stream 8) - actions: - label: - remove: - - needs-ci