Skip to content

Commit

Permalink
ci: Avoid suggesting unnecessary baseline updates (#37158)
Browse files Browse the repository at this point in the history
When checking for baselines that need updating due to fixed issues, we
ignore the "issue statistics" comment at the top of the file so as to
not make people have to update the baselines unnecessarily.

However, if one project has a real update needed while a different one
has only comments, we're still instructing the author to update both of
them even though only the former is needed.

Let's not do that.
  • Loading branch information
anomiex authored May 1, 2024
1 parent dc3e392 commit 385d636
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,19 @@ jobs:
pnpm jetpack phan --all -v --format github
- name: Check baselines
run: |
# Anything changed (with a side of printing the diff)
# Anything changed? (with a side of printing the diff)
if git diff --exit-code --ignore-matching-lines='^ // ' -- .phan/baseline.php '*/.phan/baseline.php'; then
exit 0
fi
# Collect which projects changed to suggest the right command.
PROJECTS=()
for f in $( git -c core.quotepath=off diff --name-only -- .phan/baseline.php '*/.phan/baseline.php' ); do
# --name-only and --ignore-matching-lines don't combine, so we have to do the check separately.
if git diff --quiet --exit-code --ignore-matching-lines='^ // ' -- "$f"; then
continue
fi
if [[ "$f" == ".phan/baseline.php" ]]; then
SLUG=monorepo
elif [[ "$f" == projects/*/*/.phan/baseline.php ]]; then
Expand Down

0 comments on commit 385d636

Please sign in to comment.