From e80f85468c619a3665f5b2e43b50cd8b0c54fc15 Mon Sep 17 00:00:00 2001 From: openshift-pipelines-bot Date: Tue, 26 Nov 2024 16:43:40 +0000 Subject: [PATCH] [bot] update konflux configuration --- .github/workflows/auto-merge.main.yaml | 39 ++ .github/workflows/auto-merge.next.yaml | 39 ++ .github/workflows/update-sources.main.yaml | 73 +++ .github/workflows/update-sources.next.yaml | 73 +++ .konflux/main/application.yaml | 8 + .konflux/main/component-controller.yaml | 18 + .konflux/main/component-watcher.yaml | 18 + .konflux/main/component-webhook.yaml | 18 + .konflux/main/image-controller.yaml | 15 + .konflux/main/image-watcher.yaml | 15 + .konflux/main/image-webhook.yaml | 15 + .konflux/main/tests-on-push.yaml | 25 + .konflux/main/tests.yaml | 25 + .konflux/next/application.yaml | 8 + .konflux/next/component-controller.yaml | 18 + .konflux/next/component-watcher.yaml | 18 + .konflux/next/component-webhook.yaml | 18 + .konflux/next/image-controller.yaml | 15 + .konflux/next/image-watcher.yaml | 15 + .konflux/next/image-webhook.yaml | 15 + .konflux/next/tests-on-push.yaml | 25 + .konflux/next/tests.yaml | 25 + .tekton/docker-build-ta.yaml | 497 ++++++++++++++++++ ...wnstream-main-controller-pull-request.yaml | 48 ++ .../pac-downstream-main-controller-push.yaml | 42 ++ ...-downstream-main-watcher-pull-request.yaml | 48 ++ .tekton/pac-downstream-main-watcher-push.yaml | 42 ++ ...-downstream-main-webhook-pull-request.yaml | 48 ++ .tekton/pac-downstream-main-webhook-push.yaml | 42 ++ 29 files changed, 1305 insertions(+) create mode 100644 .github/workflows/auto-merge.main.yaml create mode 100644 .github/workflows/auto-merge.next.yaml create mode 100644 .github/workflows/update-sources.main.yaml create mode 100644 .github/workflows/update-sources.next.yaml create mode 100644 .konflux/main/application.yaml create mode 100644 .konflux/main/component-controller.yaml create mode 100644 .konflux/main/component-watcher.yaml create mode 100644 .konflux/main/component-webhook.yaml create mode 100644 .konflux/main/image-controller.yaml create mode 100644 .konflux/main/image-watcher.yaml create mode 100644 .konflux/main/image-webhook.yaml create mode 100644 .konflux/main/tests-on-push.yaml create mode 100644 .konflux/main/tests.yaml create mode 100644 .konflux/next/application.yaml create mode 100644 .konflux/next/component-controller.yaml create mode 100644 .konflux/next/component-watcher.yaml create mode 100644 .konflux/next/component-webhook.yaml create mode 100644 .konflux/next/image-controller.yaml create mode 100644 .konflux/next/image-watcher.yaml create mode 100644 .konflux/next/image-webhook.yaml create mode 100644 .konflux/next/tests-on-push.yaml create mode 100644 .konflux/next/tests.yaml create mode 100644 .tekton/docker-build-ta.yaml create mode 100644 .tekton/pac-downstream-main-controller-pull-request.yaml create mode 100644 .tekton/pac-downstream-main-controller-push.yaml create mode 100644 .tekton/pac-downstream-main-watcher-pull-request.yaml create mode 100644 .tekton/pac-downstream-main-watcher-push.yaml create mode 100644 .tekton/pac-downstream-main-webhook-pull-request.yaml create mode 100644 .tekton/pac-downstream-main-webhook-push.yaml diff --git a/.github/workflows/auto-merge.main.yaml b/.github/workflows/auto-merge.main.yaml new file mode 100644 index 000000000..8eb95ae42 --- /dev/null +++ b/.github/workflows/auto-merge.main.yaml @@ -0,0 +1,39 @@ +name: auto-merge-main + +on: + workflow_dispatch: {} + schedule: + - cron: "*/30 * * * *" # At every 30 minutes + +jobs: + auto-approve: + runs-on: ubuntu-latest + if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere + permissions: + pull-requests: write + steps: + - name: Checkout the current repo + uses: actions/checkout@v4 + - name: auto-merge-update-references + run: | + gh auth status + git config user.name openshift-pipelines-bot + git config user.email pipelines-extcomm@redhat.com + # Approve and merge pull-request with no reviews + for p in $(gh pr list --search "author:app/red-hat-konflux head:konflux/references/main" --json "number" | jq ".[].number"); do + gh pr merge --rebase --delete-branch --auto $p + done + env: + GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }} + - name: auto-merge-upstream-main + run: | + gh auth status + git config user.name openshift-pipelines-bot + git config user.email pipelines-extcomm@redhat.com + # Approve and merge pull-request with no reviews + for p in $(gh pr list --search "head:actions/update/sources-main" --json "number" | jq ".[].number"); do + gh pr merge --rebase --delete-branch --auto $p + done + env: + GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }} + diff --git a/.github/workflows/auto-merge.next.yaml b/.github/workflows/auto-merge.next.yaml new file mode 100644 index 000000000..83cab7248 --- /dev/null +++ b/.github/workflows/auto-merge.next.yaml @@ -0,0 +1,39 @@ +name: auto-merge-next + +on: + workflow_dispatch: {} + schedule: + - cron: "*/30 * * * *" # At every 30 minutes + +jobs: + auto-approve: + runs-on: ubuntu-latest + if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere + permissions: + pull-requests: write + steps: + - name: Checkout the current repo + uses: actions/checkout@v4 + - name: auto-merge-update-references + run: | + gh auth status + git config user.name openshift-pipelines-bot + git config user.email pipelines-extcomm@redhat.com + # Approve and merge pull-request with no reviews + for p in $(gh pr list --search "author:app/red-hat-konflux head:konflux/references/next" --json "number" | jq ".[].number"); do + gh pr merge --rebase --delete-branch --auto $p + done + env: + GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }} + - name: auto-merge-upstream-next + run: | + gh auth status + git config user.name openshift-pipelines-bot + git config user.email pipelines-extcomm@redhat.com + # Approve and merge pull-request with no reviews + for p in $(gh pr list --search "head:actions/update/sources-next" --json "number" | jq ".[].number"); do + gh pr merge --rebase --delete-branch --auto $p + done + env: + GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }} + diff --git a/.github/workflows/update-sources.main.yaml b/.github/workflows/update-sources.main.yaml new file mode 100644 index 000000000..19ebf195e --- /dev/null +++ b/.github/workflows/update-sources.main.yaml @@ -0,0 +1,73 @@ +# Generated by openshift-pipelines/hack. DO NOT EDIT. +name: update-sources-main + +on: + workflow_dispatch: {} + schedule: + - cron: "30 */12 * * *" # At minute 30 past every 12th hour. + +jobs: + + update-sources: + runs-on: ubuntu-latest + if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout the current repo + uses: actions/checkout@v4 + with: + ref: main + + - name: Clone openshift-pipelines/pipelines-as-code + run: | + rm -fR upstream + git clone https://github.com/openshift-pipelines/pipelines-as-code upstream + pushd upstream + git checkout -B main origin/main + popd + + - name: Commit new changes + run: | + git config user.name openshift-pipelines-bot + git config user.email pipelines-extcomm@redhat.com + git checkout -b actions/update/sources-main + pushd upstream + OLD_COMMIT=$(cat ../head) + NEW_COMMIT=$(git rev-parse HEAD) + echo Previous commit: ${OLD_COMMIT} + git show --stat ${OLD_COMMIT} + echo New commit: ${NEW_COMMIT} + git show --stat ${NEW_COMMIT} + git diff --stat ${NEW_COMMIT}..${OLD_COMMIT} > /tmp/diff.txt + git rev-parse HEAD > ../head + popd + rm -rf upstream/.git + git add upstream head .konflux + + if [[ -z $(git status --porcelain --untracked-files=no) ]]; then + echo "No change, exiting" + exit 0 + fi + + git commit -F- < /tmp/diff.txt + git rev-parse HEAD > ../head + popd + rm -rf upstream/.git + git add upstream head .konflux + + if [[ -z $(git status --porcelain --untracked-files=no) ]]; then + echo "No change, exiting" + exit 0 + fi + + git commit -F- <