From 6baea367a0a557e7a1a81c280dafc8324dcfafe9 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Thu, 19 Sep 2024 10:35:46 +0200 Subject: [PATCH] ci: consider only pull request event when running public-symbols-check (#4195) * CONTRIBUTING: the label is called "Approve Public API check" * ci: consider only pull request event when running public-symbols-check --- .github/workflows/misc_0.yml | 2 +- CONTRIBUTING.md | 2 +- scripts/public_symbols_checker.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/misc_0.yml b/.github/workflows/misc_0.yml index 83907a44aef..7de8653a12b 100644 --- a/.github/workflows/misc_0.yml +++ b/.github/workflows/misc_0.yml @@ -147,7 +147,7 @@ jobs: runs-on: ubuntu-latest if: | !contains(github.event.pull_request.labels.*.name, 'Approve Public API check') - && github.actor != 'opentelemetrybot' + && github.actor != 'opentelemetrybot' && github.event_name == 'pull_request' steps: - name: Checkout repo @ SHA - ${{ github.sha }} uses: actions/checkout@v4 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f9fe6b641cd..81376baeba5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,7 +82,7 @@ Every public symbol is something that has to be kept in order to maintain backwa To check if your PR is adding public symbols, run `tox -e public-symbols-check`. This will always fail if public symbols are being added/removed. The idea behind this is that every PR that adds/removes public symbols fails in CI, forcing reviewers to check the symbols to make sure they are strictly necessary. -If after checking them, it is considered that they are indeed necessary, the PR will be labeled with `Skip Public API check` so that this check is not +If after checking them, it is considered that they are indeed necessary, the PR will be labeled with `Approve Public API check` so that this check is not run. Also, we try to keep our console output as clean as possible. Most of the time this means catching expected log messages in the test cases: diff --git a/scripts/public_symbols_checker.py b/scripts/public_symbols_checker.py index c8bf7fd22e7..7dd9b5d309d 100644 --- a/scripts/public_symbols_checker.py +++ b/scripts/public_symbols_checker.py @@ -139,7 +139,7 @@ def remove_common_symbols(): print( "Please make sure that all of them are strictly necessary, if not, " "please consider prefixing them with an underscore to make them " - 'private. After that, please label this PR with "Skip Public API ' + 'private. After that, please label this PR with "Approve Public API ' 'check".' ) print() @@ -154,7 +154,7 @@ def remove_common_symbols(): print( "Please make sure no public symbols are removed, if so, please " "consider deprecating them instead. After that, please label this " - 'PR with "Skip Public API check".' + 'PR with "Approve Public API check".' ) exit(1) else: