From b1ce7af6a06d3cda2e3fbd201819a1d9845ff854 Mon Sep 17 00:00:00 2001 From: noahdietz Date: Mon, 24 Oct 2022 10:53:51 -0700 Subject: [PATCH 01/13] chore(ci): fix apidiff handling of empty set --- .github/workflows/apidiff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml index f45bc49a884..bc063907780 100644 --- a/.github/workflows/apidiff.yml +++ b/.github/workflows/apidiff.yml @@ -34,7 +34,7 @@ jobs: apidiff: needs: scan_changes runs-on: ubuntu-latest - if: "!contains(github.event.pull_request.labels.*.name, 'breaking change allowed')" + if: "needs.scan_changes.outputs.changed_dirs != '[]' && !contains(github.event.pull_request.labels.*.name, 'breaking change allowed')" continue-on-error: true strategy: matrix: ${{ fromJson(needs.scan_changes.outputs.changed_dirs) }} From 07b1b9c779a6a056f860b7b2099759502ce036f3 Mon Sep 17 00:00:00 2001 From: noahdietz Date: Mon, 24 Oct 2022 10:59:11 -0700 Subject: [PATCH 02/13] maybe fix syntax --- .github/workflows/apidiff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml index bc063907780..9345401d0ac 100644 --- a/.github/workflows/apidiff.yml +++ b/.github/workflows/apidiff.yml @@ -34,7 +34,7 @@ jobs: apidiff: needs: scan_changes runs-on: ubuntu-latest - if: "needs.scan_changes.outputs.changed_dirs != '[]' && !contains(github.event.pull_request.labels.*.name, 'breaking change allowed')" + if: "${{ needs.scan_changes.outputs.changed_dirs != '[]' }} && !contains(github.event.pull_request.labels.*.name, 'breaking change allowed')" continue-on-error: true strategy: matrix: ${{ fromJson(needs.scan_changes.outputs.changed_dirs) }} From 34d6890d5708b382494ac9a03e16ea429afd7697 Mon Sep 17 00:00:00 2001 From: noahdietz Date: Mon, 24 Oct 2022 11:05:50 -0700 Subject: [PATCH 03/13] maybe fix syntax --- .github/workflows/apidiff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml index 9345401d0ac..cf0a9591cca 100644 --- a/.github/workflows/apidiff.yml +++ b/.github/workflows/apidiff.yml @@ -34,7 +34,7 @@ jobs: apidiff: needs: scan_changes runs-on: ubuntu-latest - if: "${{ needs.scan_changes.outputs.changed_dirs != '[]' }} && !contains(github.event.pull_request.labels.*.name, 'breaking change allowed')" + if: ${{ needs.scan_changes.outputs.changed_dirs != '[]' }} && !contains(github.event.pull_request.labels.*.name, 'breaking change allowed') continue-on-error: true strategy: matrix: ${{ fromJson(needs.scan_changes.outputs.changed_dirs) }} From 82543b1203099d9fd0f248b062db2ef687d1c496 Mon Sep 17 00:00:00 2001 From: noahdietz Date: Mon, 24 Oct 2022 11:18:35 -0700 Subject: [PATCH 04/13] inline gitfu --- .github/workflows/apidiff.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml index cf0a9591cca..cec9504e9e3 100644 --- a/.github/workflows/apidiff.yml +++ b/.github/workflows/apidiff.yml @@ -18,9 +18,7 @@ jobs: id: changed_dirs # Ignore changes to the internal and root directories. run: | - tree=$(git diff-tree --no-commit-id --name-only --diff-filter=DMR -r ${{ steps.main.outputs.hash }}..HEAD) - uniques=$(echo $tree | xargs -r -L1 dirname | uniq) - dirs=$(echo $uniques | grep -v -e 'internal' -e '\.' | cat) + dirs=$(git diff-tree --no-commit-id --name-only --diff-filter=DMR -r ${{ steps.main.outputs.hash }}..HEAD | xargs -r -L1 dirname | uniq | grep -v -e 'internal' -e '\.') if [ -z "$dirs" ] then echo "changed={\"changed\":[]}" >> $GITHUB_OUTPUT From a15711e9a7c957492e061d9494f6b6ad7c7ca618 Mon Sep 17 00:00:00 2001 From: noahdietz Date: Mon, 24 Oct 2022 11:20:21 -0700 Subject: [PATCH 05/13] add missing cat --- .github/workflows/apidiff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml index cec9504e9e3..0407499bd85 100644 --- a/.github/workflows/apidiff.yml +++ b/.github/workflows/apidiff.yml @@ -18,7 +18,7 @@ jobs: id: changed_dirs # Ignore changes to the internal and root directories. run: | - dirs=$(git diff-tree --no-commit-id --name-only --diff-filter=DMR -r ${{ steps.main.outputs.hash }}..HEAD | xargs -r -L1 dirname | uniq | grep -v -e 'internal' -e '\.') + dirs=$(git diff-tree --no-commit-id --name-only --diff-filter=DMR -r ${{ steps.main.outputs.hash }}..HEAD | xargs -r -L1 dirname | uniq | grep -v -e 'internal' -e '\.' | cat) if [ -z "$dirs" ] then echo "changed={\"changed\":[]}" >> $GITHUB_OUTPUT From 4bbc0a64db4502dd1abe818b81738ab45b576bb1 Mon Sep 17 00:00:00 2001 From: noahdietz Date: Mon, 24 Oct 2022 11:22:57 -0700 Subject: [PATCH 06/13] maybe fix syntax --- .github/workflows/apidiff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml index 0407499bd85..0b166e228ac 100644 --- a/.github/workflows/apidiff.yml +++ b/.github/workflows/apidiff.yml @@ -32,7 +32,7 @@ jobs: apidiff: needs: scan_changes runs-on: ubuntu-latest - if: ${{ needs.scan_changes.outputs.changed_dirs != '[]' }} && !contains(github.event.pull_request.labels.*.name, 'breaking change allowed') + if: ${{ needs.scan_changes.outputs.changed_dirs != '[]' && !contains(github.event.pull_request.labels.*.name, 'breaking change allowed') }} continue-on-error: true strategy: matrix: ${{ fromJson(needs.scan_changes.outputs.changed_dirs) }} From 344160d2993a18f268211eef5ba79f4a1cba0eb0 Mon Sep 17 00:00:00 2001 From: noahdietz Date: Mon, 24 Oct 2022 11:30:13 -0700 Subject: [PATCH 07/13] TEST --- asset/apiv1/doc.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/asset/apiv1/doc.go b/asset/apiv1/doc.go index 599f176b186..254691acb1c 100644 --- a/asset/apiv1/doc.go +++ b/asset/apiv1/doc.go @@ -79,8 +79,7 @@ // // To close the open connection, use the Close() method. // -// For information about setting deadlines, reusing contexts, and more -// please visit https://pkg.go.dev/cloud.google.com/go. +// For information about settin package asset // import "cloud.google.com/go/asset/apiv1" import ( From 6c07012b1a3aab17c33f4ec414ba8d0c39c81d53 Mon Sep 17 00:00:00 2001 From: noahdietz Date: Mon, 24 Oct 2022 11:32:21 -0700 Subject: [PATCH 08/13] Revert "TEST" This reverts commit 344160d2993a18f268211eef5ba79f4a1cba0eb0. --- asset/apiv1/doc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/asset/apiv1/doc.go b/asset/apiv1/doc.go index 254691acb1c..599f176b186 100644 --- a/asset/apiv1/doc.go +++ b/asset/apiv1/doc.go @@ -79,7 +79,8 @@ // // To close the open connection, use the Close() method. // -// For information about settin +// For information about setting deadlines, reusing contexts, and more +// please visit https://pkg.go.dev/cloud.google.com/go. package asset // import "cloud.google.com/go/asset/apiv1" import ( From e0729848768399c81c49f76e1179c08c3a340b07 Mon Sep 17 00:00:00 2001 From: noahdietz Date: Mon, 24 Oct 2022 11:35:56 -0700 Subject: [PATCH 09/13] maybe fix syntax --- .github/workflows/apidiff.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml index 0b166e228ac..90fa61ce1f8 100644 --- a/.github/workflows/apidiff.yml +++ b/.github/workflows/apidiff.yml @@ -21,7 +21,7 @@ jobs: dirs=$(git diff-tree --no-commit-id --name-only --diff-filter=DMR -r ${{ steps.main.outputs.hash }}..HEAD | xargs -r -L1 dirname | uniq | grep -v -e 'internal' -e '\.' | cat) if [ -z "$dirs" ] then - echo "changed={\"changed\":[]}" >> $GITHUB_OUTPUT + echo "changed=''" >> $GITHUB_OUTPUT echo "No changes worth diffing!" else for d in $dirs; do list=${list},\"${d}\"; done @@ -32,7 +32,7 @@ jobs: apidiff: needs: scan_changes runs-on: ubuntu-latest - if: ${{ needs.scan_changes.outputs.changed_dirs != '[]' && !contains(github.event.pull_request.labels.*.name, 'breaking change allowed') }} + if: needs.scan_changes.outputs.changed_dirs != '' && !contains(github.event.pull_request.labels.*.name, 'breaking change allowed') continue-on-error: true strategy: matrix: ${{ fromJson(needs.scan_changes.outputs.changed_dirs) }} @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@v3 with: ref: main - - name: Baseline name + - name: Create baseline id: baseline run: | export CHANGED=${{ matrix.changed }} From d28c5d5b0cd396aaebdbdf57dc72bc55eafb925e Mon Sep 17 00:00:00 2001 From: noahdietz Date: Mon, 24 Oct 2022 11:47:32 -0700 Subject: [PATCH 10/13] try a skip var --- .github/workflows/apidiff.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml index 90fa61ce1f8..ef21120abba 100644 --- a/.github/workflows/apidiff.yml +++ b/.github/workflows/apidiff.yml @@ -21,18 +21,20 @@ jobs: dirs=$(git diff-tree --no-commit-id --name-only --diff-filter=DMR -r ${{ steps.main.outputs.hash }}..HEAD | xargs -r -L1 dirname | uniq | grep -v -e 'internal' -e '\.' | cat) if [ -z "$dirs" ] then - echo "changed=''" >> $GITHUB_OUTPUT + echo "skip=1" >> $GITHUB_OUTPUT echo "No changes worth diffing!" else for d in $dirs; do list=${list},\"${d}\"; done echo "changed={\"changed\":[${list#,}]}" >> $GITHUB_OUTPUT + echo "skip=0" >> $GITHUB_OUTPUT fi outputs: changed_dirs: ${{ steps.changed_dirs.outputs.changed }} + skip: ${{ steps.changed_dirs.outputs.skip }} apidiff: needs: scan_changes runs-on: ubuntu-latest - if: needs.scan_changes.outputs.changed_dirs != '' && !contains(github.event.pull_request.labels.*.name, 'breaking change allowed') + if: "!needs.scan_changes.outputs.skip && !contains(github.event.pull_request.labels.*.name, 'breaking change allowed')" continue-on-error: true strategy: matrix: ${{ fromJson(needs.scan_changes.outputs.changed_dirs) }} From d87a064c4220cc2498b1282f3d7bd69ef8782745 Mon Sep 17 00:00:00 2001 From: noahdietz Date: Mon, 24 Oct 2022 11:48:27 -0700 Subject: [PATCH 11/13] Revert "Revert "TEST"" This reverts commit 6c07012b1a3aab17c33f4ec414ba8d0c39c81d53. --- asset/apiv1/doc.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/asset/apiv1/doc.go b/asset/apiv1/doc.go index 599f176b186..254691acb1c 100644 --- a/asset/apiv1/doc.go +++ b/asset/apiv1/doc.go @@ -79,8 +79,7 @@ // // To close the open connection, use the Close() method. // -// For information about setting deadlines, reusing contexts, and more -// please visit https://pkg.go.dev/cloud.google.com/go. +// For information about settin package asset // import "cloud.google.com/go/asset/apiv1" import ( From 5f76216397bca6cbba4ef05956bd08201449b3fc Mon Sep 17 00:00:00 2001 From: noahdietz Date: Mon, 24 Oct 2022 11:49:59 -0700 Subject: [PATCH 12/13] fix non-skip case --- .github/workflows/apidiff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml index ef21120abba..31fe9381944 100644 --- a/.github/workflows/apidiff.yml +++ b/.github/workflows/apidiff.yml @@ -26,7 +26,7 @@ jobs: else for d in $dirs; do list=${list},\"${d}\"; done echo "changed={\"changed\":[${list#,}]}" >> $GITHUB_OUTPUT - echo "skip=0" >> $GITHUB_OUTPUT + echo "skip=" >> $GITHUB_OUTPUT fi outputs: changed_dirs: ${{ steps.changed_dirs.outputs.changed }} From f1d23f98120d11a018ba4f4a38c0dfaef714d66b Mon Sep 17 00:00:00 2001 From: noahdietz Date: Mon, 24 Oct 2022 11:51:06 -0700 Subject: [PATCH 13/13] Revert "Revert "Revert "TEST""" This reverts commit d87a064c4220cc2498b1282f3d7bd69ef8782745. --- asset/apiv1/doc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/asset/apiv1/doc.go b/asset/apiv1/doc.go index 254691acb1c..599f176b186 100644 --- a/asset/apiv1/doc.go +++ b/asset/apiv1/doc.go @@ -79,7 +79,8 @@ // // To close the open connection, use the Close() method. // -// For information about settin +// For information about setting deadlines, reusing contexts, and more +// please visit https://pkg.go.dev/cloud.google.com/go. package asset // import "cloud.google.com/go/asset/apiv1" import (