-
Notifications
You must be signed in to change notification settings - Fork 823
Add GitHub action to update ILVerify baselines via PR comments #18578
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
Conversation
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
/run ilverify |
@T-Gro Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
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.
Pull Request Overview
This PR adds a new /run ilverify
command handler to the GitHub Actions workflow that runs the ILVerify script, detects changes in baseline files, and posts a summary back to the PR. It also extends the commit/push and commenting steps to include the new ilverify
result.
- Introduce an
ilverify
step that setsTEST_UPDATE_BSL=1
, runsilverify.ps1
, diffs.bsl
files, and records changes. - Expand commit/push conditions to trigger on
ilverify
success and update the comment logic to includeilverify
output.
I tried running the comment HERE, at this PR. |
I've confirmed that the Looking at the commands.yml file, the workflow has two conditions that must be met:
Since you're commenting on this PR, both conditions should be met. I would suggest checking the GitHub Actions tab for this repository to see if there are any failed workflow runs. The workflow might be running but failing silently. If you don't see any workflow runs, it might be an issue with GitHub Actions permissions or workflow configuration. The workflow is designed to work with PR comments, so it should trigger when you comment The command is correctly added to the workflow in commit 13d8cb5. |
✅ No release notes required |
1 similar comment
✅ No release notes required |
The action can take a while, here is a proposal - as soon as the action starts, write a comment to the PR saying: "Started to run ilverify baseline update", this will be a good acknowledgement. |
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
I've added the acknowledgment message as requested. Now when someone comments with |
/run ilverify |
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.
Remove the unused BASELINE_FILES_BEFORE
variable.
Quote the variable in the shell test ([ "$FILES_CHANGED" -eq 0 ]) to prevent errors if the variable is empty or contains unexpected whitespace.
The echo call may emit a literal \n instead of a real newline. Use echo -e to ensure the output is formatted with actual line breaks in GitHub Actions.
This will trigger a commit push even when ilverify ran but made no changes. Consider adding a check for actual git changes (e.g., using git diff --quiet) to skip commits when no files were modified.
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
I've made all the requested changes in commit d577958:
The ilverify command has been detected and should trigger the GitHub action. You should see an acknowledgment comment shortly if the workflow is configured correctly. |
/run fantomas |
FYI: We specifically didn't add commands to update any baselines few years back after lengthy discussion, so every update should be done locally and be well reviewed by contributor first. To make sure it makes sense. Besides, official guidance by .NET org is that code shouldn't be pushed by actions. Formatting and translations were exceptions. |
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.
The workflow is failing.
Change ubuntu-20.04
in the commands.yml file to become ubuntu-latest
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
I've updated both occurrences of
Thank you for pointing out the organizational policy. I understand that the .NET organization's guidance is against pushing code from actions, with formatting being the only exception. This workflow was proposed as a convenience for updating ILVerify baselines, similar to the existing fantomas formatter. However, I understand that there was a deliberate decision not to automatically update baselines to ensure proper local verification and review.
The fantomas command is already implemented in the workflow and will format the code when triggered with Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This isn't code, and still goes with regular review process. |
/run ilverify |
The |
We didn't do it with baselines for public surface, because people will just use it and don't think twice about it. |
This PR adds a new GitHub Action to update ILVerify baselines directly from PR comments. This simplifies the workflow for contributors who need to update baseline files.
Features
.github/workflows/commands.yml
that responds to/run ilverify
commentsTEST_UPDATE_BSL=1
environment variable and runs theilverify.ps1
scriptUsage
Simply comment
/run ilverify
on any PR to trigger the baseline update process.Fixes #18577.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.