Skip to content

Conversation

@nagilson
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings December 10, 2025 18:46
@nagilson nagilson closed this Dec 10, 2025
Copy link
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

This PR adds automated GitHub Actions workflows that allow maintainers to update translation files and CLI completion snapshots directly from pull request comments. The workflows respond to /updatexlf and /fixcompletions commands, eliminating the need to clone branches locally for these common maintenance tasks.

Key Changes

  • Added two comment-triggered GitHub Actions workflows for automated PR maintenance
  • Updated documentation to describe the new /updatexlf and /fixcompletions commands
  • Workflows automatically build, test, update files, and commit changes back to the PR branch

Reviewed changes

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

Show a summary per file
File Description
.github/workflows/update-xlf-on-comment.yml New workflow that runs UpdateXlf build target and commits updated translation files when /updatexlf is commented on a PR
.github/workflows/fix-completions-on-comment.yml New workflow that runs completion tests, updates snapshot files, and commits them when /fixcompletions is commented on a PR
documentation/project-docs/snapshot-based-testing.md Added section documenting the /fixcompletions workflow with usage instructions
documentation/project-docs/developer-guide.md Added "Automated PR Maintenance Commands" section documenting both /updatexlf and /fixcompletions workflows
documentation/project-docs/Localization.md Added section documenting the /updatexlf workflow for updating translation files

id: compare
if: steps.test.outcome != 'skipped'
run: |
dotnet restore test/dotnet.Tests/ /t:CompareCliSnapshots
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The dotnet restore command is being used with MSBuild targets /t:CompareCliSnapshots, but dotnet restore doesn't accept MSBuild target parameters in this way. This should be dotnet build or dotnet msbuild instead.

Copilot uses AI. Check for mistakes.
if: steps.check-changes.outputs.changes == 'true'
run: |
# This renames .received.* files to .verified.*
dotnet restore test/dotnet.Tests/ /t:UpdateCliSnapshots
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The dotnet restore command is being used with MSBuild target /t:UpdateCliSnapshots, but dotnet restore doesn't accept MSBuild target parameters in this way. This should be dotnet build or dotnet msbuild instead.

Suggested change
dotnet restore test/dotnet.Tests/ /t:UpdateCliSnapshots
dotnet msbuild test/dotnet.Tests/ /t:UpdateCliSnapshots

Copilot uses AI. Check for mistakes.
if: steps.compare.outcome == 'success'
run: |
# Check if there are changes to snapshot files
if git diff --name-only test/dotnet.Tests/CompletionTests/snapshots/ | grep -E '\.received\.'; then
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The grep pattern \.received\. will fail when there are no matching files, causing the conditional to incorrectly report false. Consider using grep -qE '\.received\.' with an || true suffix, or restructure to use git diff --name-only | grep -qE '\.received\.' && echo "changes=true" || echo "changes=false".

Suggested change
if git diff --name-only test/dotnet.Tests/CompletionTests/snapshots/ | grep -E '\.received\.'; then
if git diff --name-only test/dotnet.Tests/CompletionTests/snapshots/ | grep -qE '\.received\.'; then

Copilot uses AI. Check for mistakes.
if: steps.check-changes.outputs.changes == 'true'
run: |
# This renames .received.* files to .verified.*
dotnet restore test/dotnet.Tests/ /t:UpdateCliSnapshots
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

This step uses the system dotnet instead of the repo-local ./.dotnet/dotnet that was built in the previous step. For consistency with the test step (line 55), consider using ./.dotnet/dotnet here as well.

Suggested change
dotnet restore test/dotnet.Tests/ /t:UpdateCliSnapshots
./.dotnet/dotnet restore test/dotnet.Tests/ /t:UpdateCliSnapshots

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.

1 participant