New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: Update framework coverage difference commenter #14517
CI: Update framework coverage difference commenter #14517
Conversation
…to always fail with a 'list index out of bounds' error
af7ad50
to
ee4a9c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Some minor suggestions to make the script more robust -- let me know if you want to talk them through in more detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Optional suggestion only.
Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com>
|
Thanks @adityasharad! I've applied your suggestion, can you re-approve when you have a chance? 🙏 |
Description
The framework coverage difference commenter currently posts a new comment after new commits. When there are a lot of these comments on a PR, it can be hard to find comments from reviewers. This PR changes the workflow so that it updates one comment box instead of creating multiple comments.
Note: this code is based on the QHelp preview comment workflow which updates one comment box. The first commit 9263cfd is based on this code in qhelp-pr-preview.yml. The second commit 6e29b70 is based on this code in post-pr-comment.yml.
This PR also fixes a bug ee4a9c3 that was causing a 'list index out of range' error in the pre-existing
get_previous_run_idfunction.f"branch='{pr_branch}'"resulted in incorrect branch names such as'branch='"'"'test-commenting'"'"''due to apparent escaping of the single quotes, and thesubprocess_check_outputcall always returned an empty list as a result since the branch name was incorrect. Changing this code tof"branch={pr_branch}"seems to resolve the issue.Testing
I've tested these changes on https://github.com/dsp-testing/codeql-framework-coverage-pr-commenter/pull/27 (let me know if you don't have access to this PR).
get_previous_run_idfunction. It does not change any MaD models, so the diff is the same as the prior run, and the comment is not updated (workflow run).