From cdec3d7ad0d7436e5a2a3ce2eb0d2c52e85257a9 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Fri, 24 Oct 2025 07:49:05 +0700 Subject: [PATCH 01/14] fix: Make CI works for external contributors --- .github/workflows/image.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 4df15831..9f72bdfe 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -28,13 +28,27 @@ jobs: platforms: linux/${{ matrix.platform }} dockerfile_path: './Dockerfile' build_args: TASKBROKER_GIT_REVISION=${{ github.sha }} - ghcr: true + ghcr: ${{ (github.event_name == 'pull_request') && false || true }} tag_suffix: -${{ matrix.platform }} publish_on_pr: true google_ar: false tag_nightly: false tag_latest: false + - name: Save Docker image to tar file + if: ${{ github.event_name == 'pull_request' }} + run: | + docker image save --output /tmp/taskbroker-${{ matrix.platform }}.tar ghcr.io/getsentry/taskbroker:${{ github.sha }}-${{ matrix.platform }} + + - name: Upload artifact for self-hosted e2e + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: ${{ github.event_name == 'pull_request' }} + with: + name: taskbroker-${{ matrix.platform }} + path: /tmp/taskbroker-${{ matrix.platform }}.tar + if-no-files-found: error + retention-days: 1 + assemble-taskbroker-image: runs-on: ubuntu-latest needs: [build] @@ -91,6 +105,19 @@ jobs: timeout-minutes: 30 steps: + - name: Download artifact for pull request + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 + if: ${{ github.event_name == 'pull_request' }} + with: + name: taskbroker-amd64 + path: /tmp/taskbroker-amd64.tar + + - name: Load Docker image from tar file + if: ${{ github.event_name == 'pull_request' }} + run: | + docker image load --input /tmp/taskbroker-amd64.tar + docker image tag ghcr.io/getsentry/taskbroker:${{ github.sha }}-amd64 ghcr.io/getsentry/taskbroker:${{ github.sha }} + - name: Run Sentry self-hosted e2e CI uses: getsentry/self-hosted@master with: From 5e4fe4644a9ce248b525ebd4ddd2ca496051bff6 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Fri, 24 Oct 2025 07:51:16 +0700 Subject: [PATCH 02/14] fix: don't create multiplatform manifest for pull request, let it pass --- .github/workflows/image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 9f72bdfe..9d93d012 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -67,6 +67,7 @@ jobs: uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 - name: Create multiplatform manifests + if: ${{ github.event_name != 'pull_request' }} run: | docker buildx imagetools create \ --tag ghcr.io/getsentry/taskbroker:${{ github.event.pull_request.head.sha || github.sha }} \ From 6a2505ef1d220b656162d27c14db72110bab969d Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Fri, 24 Oct 2025 08:11:36 +0700 Subject: [PATCH 03/14] fix: apply fix from Seer --- .github/workflows/image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 9d93d012..d64840bd 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -28,7 +28,7 @@ jobs: platforms: linux/${{ matrix.platform }} dockerfile_path: './Dockerfile' build_args: TASKBROKER_GIT_REVISION=${{ github.sha }} - ghcr: ${{ (github.event_name == 'pull_request') && false || true }} + ghcr: ${{ github.event_name != 'pull_request' }} tag_suffix: -${{ matrix.platform }} publish_on_pr: true google_ar: false From 4fdecf3da85256f55b43c8a68309a3afc0b8d5e2 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Fri, 24 Oct 2025 08:14:48 +0700 Subject: [PATCH 04/14] chore: run pre-commit --- .github/workflows/image.yml | 4 ++-- Dockerfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index d64840bd..dfe59313 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -41,7 +41,7 @@ jobs: docker image save --output /tmp/taskbroker-${{ matrix.platform }}.tar ghcr.io/getsentry/taskbroker:${{ github.sha }}-${{ matrix.platform }} - name: Upload artifact for self-hosted e2e - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: ${{ github.event_name == 'pull_request' }} with: name: taskbroker-${{ matrix.platform }} @@ -112,7 +112,7 @@ jobs: with: name: taskbroker-amd64 path: /tmp/taskbroker-amd64.tar - + - name: Load Docker image from tar file if: ${{ github.event_name == 'pull_request' }} run: | diff --git a/Dockerfile b/Dockerfile index 125447c4..2847a419 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # recent enough version of protobuf-compiler FROM rust:1-bookworm AS build -RUN apt-get update && apt-get upgrade -y +RUN apt-get update && apt-get upgrade -y RUN apt-get install -y cmake pkg-config libssl-dev librdkafka-dev protobuf-compiler RUN USER=root cargo new --bin taskbroker From be2123d3f4a1432ac81337d48af61a2e4870d2ba Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Fri, 24 Oct 2025 08:25:02 +0700 Subject: [PATCH 05/14] ci: don't know if this will work --- .github/workflows/image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index dfe59313..97d93d61 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -34,6 +34,7 @@ jobs: google_ar: false tag_nightly: false tag_latest: false + outputs: ${{ github.event_name == 'pull_request' && 'type=docker,dest=/tmp/taskbroker-${{ matrix.platform }}.tar' || '' }} - name: Save Docker image to tar file if: ${{ github.event_name == 'pull_request' }} From e224473adc0b63280d3158600dc3b1e19ee78be3 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Fri, 24 Oct 2025 08:42:06 +0700 Subject: [PATCH 06/14] yikes --- .github/workflows/image.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 97d93d61..c2b0f1d4 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -36,11 +36,6 @@ jobs: tag_latest: false outputs: ${{ github.event_name == 'pull_request' && 'type=docker,dest=/tmp/taskbroker-${{ matrix.platform }}.tar' || '' }} - - name: Save Docker image to tar file - if: ${{ github.event_name == 'pull_request' }} - run: | - docker image save --output /tmp/taskbroker-${{ matrix.platform }}.tar ghcr.io/getsentry/taskbroker:${{ github.sha }}-${{ matrix.platform }} - - name: Upload artifact for self-hosted e2e uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: ${{ github.event_name == 'pull_request' }} From 5f19ff3bc8dee5c97ad8f380d77667178c62e7ad Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Fri, 24 Oct 2025 08:58:39 +0700 Subject: [PATCH 07/14] ci: try without matrix.platform --- .github/workflows/image.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index c2b0f1d4..71d5e852 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -34,14 +34,14 @@ jobs: google_ar: false tag_nightly: false tag_latest: false - outputs: ${{ github.event_name == 'pull_request' && 'type=docker,dest=/tmp/taskbroker-${{ matrix.platform }}.tar' || '' }} + outputs: ${{ github.event_name == 'pull_request' && 'type=docker,dest=/tmp/taskbroker.tar' || '' }} - name: Upload artifact for self-hosted e2e uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: ${{ github.event_name == 'pull_request' }} with: name: taskbroker-${{ matrix.platform }} - path: /tmp/taskbroker-${{ matrix.platform }}.tar + path: /tmp/taskbroker.tar if-no-files-found: error retention-days: 1 @@ -107,12 +107,12 @@ jobs: if: ${{ github.event_name == 'pull_request' }} with: name: taskbroker-amd64 - path: /tmp/taskbroker-amd64.tar + path: /tmp/taskbroker.tar - name: Load Docker image from tar file if: ${{ github.event_name == 'pull_request' }} run: | - docker image load --input /tmp/taskbroker-amd64.tar + docker image load --input /tmp/taskbroker.tar docker image tag ghcr.io/getsentry/taskbroker:${{ github.sha }}-amd64 ghcr.io/getsentry/taskbroker:${{ github.sha }} - name: Run Sentry self-hosted e2e CI From ee111faaccc858a905e4fd87a4cc96b4515e6707 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Fri, 24 Oct 2025 09:14:20 +0700 Subject: [PATCH 08/14] ci: move create multipllatform manifest logic --- .github/workflows/image.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 71d5e852..77de28c7 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -48,7 +48,6 @@ jobs: assemble-taskbroker-image: runs-on: ubuntu-latest needs: [build] - if: ${{ (github.ref_name == 'main' || startsWith(github.ref_name, 'releases/')) && github.event_name != 'pull_request' }} permissions: contents: read packages: write @@ -63,7 +62,7 @@ jobs: uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 - name: Create multiplatform manifests - if: ${{ github.event_name != 'pull_request' }} + if: ${{ (github.ref_name == 'main' || startsWith(github.ref_name, 'releases/')) && github.event_name != 'pull_request' }} run: | docker buildx imagetools create \ --tag ghcr.io/getsentry/taskbroker:${{ github.event.pull_request.head.sha || github.sha }} \ From b0a3707b2eb5ee585d2b0f4d52ed7acd9bce9b15 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Fri, 24 Oct 2025 09:26:57 +0700 Subject: [PATCH 09/14] ci: use path instead of file name for download artifact --- .github/workflows/image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 77de28c7..699f24b1 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -106,7 +106,7 @@ jobs: if: ${{ github.event_name == 'pull_request' }} with: name: taskbroker-amd64 - path: /tmp/taskbroker.tar + path: /tmp/ - name: Load Docker image from tar file if: ${{ github.event_name == 'pull_request' }} From 1a8f6e420bd0365429c069df438d09bb3d3e2741 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Fri, 24 Oct 2025 09:57:04 +0700 Subject: [PATCH 10/14] ci: debug image tag --- .github/workflows/image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 699f24b1..22e48c6a 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -112,6 +112,7 @@ jobs: if: ${{ github.event_name == 'pull_request' }} run: | docker image load --input /tmp/taskbroker.tar + docker image ls --all --no-trunc docker image tag ghcr.io/getsentry/taskbroker:${{ github.sha }}-amd64 ghcr.io/getsentry/taskbroker:${{ github.sha }} - name: Run Sentry self-hosted e2e CI From cfbab3b172df1d50d1f33cc755e2a09b2ab6b5a7 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Fri, 24 Oct 2025 10:53:16 +0700 Subject: [PATCH 11/14] ci: try things out --- .github/workflows/image.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 22e48c6a..00cc23ac 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -34,7 +34,13 @@ jobs: google_ar: false tag_nightly: false tag_latest: false - outputs: ${{ github.event_name == 'pull_request' && 'type=docker,dest=/tmp/taskbroker.tar' || '' }} + tags: ${{ github.event_name == 'pull_request' && 'ghcr.io/getsentry/taskbroker:nightly' || ''}} + + - name: Save Docker image to artifact + if: ${{ github.event_name == 'pull_request' }} + run: | + docker image ls --all + docker save -o /tmp/taskbroker.tar ghcr.io/getsentry/taskbroker:nightly - name: Upload artifact for self-hosted e2e uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 @@ -113,7 +119,7 @@ jobs: run: | docker image load --input /tmp/taskbroker.tar docker image ls --all --no-trunc - docker image tag ghcr.io/getsentry/taskbroker:${{ github.sha }}-amd64 ghcr.io/getsentry/taskbroker:${{ github.sha }} + docker image tag ghcr.io/getsentry/taskbroker:nightly ghcr.io/getsentry/taskbroker:${{ github.sha }} - name: Run Sentry self-hosted e2e CI uses: getsentry/self-hosted@master From e61f09474d0e27174333d5f21f718160e54b4f32 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Fri, 24 Oct 2025 13:27:42 +0700 Subject: [PATCH 12/14] ci: try to set the output to docker --- .github/workflows/image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 00cc23ac..5f3f1868 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -35,6 +35,7 @@ jobs: tag_nightly: false tag_latest: false tags: ${{ github.event_name == 'pull_request' && 'ghcr.io/getsentry/taskbroker:nightly' || ''}} + outputs: ${{ github.event_name == 'pull_request' && 'type=docker' || ''}} - name: Save Docker image to artifact if: ${{ github.event_name == 'pull_request' }} From bd192c9188bdd8c100d8fae171a1ee9d007c497d Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Fri, 24 Oct 2025 13:49:40 +0700 Subject: [PATCH 13/14] ci: remove debugging commands --- .github/workflows/image.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 5f3f1868..d4ebd3ea 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -39,9 +39,7 @@ jobs: - name: Save Docker image to artifact if: ${{ github.event_name == 'pull_request' }} - run: | - docker image ls --all - docker save -o /tmp/taskbroker.tar ghcr.io/getsentry/taskbroker:nightly + run: docker save -o /tmp/taskbroker.tar ghcr.io/getsentry/taskbroker:nightly - name: Upload artifact for self-hosted e2e uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 @@ -119,7 +117,6 @@ jobs: if: ${{ github.event_name == 'pull_request' }} run: | docker image load --input /tmp/taskbroker.tar - docker image ls --all --no-trunc docker image tag ghcr.io/getsentry/taskbroker:nightly ghcr.io/getsentry/taskbroker:${{ github.sha }} - name: Run Sentry self-hosted e2e CI From 279a4aa315bef71b0b994378c9c5411209d775ab Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Sun, 2 Nov 2025 18:04:28 +0700 Subject: [PATCH 14/14] ci: push to GHCR for non-forks --- .github/workflows/image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index d4ebd3ea..cc3c4694 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -28,7 +28,7 @@ jobs: platforms: linux/${{ matrix.platform }} dockerfile_path: './Dockerfile' build_args: TASKBROKER_GIT_REVISION=${{ github.sha }} - ghcr: ${{ github.event_name != 'pull_request' }} + ghcr: ${{ github.event.pull_request.head.repo.fork == false }} tag_suffix: -${{ matrix.platform }} publish_on_pr: true google_ar: false