diff --git a/.github/workflows/acm-konflux-update-pr.yaml b/.github/workflows/acm-konflux-update-pr.yaml deleted file mode 100644 index 3892bac..0000000 --- a/.github/workflows/acm-konflux-update-pr.yaml +++ /dev/null @@ -1,85 +0,0 @@ -name: Check Konflux PRs in Downstream Repos - -on: - workflow_dispatch: - schedule: - - cron: '0 0 */14 * *' # every 14 days (biweekly) - pull_request: - paths: - - '.github/workflows/acm-konflux-update-pr.yaml' - push: - paths: - - '.github/workflows/acm-konflux-update-pr.yaml' - -jobs: - check-konflux-prs: - runs-on: ubuntu-latest - strategy: - matrix: - repo: - - stolostron/thanos - - stolostron/node-exporter - - stolostron/kube-state-metrics - - stolostron/prometheus - - stolostron/prometheus-alertmanager - - stolostron/prometheus-operator - - stolostron/grafana - - stolostron/kube-rbac-proxy - - stolostron/multicluster-observability-operator - - stolostron/observatorium - - stolostron/observatorium-operator - - stolostron/thanos-receive-controller - - stolostron/kube-thanos - - steps: - - name: Checkout upstream - uses: actions/checkout@v4 - with: - repository: ${{ matrix.repo }} - fetch-depth: 0 - - name: Find github org name from repo name - id: org - run: | - echo "downstream=$(dirname ${{ matrix.repo }})" >> $GITHUB_OUTPUT - - name: Get auth token to list pull request for ${{ matrix.repo }} - if: github.event_name != 'pull_request' - id: pr - uses: getsentry/action-github-app-token@v3 - with: - app_id: ${{ secrets.ACM_APP_ID }} - private_key: ${{ secrets.ACM_APP_PRIVATE_KEY }} - scope: ${{ steps.org.outputs.downstream }} - - name: List PRs and check for Konflux - id: check-prs - if: github.event_name != 'pull_request' - run: | - PR_LIST=$(gh pr list --repo ${{ matrix.repo }} --state open --json title) - KONFLUX_PR=$(echo "$PR_LIST" | jq '.[] | select(.title | ascii_downcase | contains("konflux"))') - if [ -n "$KONFLUX_PR" ]; then - echo "konflux_pr_exists=1" >> $GITHUB_OUTPUT - else - echo "konflux_pr_exists=0" >> $GITHUB_OUTPUT - fi - env: - GH_TOKEN: ${{ steps.pr.outputs.token }} - - name: Compose Slack message - id: slack-message - run: | - if [ "${{ steps.check-prs.outputs.konflux_pr_exists }}" == "1" ]; then - echo "message=Unmerged Konflux PRs are present in https://github.com/${{ matrix.repo }}" >> $GITHUB_OUTPUT - fi - - name: Send Slack notification - uses: 8398a7/action-slack@v3 - if : ${{ steps.check-prs.outputs.konflux_pr_exists == '1' }} - with: - status: custom - fields: workflow - custom_payload: | - { - attachments: [{ - color: 'danger', - text: "${{ steps.slack-message.outputs.message }}", - }] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.ACM_SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/merge-acm-alertmanager.yaml b/.github/workflows/merge-acm-alertmanager.yaml index d95ae14..51b465e 100644 --- a/.github/workflows/merge-acm-alertmanager.yaml +++ b/.github/workflows/merge-acm-alertmanager.yaml @@ -3,7 +3,7 @@ name: ACM Alertmanager merger on: workflow_dispatch: schedule: - - cron: '0 0 * * 1' #@weekly + - cron: '0 0 1,15 * *' #@biweekly pull_request: paths: - '.github/workflows/merge-acm-flow.yaml' @@ -20,22 +20,11 @@ jobs: upstream: prometheus/alertmanager downstream: stolostron/prometheus-alertmanager sandbox: rhobs/acm-prometheus-alertmanager - go-version: "1.25" restore-upstream: >- CHANGELOG.md VERSION go.mod go.sum - assets-cmd: | - # Only compress assets if assets actually changed - # The git diff relies on gits remote naming. The merge-flow checks out - # $downstream as origin at the time of writing this code. - if ! git diff --exit-code origin/master ui/react-app; then - make assets-compress - find ui/react-app -type f -name '*.gz' -exec git add {} \; - git add ui/react-app/embed.go - git diff --cached --exit-code || git commit -s -m "[bot] assets: generate" - fi secrets: pr-app-id: ${{ secrets.ACM_APP_ID }} diff --git a/.github/workflows/merge-acm-flow.yaml b/.github/workflows/merge-acm-flow.yaml index fcb5058..91320e9 100644 --- a/.github/workflows/merge-acm-flow.yaml +++ b/.github/workflows/merge-acm-flow.yaml @@ -7,10 +7,6 @@ on: default: '22' required: false type: string - go-version: - description: go version - required: true - type: string upstream: description: Upstream repo path in owner/repo format required: true @@ -137,12 +133,12 @@ jobs: repository: ${{ inputs.downstream }} fetch-depth: 0 ref: ${{ inputs.downstream-branch }} - - name: Fetch all upstream tags + - name: Fetch upstream tag run: | git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' git config --global core.editor "/bin/true" - git fetch https://github.com/${{ inputs.upstream }} --tags + git fetch --no-tags https://github.com/${{ inputs.upstream }} tag ${{ steps.upstream.outputs.release }} - name: Merge with upstream ${{ steps.upstream.outputs.release }} tag id: merge run: | @@ -166,10 +162,12 @@ jobs: - name: Resolve conflict due to deleted downstream files if: ${{ steps.merge.outputs.MERGE_CONFLICT == 'true' }} run: | - git status --porcelain | awk '{ if ($1=="DU") print $2 }' | xargs -I {} git rm {} + git status --porcelain | awk '{ if ($1=="UD" || $1=="DU") print $2 }' | xargs -I {} git rm {} - name: Continue after merge conflict if: ${{ steps.merge.outputs.MERGE_CONFLICT == 'true' }} - run: git merge --continue + run: | + git add -A + git merge --continue - name: Add or update VERSION file run: | # All tags use the vX.Y.Z format currently. @@ -191,7 +189,7 @@ jobs: git diff --cached --exit-code || git commit -s -m "[bot] add VERSION file with ${version_from_tag}" - uses: actions/setup-go@v5 with: - go-version: ${{ inputs.go-version }} + go-version-file: go.mod - uses: actions/setup-node@v4 with: node-version: ${{ inputs.node-version }} @@ -242,11 +240,6 @@ jobs: go mod tidy go mod vendor ${{ inputs.assets-cmd }} - if [ -f scripts/rh-manifest.sh ]; then - bash scripts/rh-manifest.sh - git add rh-manifest.txt - git diff --cached --exit-code || git commit -s -m "[bot] update rh-manifest.txt" - fi ``` author: 'github-actions[bot]' committer: 'github-actions[bot]' diff --git a/.github/workflows/merge-acm-grafana.yaml b/.github/workflows/merge-acm-grafana.yaml index c502cb1..99f0d79 100644 --- a/.github/workflows/merge-acm-grafana.yaml +++ b/.github/workflows/merge-acm-grafana.yaml @@ -3,7 +3,7 @@ name: ACM Grafana merger on: workflow_dispatch: schedule: - - cron: '0 0 * * 1' #@weekly + - cron: '0 0 1,15 * *' #@biweekly pull_request: paths: - '.github/workflows/merge-acm-flow.yaml' @@ -19,7 +19,6 @@ jobs: upstream: grafana/grafana downstream: stolostron/grafana sandbox: rhobs/acm-grafana - go-version: "1.25" node-version: "22" go-mod-tidy: false restore-downstream: >- @@ -58,10 +57,10 @@ jobs: go run ./pkg/build/wire/cmd/wire/main.go gen -tags oss ./pkg/server # Commit assets - git add pkg/server/wire_gen.go ./public/build ./public/app/plugins/datasource/*/dist/* - git diff --cached --exit-code || git commit -s -m "[bot] assets: generate" + git add pkg/server/wire_gen.go ./public/build ./public/app/plugins + git diff --cached --exit-code --name-only || git commit -s -m "[bot] assets: generate" downstream-version-expression: | - sed -n -E 's/^.*\"version\": *\"([0-9]+\.[0-9]+\.[0-9]+)\".*$/v\1/p' https://raw.githubusercontent.com/stolostron/grafana/release-2.12/package.json + sed -n -E 's/^.*\"version\": *\"([0-9]+\.[0-9]+\.[0-9]+)\".*$/v\1/p' https://raw.githubusercontent.com/stolostron/grafana/release-2.17/package.json secrets: pr-app-id: ${{ secrets.ACM_APP_ID }} pr-app-private-key: ${{ secrets.ACM_APP_PRIVATE_KEY }} diff --git a/.github/workflows/merge-acm-kube-state-metrics.yaml b/.github/workflows/merge-acm-kube-state-metrics.yaml index 0d380c5..1598cca 100644 --- a/.github/workflows/merge-acm-kube-state-metrics.yaml +++ b/.github/workflows/merge-acm-kube-state-metrics.yaml @@ -3,7 +3,7 @@ name: ACM kube-state-metrics merger on: workflow_dispatch: schedule: - - cron: '0 0 * * 1' #@weekly + - cron: '0 0 1,15 * *' #@biweekly pull_request: paths: - '.github/workflows/merge-acm-flow.yaml' @@ -20,7 +20,6 @@ jobs: upstream: kubernetes/kube-state-metrics downstream: stolostron/kube-state-metrics sandbox: rhobs/acm-kube-state-metrics - go-version: "1.25" restore-upstream: >- CHANGELOG.md restore-downstream: >- diff --git a/.github/workflows/merge-acm-memcached-exporter.yaml b/.github/workflows/merge-acm-memcached-exporter.yaml index 34549f3..b10ac2b 100644 --- a/.github/workflows/merge-acm-memcached-exporter.yaml +++ b/.github/workflows/merge-acm-memcached-exporter.yaml @@ -3,7 +3,7 @@ name: ACM Memcached exporter merger on: workflow_dispatch: schedule: - - cron: '0 0 * * 1' #@weekly + - cron: '0 0 1,15 * *' #@biweekly pull_request: paths: - '.github/workflows/merge-acm-flow.yaml' @@ -19,7 +19,6 @@ jobs: upstream: prometheus/memcached_exporter downstream: stolostron/memcached_exporter sandbox: rhobs/acm-memcached_exporter - go-version: "1.25" restore-downstream: >- OWNERS restore-upstream: >- diff --git a/.github/workflows/merge-acm-node-exporter.yaml b/.github/workflows/merge-acm-node-exporter.yaml index bbaf041..38f6b6e 100644 --- a/.github/workflows/merge-acm-node-exporter.yaml +++ b/.github/workflows/merge-acm-node-exporter.yaml @@ -3,7 +3,7 @@ name: ACM Node exporter merger on: workflow_dispatch: schedule: - - cron: '0 0 * * 1' #@weekly + - cron: '0 0 1,15 * *' #@biweekly pull_request: paths: - '.github/workflows/merge-acm-flow.yaml' @@ -19,7 +19,6 @@ jobs: upstream: prometheus/node_exporter downstream: stolostron/node-exporter sandbox: rhobs/acm-node-exporter - go-version: "1.25" restore-downstream: >- OWNERS restore-upstream: >- diff --git a/.github/workflows/merge-acm-prometheus-operator.yaml b/.github/workflows/merge-acm-prometheus-operator.yaml index d5ea718..20a117a 100644 --- a/.github/workflows/merge-acm-prometheus-operator.yaml +++ b/.github/workflows/merge-acm-prometheus-operator.yaml @@ -3,7 +3,7 @@ name: ACM Prometheus Operator merger on: workflow_dispatch: schedule: - - cron: '0 0 * * 1' #@weekly + - cron: '0 0 1,15 * *' #@biweekly pull_request: paths: - '.github/workflows/merge-acm-flow.yaml' @@ -19,7 +19,6 @@ jobs: upstream: prometheus-operator/prometheus-operator downstream: stolostron/prometheus-operator sandbox: rhobs/acm-prometheus-operator - go-version: "1.25" restore-upstream: >- CHANGELOG.md Documentation diff --git a/.github/workflows/merge-acm-prometheus.yaml b/.github/workflows/merge-acm-prometheus.yaml index 30d5281..e8d0f5a 100644 --- a/.github/workflows/merge-acm-prometheus.yaml +++ b/.github/workflows/merge-acm-prometheus.yaml @@ -3,7 +3,7 @@ name: ACM Prometheus merger on: workflow_dispatch: schedule: - - cron: '0 0 * * 1' #@weekly + - cron: '0 0 1,15 * *' #@biweekly pull_request: paths: - '.github/workflows/merge-acm-flow.yaml' @@ -19,12 +19,13 @@ jobs: upstream: prometheus/prometheus downstream: stolostron/prometheus sandbox: rhobs/acm-prometheus - go-version: "1.25" + go-mod-tidy: false restore-downstream: >- plugins.yml plugins restore-upstream: >- CHANGELOG.md + Makefile VERSION go.mod go.sum @@ -33,11 +34,10 @@ jobs: # Only compress assets if assets actually changed # The git diff relies on gits remote naming. The merge-flow checks out # $downstream as origin at the time of writing this code. - if ! git diff --exit-code origin/main web/ui; then - make assets-compress + if ! git diff --exit-code --name-only origin/main web/ui; then find web/ui/static -type f -name '*.gz' -exec git add {} \; - git add web/ui/embed.go - git diff --cached --exit-code || git commit -s -m "[bot] assets: generate" + git add web/ui + git diff --cached --exit-code --name-only || git commit -s -m "[bot] assets: generate" fi secrets: diff --git a/.github/workflows/merge-acm-thanos.yaml b/.github/workflows/merge-acm-thanos.yaml index d7c2f85..32ce2d6 100644 --- a/.github/workflows/merge-acm-thanos.yaml +++ b/.github/workflows/merge-acm-thanos.yaml @@ -3,7 +3,7 @@ name: ACM Thanos merger on: workflow_dispatch: schedule: - - cron: '0 0 * * 1' #@weekly + - cron: '0 0 1,15 * *' #@biweekly pull_request: paths: - '.github/workflows/merge-acm-flow.yaml' @@ -19,7 +19,6 @@ jobs: upstream: thanos-io/thanos downstream: stolostron/thanos sandbox: rhobs/acm-thanos - go-version: "1.25" restore-downstream: >- OWNERS restore-upstream: >-