From 99c1a993bbef1eeb2654cb4a4e4c6c0ee6df969d Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Fri, 10 Jan 2025 13:01:31 -0800 Subject: [PATCH 1/4] Use versions instead of commits in vertexai responses actions scripts --- .github/workflows/check-vertexai-responses.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-vertexai-responses.yml b/.github/workflows/check-vertexai-responses.yml index 61f9cd45549..65fa74dac18 100644 --- a/.github/workflows/check-vertexai-responses.yml +++ b/.github/workflows/check-vertexai-responses.yml @@ -31,14 +31,14 @@ jobs: echo "latest_tag=$LATEST" >> $GITHUB_ENV working-directory: packages/vertexai/test-utils/vertexai-sdk-test-data - name: Find comment from previous run if exists - uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e + uses: peter-evans/find-comment@v3 id: fc with: issue-number: ${{github.event.number}} body-includes: Vertex AI Mock Responses Check - name: Comment on PR if newer version is available if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}} - uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 + uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{github.event.number}} body: > @@ -49,6 +49,6 @@ jobs: should be updated to clone the latest version of the responses: `${{env.latest_tag}}` - name: Delete comment when version gets updated if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}} - uses: detomarco/delete-comment@850734dd44d8b15fef55b45252613b903ceb06f0 + uses: detomarco/delete-comment@v1 with: comment-id: ${{ steps.fc.outputs.comment-id }} From 898b3c3350057eec0713692ac1631def3c28d82e Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Mon, 13 Jan 2025 10:11:11 -0800 Subject: [PATCH 2/4] plural delete comments --- .github/workflows/check-vertexai-responses.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-vertexai-responses.yml b/.github/workflows/check-vertexai-responses.yml index 65fa74dac18..db146f34873 100644 --- a/.github/workflows/check-vertexai-responses.yml +++ b/.github/workflows/check-vertexai-responses.yml @@ -49,6 +49,6 @@ jobs: should be updated to clone the latest version of the responses: `${{env.latest_tag}}` - name: Delete comment when version gets updated if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}} - uses: detomarco/delete-comment@v1 + uses: detomarco/delete-comments@v1 with: comment-id: ${{ steps.fc.outputs.comment-id }} From 191a972d0fc9ebc4b12400784ce396454e7b76af Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 14 Jan 2025 11:02:53 -0800 Subject: [PATCH 3/4] v0? --- .github/workflows/check-vertexai-responses.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-vertexai-responses.yml b/.github/workflows/check-vertexai-responses.yml index db146f34873..00253fabe75 100644 --- a/.github/workflows/check-vertexai-responses.yml +++ b/.github/workflows/check-vertexai-responses.yml @@ -49,6 +49,6 @@ jobs: should be updated to clone the latest version of the responses: `${{env.latest_tag}}` - name: Delete comment when version gets updated if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}} - uses: detomarco/delete-comments@v1 + uses: detomarco/delete-comments@v0 with: comment-id: ${{ steps.fc.outputs.comment-id }} From 09776bfcf294f53c84c72da1ffafa7b6948f011c Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 14 Jan 2025 12:15:45 -0800 Subject: [PATCH 4/4] stop using problem action --- .../workflows/check-vertexai-responses.yml | 72 ++++++++++--------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/.github/workflows/check-vertexai-responses.yml b/.github/workflows/check-vertexai-responses.yml index 00253fabe75..418ada2fc34 100644 --- a/.github/workflows/check-vertexai-responses.yml +++ b/.github/workflows/check-vertexai-responses.yml @@ -19,36 +19,44 @@ on: pull_request jobs: check-version: runs-on: ubuntu-latest + # Allow GITHUB_TOKEN to have write permissions + permissions: + contents: write steps: - - uses: actions/checkout@v4 - - name: Clone mock responses - run: scripts/update_vertexai_responses.sh - - name: Find cloned and latest versions - run: | - CLONED=$(git describe --tags) - LATEST=$(git tag --sort=v:refname | tail -n1) - echo "cloned_tag=$CLONED" >> $GITHUB_ENV - echo "latest_tag=$LATEST" >> $GITHUB_ENV - working-directory: packages/vertexai/test-utils/vertexai-sdk-test-data - - name: Find comment from previous run if exists - uses: peter-evans/find-comment@v3 - id: fc - with: - issue-number: ${{github.event.number}} - body-includes: Vertex AI Mock Responses Check - - name: Comment on PR if newer version is available - if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}} - uses: peter-evans/create-or-update-comment@v4 - with: - issue-number: ${{github.event.number}} - body: > - ### Vertex AI Mock Responses Check :warning: - - A newer major version of the mock responses for Vertex AI unit tests is available. - [update_vertexai_responses.sh](https://github.com/firebase/firebase-js-sdk/blob/main/scripts/update_vertexai_responses.sh) - should be updated to clone the latest version of the responses: `${{env.latest_tag}}` - - name: Delete comment when version gets updated - if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}} - uses: detomarco/delete-comments@v0 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} + - uses: actions/checkout@v4 + - name: Clone mock responses + run: scripts/update_vertexai_responses.sh + - name: Find cloned and latest versions + run: | + CLONED=$(git describe --tags) + LATEST=$(git tag --sort=v:refname | tail -n1) + echo "cloned_tag=$CLONED" >> $GITHUB_ENV + echo "latest_tag=$LATEST" >> $GITHUB_ENV + working-directory: packages/vertexai/test-utils/vertexai-sdk-test-data + - name: Find comment from previous run if exists + uses: peter-evans/find-comment@v3 + id: fc + with: + issue-number: ${{github.event.number}} + body-includes: Vertex AI Mock Responses Check + - name: Comment on PR if newer version is available + if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}} + uses: peter-evans/create-or-update-comment@v4 + with: + issue-number: ${{github.event.number}} + body: > + ### Vertex AI Mock Responses Check :warning: + + A newer major version of the mock responses for Vertex AI unit tests is available. + [update_vertexai_responses.sh](https://github.com/firebase/firebase-js-sdk/blob/main/scripts/update_vertexai_responses.sh) + should be updated to clone the latest version of the responses: `${{env.latest_tag}}` + - name: Delete comment when version gets updated + if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}} + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.deleteComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: ${{ steps.fc.outputs.comment-id }}, + })