Skip to content

Conversation

@connoraird
Copy link
Contributor

Description

Migrated over from glass-dev/glass-benchmarks#23 and #776

To allow writing a comment on a PR if the regression tests fail, this PR extracts the relevant lines from the regression test failure message to then post in a PR comment.

Closes: #783

Changelog entry

Added: PR comment from failing regression test

Checks

  • Is your code passing linting?
  • Is your code passing tests?
  • Have you added additional tests (if required)?
  • Have you modified/extended the documentation (if required)?
  • Have you added a one-liner changelog entry above (if required)?

Comment on lines 67 to 73
f=$REGRESSION_TEST_OUTPUT_FILE; start=$(grep -n -m1 'Performance has
regressed:' "$f" | cut -d: -f1)
|| { echo "No match"; exit 1; };
s_dash=$(awk -v n=$start 'NR<=n && /^-+$/ {l=NR} END{print l}' "$f");
e_dash=$(awk -v n=$start 'NR>=n && /^-+$/ {print NR; exit}' "$f");
PR_COMMENT_MSG=$(sed -n "${s_dash},${e_dash}p" "$f"); echo
"PR_COMMENT_MSG=$PR_COMMENT_MSG" >> $GITHUB_OUTPUT;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job working this out 😆 just wonder how maintainable this is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH it was a ChatGPT job, with some tweaks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want some extra comments so we can at least try to reproduce in a different way in the future, if needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm starting to go off the idea really, based on today's meeting

Copy link
Contributor Author

@connoraird connoraird Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the PR comment not give us good traceability if we discover a significant performance regression in the future?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but should we be merging those anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking of the scenario were we've deemed it acceptable but then in the future we change our mind. Or to catch the case where our benchmarks weren't thorough enough to show the actual extent of the problem.

@paddyroddy paddyroddy added the needs-2-reviewers Could be considered "controversial" so worth a second pair of eyes label Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmarks Benchmarking work needs-2-reviewers Could be considered "controversial" so worth a second pair of eyes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add PR comment if regression tests fail

3 participants