Skip to content

update mgmt-review workflow to support auto-formatting and enhance safe outputs configuration#38716

Open
skywing918 wants to merge 8 commits into
mainfrom
formatAutoFix
Open

update mgmt-review workflow to support auto-formatting and enhance safe outputs configuration#38716
skywing918 wants to merge 8 commits into
mainfrom
formatAutoFix

Conversation

@skywing918
Copy link
Copy Markdown
Contributor

@skywing918 skywing918 commented May 28, 2026

fixes #38663

This pull request introduces a new workflow for automated formatting fixes on SDK packages and integrates it into the management review system. The changes enable the review workflow to trigger the new formatting workflow as an auto-fix step, improving automation and developer experience. The most important changes are grouped below:

New Workflow for Automated Formatting Fixes:

  • Added .github/workflows/format-auto-fix.yml, a workflow that can be manually triggered to run pnpm format on only the affected SDK packages in a pull request, committing and pushing any needed formatting changes.

Integration with Management Review Workflow:

  • Updated .github/workflows/mgmt-review.lock.yml to:
    • Add the dispatch_workflow tool (specifically for the format-auto-fix workflow) to the list of safe output tools, including its configuration, permissions, and dynamic tool schema. [1] [2] [3] [4] [5] [6]
    • Update prompt and config section references to include the new tool and ensure proper workflow dispatch integration. [1] [2] [3] [4]

Safe Outputs and Documentation Updates:

  • Modified .github/workflows/mgmt-review.md to declare dispatch-workflow as a safe output tool (for format-auto-fix) and clarified that the failure list is used for both auto-fix attempts and the final PR comment. [1] [2]

Metadata Updates:

  • Updated metadata and manifest hashes in .github/workflows/mgmt-review.lock.yml to reflect the new tool and workflow integration.

These changes collectively enable the management review workflow to automatically trigger formatting fixes on PRs, streamlining the review and merge process.
image

SDK Format Auto-Fix

https://github.com/skywing918/azure-sdk-for-js/actions/runs/26567029742

Test PR

skywing918#21

Copilot AI review requested due to automatic review settings May 28, 2026 07:47
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 an auto-formatting workflow that the management-review agentic workflow can dispatch when it detects Check-format FAILED, replacing the previous "ask the contributor to run pnpm format" guidance with a label-triggered auto-fix.

Changes:

  • New format-auto-fix.yml workflow that resolves the target PR (via workflow_dispatch input or by scanning open PRs for auto-format-needed), checks out the PR branch, runs pnpm format on changed sdk/ packages, and pushes the fix.
  • Updated mgmt-review.md frontmatter to allow dispatch-workflow: [format-auto-fix] and raise add-labels.max from 1 to 2, plus new Step 3 / template / mapping changes that direct the agent to label + dispatch instead of asking the contributor to format locally.
  • Regenerated mgmt-review.lock.yml to expose dispatch_workflow, add_labels(max:2), dynamic format_auto_fix tool, and add actions: write to the conclusion and safe_outputs jobs.

Reviewed changes

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

File Description
.github/workflows/format-auto-fix.yml New workflow that finds the target PR, runs pnpm format on affected sdk packages, commits/pushes, and posts a result comment.
.github/workflows/mgmt-review.md Adds dispatch-workflow safe output, bumps add-labels.max to 2, and rewrites Check-format guidance / Step 3 / output template to use the label + dispatch flow.
.github/workflows/mgmt-review.lock.yml Compiled output reflecting the new safe outputs (dispatch tool, add_labels(max:2), actions: write on conclusion and safe_outputs jobs).

Comment thread .github/workflows/format-auto-fix.yml Outdated
Comment thread .github/workflows/format-auto-fix.yml Outdated
Comment thread .github/workflows/format-auto-fix.yml
Comment thread .github/workflows/format-auto-fix.yml Outdated
Comment thread .github/workflows/format-auto-fix.yml
Comment thread .github/workflows/format-auto-fix.yml
Comment thread .github/workflows/format-auto-fix.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@skywing918 skywing918 marked this pull request as draft May 28, 2026 08:06
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 6 comments.

Comment thread .github/workflows/format-auto-fix.yml Outdated
Comment thread .github/workflows/format-auto-fix.yml Outdated
Comment thread .github/workflows/mgmt-review.md Outdated
Comment thread .github/workflows/mgmt-review.md
Comment thread .github/workflows/format-auto-fix.yml Outdated
Comment thread .github/workflows/format-auto-fix.yml Outdated
skywing918 and others added 4 commits May 28, 2026 17:44
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@skywing918 skywing918 marked this pull request as ready for review May 28, 2026 10:37
@skywing918 skywing918 requested a review from jeremymeng May 29, 2026 01:36
Comment thread .github/workflows/format-auto-fix.yml Outdated
Comment thread .github/workflows/format-auto-fix.yml Outdated
Comment thread .github/workflows/format-auto-fix.yml Outdated
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.

Automate fixes for auto-generated PRs that need follow-up changes

3 participants