Browse Source

ci: workflows: check for manifest dnm in the manifest workflow

The current CI setup sets the manifest DNM label in a workflow and
checks it in a different workflow. The one performing the check is
configured to rerun on label changes but it's been reported few times
that the rerun logic does not seem to always run effectively and there's
been cases where the manifest has been fixed but the label has not been
removed by the automation, resulting in a stale PR.

Since the manifest has its own dedicated label, fix this race condition
by checking for that label specifically in the manifest workflow rather
than in a separate one, this means that the check is always performed
after the script that sets the label.

It also means that on manifest changes the manifest step itself will
fail rather than the PR metadata check one.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
pull/88808/head
Fabio Baltieri 3 months ago committed by Benjamin Cabé
parent
commit
370e0882cb
  1. 7
      .github/workflows/manifest.yml
  2. 1
      .github/workflows/pr_metadata_check.yml

7
.github/workflows/manifest.yml

@ -53,3 +53,10 @@ jobs:
verbosity-level: '1' verbosity-level: '1'
labels: 'manifest' labels: 'manifest'
dnm-labels: 'DNM (manifest)' dnm-labels: 'DNM (manifest)'
- name: Check for label
if: ${{ contains(github.event.*.labels.*.name, 'DNM (manifest)') }}
run: |
echo "Pull request is labeled as 'DNM (manifest)'."
echo "This workflow fails so that the pull request cannot be merged."
exit 1

1
.github/workflows/pr_metadata_check.yml

@ -20,7 +20,6 @@ jobs:
steps: steps:
- name: Check for label - name: Check for label
if: ${{ contains(github.event.*.labels.*.name, 'DNM') || if: ${{ contains(github.event.*.labels.*.name, 'DNM') ||
contains(github.event.*.labels.*.name, 'DNM (manifest)') ||
contains(github.event.*.labels.*.name, 'TSC') || contains(github.event.*.labels.*.name, 'TSC') ||
contains(github.event.*.labels.*.name, 'Architecture Review') || contains(github.event.*.labels.*.name, 'Architecture Review') ||
contains(github.event.*.labels.*.name, 'dev-review') }} contains(github.event.*.labels.*.name, 'dev-review') }}

Loading…
Cancel
Save