From 9980541f1d865eaf298856111a385ac293da390c Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Fri, 9 Jun 2023 09:59:52 -0700 Subject: [PATCH 1/4] Force push auto-commits to bypass branch protection status checks PiperOrigin-RevId: 539109983 --- ci/push_auto_update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/push_auto_update.sh b/ci/push_auto_update.sh index 80fa7673eabad..3ee0ec031f50d 100755 --- a/ci/push_auto_update.sh +++ b/ci/push_auto_update.sh @@ -42,4 +42,4 @@ fi git add -A git diff --staged --quiet || git commit -am "$commit_message" git pull --rebase -git push || echo "Conflicting commit hit, retrying in next job..." +git push --force-with-lease || echo "Conflicting commit hit, retrying in next job..." From 901cfbebb8a4dfff183c58e854dec96c4f28f694 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Mon, 5 Jun 2023 12:36:01 -0700 Subject: [PATCH 2/4] Cleanup scheduled staleness tests. - Do some minimal sanity testing on every PR - Only run the staleness tests on a daily schedule or explicit runs. - Add 23.x to the checks PiperOrigin-RevId: 537952151 --- .github/workflows/staleness_check.yml | 26 ++++++++++++++++++++++---- .github/workflows/test_runner.yml | 8 ++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/staleness_check.yml b/.github/workflows/staleness_check.yml index f04621ed1540d..40c041ae942fc 100644 --- a/.github/workflows/staleness_check.yml +++ b/.github/workflows/staleness_check.yml @@ -4,6 +4,12 @@ on: schedule: # Run daily at 10 AM UTC (2 AM PDT) - cron: 0 10 * * * + workflow_call: + inputs: + safe-checkout: + required: false + description: "The SHA key for the commit we want to run over" + type: string workflow_dispatch: permissions: {} @@ -12,20 +18,32 @@ jobs: strategy: fail-fast: false matrix: - branch: [main, 22.x] + branch: [main, 22.x, 23.x] os: [{ name: Linux, value: ubuntu-latest}] name: Test staleness ${{ matrix.os.name }} ${{ matrix.branch}} runs-on: ${{ matrix.os.value }} - if: ${{ github.event.repository.full_name == 'protocolbuffers/protobuf' || matrix.branch == 'main '}} + if: ${{ github.event.repository.full_name == 'protocolbuffers/protobuf' }} steps: - name: Checkout ${{ matrix.branch }} uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: - ref: ${{ matrix.branch}} + ref: ${{ inputs.safe-checkout || matrix.branch}} + + # For commit-based tests, simply run the bazel query to make sure it works. This should be + # identical to the step below, except for the xargs piece that runs bazel test. + - name: Check that staleness tests are queryable + if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_call'}} + uses: protocolbuffers/protobuf-ci/bazel-docker@v1 + with: + image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.0.0-6361b3a6e5c97e9951d03a4de28542fc45f1adab + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + bazel-cache: staleness_check/${{ matrix.branch}}_${{ matrix.os.value }} + bash: bazel query 'attr(tags, "staleness_test", //...)' - name: Run all staleness tests - uses: protocolbuffers/protobuf-ci/bazel@v1 + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_call' }} + uses: protocolbuffers/protobuf-ci/bazel-docker@v1 with: credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} bazel-cache: staleness_check/${{ matrix.branch}}_${{ matrix.os.value }} diff --git a/.github/workflows/test_runner.yml b/.github/workflows/test_runner.yml index f55d63cac3295..58fcd3150bc1c 100644 --- a/.github/workflows/test_runner.yml +++ b/.github/workflows/test_runner.yml @@ -169,3 +169,11 @@ jobs: with: safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }} secrets: inherit + + staleness: + name: Staleness + needs: [check-tag] + uses: ./.github/workflows/staleness_check.yml + with: + safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }} + secrets: inherit From c4bbdcf62259a13ea3b1d47df1a7228fff2ad2b7 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Thu, 8 Jun 2023 09:45:36 -0700 Subject: [PATCH 3/4] Fix staleness test branching logic PiperOrigin-RevId: 538812352 --- .github/workflows/staleness_check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/staleness_check.yml b/.github/workflows/staleness_check.yml index 40c041ae942fc..e790b63636b17 100644 --- a/.github/workflows/staleness_check.yml +++ b/.github/workflows/staleness_check.yml @@ -33,7 +33,7 @@ jobs: # For commit-based tests, simply run the bazel query to make sure it works. This should be # identical to the step below, except for the xargs piece that runs bazel test. - name: Check that staleness tests are queryable - if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_call'}} + if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' || github.event_name == 'push' }} uses: protocolbuffers/protobuf-ci/bazel-docker@v1 with: image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.0.0-6361b3a6e5c97e9951d03a4de28542fc45f1adab @@ -42,7 +42,7 @@ jobs: bash: bazel query 'attr(tags, "staleness_test", //...)' - name: Run all staleness tests - if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_call' }} + if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' && github.event_name != 'push' }} uses: protocolbuffers/protobuf-ci/bazel-docker@v1 with: credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} From 821c51e0a1291f17014123db5edfd1ef9ab4f772 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Mon, 5 Jun 2023 12:14:24 -0700 Subject: [PATCH 4/4] Disable non-hermetic breakage due to github runner update See https://github.com/actions/runner-images/issues/7662 PiperOrigin-RevId: 537946689 --- .github/workflows/test_cpp.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test_cpp.yml b/.github/workflows/test_cpp.yml index f45b59ed13c7d..6b5f9df7d9a67 100644 --- a/.github/workflows/test_cpp.yml +++ b/.github/workflows/test_cpp.yml @@ -348,13 +348,16 @@ jobs: -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_EXAMPLES=ON vsversion: '2019' - - name: Windows CMake 2022 - os: windows-2022 - flags: >- - -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF - -Dprotobuf_BUILD_SHARED_LIBS=OFF - -Dprotobuf_BUILD_EXAMPLES=ON - vsversion: '2022' + # TODO(b/285566773) Re-enable this test. + # This is broken due to a github runner update. + # See https://github.com/actions/runner-images/issues/7662 for more details + #- name: Windows CMake 2022 + # os: windows-2022 + # flags: >- + # -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF + # -Dprotobuf_BUILD_SHARED_LIBS=OFF + # -Dprotobuf_BUILD_EXAMPLES=ON + # vsversion: '2022' - name: Windows CMake Shared os: windows-2019 flags: >-