Skip to content

Add automatic comment when autofix fails because of regress.yml#1767

Open
dhower-qc wants to merge 12 commits intoriscv:mainfrom
dhower-qc:autofix-pr-comment-handler
Open

Add automatic comment when autofix fails because of regress.yml#1767
dhower-qc wants to merge 12 commits intoriscv:mainfrom
dhower-qc:autofix-pr-comment-handler

Conversation

@dhower-qc
Copy link
Copy Markdown
Collaborator

No description provided.

@dhower-qc dhower-qc requested a review from ThinkOpenly as a code owner March 26, 2026 14:38
Copilot AI review requested due to automatic review settings March 26, 2026 14:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds CI automation to detect when ./bin/chore gen all regenerates .github/workflows/regress.yml during autofix.ci, and posts an explanatory PR comment when the autofix run fails in that situation.

Changes:

  • Record and compare a hash of .github/workflows/regress.yml before/after ./bin/chore gen all, and upload the result as a small artifact.
  • Add a new workflow_run-triggered workflow that downloads the artifact and comments on the PR when the autofix workflow fails and regress.yml was regenerated.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/autofix.yaml Captures whether regress.yml changed during generation and uploads the result for downstream consumption.
.github/workflows/autofix-comment.yml On failed autofix.ci runs, downloads the artifact and posts a PR comment with remediation steps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 26, 2026 14:50
@dhower-qc dhower-qc review requested due to automatic review settings March 26, 2026 14:50
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.08%. Comparing base (8e33f83) to head (9c3dfd0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1767      +/-   ##
==========================================
+ Coverage   71.97%   72.08%   +0.11%     
==========================================
  Files          55       55              
  Lines       28009    28009              
  Branches     6183     6183              
==========================================
+ Hits        20159    20190      +31     
+ Misses       7850     7819      -31     
Flag Coverage Δ
idlc 75.90% <ø> (ø)
udb 66.17% <ø> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Derek Hower <dhower@qti.qualcomm.com>
Copilot AI review requested due to automatic review settings March 26, 2026 15:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 26, 2026 17:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dhower-qc
Copy link
Copy Markdown
Collaborator Author

@copilot apply changes based on the comments in this thread

Copilot AI review requested due to automatic review settings March 27, 2026 14:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 27, 2026 15:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

begin
real_resolver
@real_db_available = true
rescue => e
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

In real_db_available?, the rescue => e assigns an exception to e but never uses it. This can trigger RuboCop’s useless assignment/unused variable cops and adds noise. Consider changing it to rescue (or rescue StandardError) without binding the exception unless you plan to log it under UDB_TEST_FIXTURE_DEBUG.

Suggested change
rescue => e
rescue StandardError

Copilot uses AI. Check for mistakes.
Comment on lines +43 to +52
pr_number="${{ steps.pr.outputs.number }}"
changed_files="$(gh api --paginate \
repos/${{ github.repository }}/pulls/${pr_number}/files \
--jq '.[].filename')"

if echo "$changed_files" | grep -E -q '^(\.github/workflows/regress\.yml|tools/test/regress-tests\.yaml|tools/test/regress-gh-template\.yaml|tools/test/gen_regress\.rb)$'; then
echo "needs_comment=true" >> "$GITHUB_OUTPUT"
else
echo "needs_comment=false" >> "$GITHUB_OUTPUT"
fi
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The workflow currently comments on any autofix.ci failure if the PR changes .github/workflows/regress.yml or one of the regress generator inputs. That can produce a misleading comment when the failure is unrelated to the regress workflow (and it will also comment even when the author already regenerated/committed regress.yml). Consider tightening the condition to only comment when the PR changes the inputs (e.g., tools/test/regress-tests.yaml, tools/test/regress-gh-template.yaml, tools/test/gen_regress.rb) and does not change .github/workflows/regress.yml, or otherwise detect the specific failure cause from the autofix run output.

Copilot uses AI. Check for mistakes.
Comment on lines +86 to +88
gh pr comment "${{ steps.pr.outputs.number }}" \
--repo "${{ github.repository }}" \
--body-file pr-comment.md
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

As written, this job will post a new PR comment every time autofix.ci fails (e.g., after each push), which can spam PR threads. Consider making the comment idempotent (search for an existing comment with a unique marker and update it, or skip posting if one already exists).

Copilot uses AI. Check for mistakes.
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.

2 participants