Skip to content

CI: run the tests when the code comparison fails - issue #1750 - #1751

Merged
amjjbonvin merged 1 commit into
mainfrom
ci-compare-failure-1750
Oct 29, 2026
Merged

amjjbonvin merged 1 commit into
mainfrom
ci-compare-failure-1750

Conversation

@amjjbonvin

Copy link
Copy Markdown
Member

Before submitting, read the contributing guidelines and the AI policy.

What does this PR do and why?

The step added in #1749, which compares the PR's code between pushes, runs with GitHub's default bash -e, without pipefail. A failing git merge-base or git diff inside patch_id was hidden by the pipe: both patch ids were empty, hence equal, and the tests were skipped whenever they had passed on the previous head, although the code may have changed.

  • set -o pipefail in the script.
  • Each patch id is computed in a checked command: any failure to fetch or compare the commits runs the tests.

How was this tested?

The step's script, extracted from the workflow, run locally with bash -e (as on GitHub) on commits of #1745:

  • code changed but base commit unresolvable: the current version skips the tests (skip=true), the fixed one runs them (skip=false);
  • merge of main after a fully tested push: still skipped;
  • code change: tested;
  • unknown commit: tested.

AI assistance

Claude Code found the problem while porting #1749 to disvis and powerfit, wrote the fix and checked it as described above. I reviewed the changes.

Checklist

  • Tests cover the new and/or changed code (CI only; tested locally as described)
  • Documentation updated if needed (also in the haddock3 user-manual) (not needed)
  • CHANGELOG.md updated for user-facing changes (not user-facing)

Related issues

Closes #1750

Notes for reviewers

Same fix as in haddocking/disvis#38 and haddocking/powerfit#155.

🤖 Generated with Claude Code

The step comparing the PR's code between pushes ran with bash -e but
without pipefail, so that a failing git merge-base or git diff gave two
empty, hence equal, patch ids: the tests were then skipped whenever they
had passed on the previous head, although the code may have changed. Set
pipefail and compute each patch id in a checked command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@amjjbonvin
amjjbonvin merged commit d67d8a5 into main Oct 29, 2026
5 checks passed
@amjjbonvin
amjjbonvin deleted the ci-compare-failure-1750 branch October 29, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: a failed code comparison can skip the tests

1 participant