Background
The management review workflow exists in both azure-sdk-for-go and azure-sdk-for-js (.github/workflows/mgmt-review.md). The JS version has a much smoother re-run experience than the Go version, driven by three cooperating mechanisms.
How JS supports re-running
1. Two trigger entry points — the JS workflow can be started either by the mgmt-review-needed label or manually via workflow_dispatch (with a PR number item_number input):
on:
pull_request_target:
types: [labeled]
forks: ["*"]
workflow_dispatch:
inputs:
item_number:
description: PR number to run the review on
required: true
type: string
...
if: github.event.label.name == 'mgmt-review-needed' || github.event_name == 'workflow_dispatch'
2. Label state machine (consume-on-start) — on start, a github-script step removes the mgmt-review-needed trigger label and adds mgmt-review-in-progress; on completion it swaps to mgmt-review-added. Because the trigger label is consumed at the start, re-running is simply re-applying mgmt-review-needed (a single action), and the label never lingers ambiguously.
3. Concurrency with cancel-in-progress — a new run for the same PR cancels the previous in-flight run:
concurrency:
group: "gh-aw-${{ github.workflow }}-${{ ...pr number... }}-${{ github.event.label.name || '' }}"
cancel-in-progress: true
Current Go behavior (the problem)
The Go workflow has none of the above:
- Only triggered by the
mgmt-review-needed label; no workflow_dispatch manual entry point.
- No label state machine — the label stays
mgmt-review-needed after the run, so there is no visible "in-progress / done" state.
- To re-run, the docs (Step 2 and Step 5) instruct users to remove and then re-add
mgmt-review-needed — a two-step, ambiguous action.
- No
cancel-in-progress, so duplicate/overlapping runs are not cancelled.
Proposed change
Port the JS re-run model to the Go workflow:
- Add a
workflow_dispatch trigger (with a PR number input) and update the if condition to accept it.
- Add a consume-on-start label state machine (
mgmt-review-needed → mgmt-review-in-progress → mgmt-review-analyzed), so re-running becomes a single "re-apply mgmt-review-needed" action.
- Add
concurrency with cancel-in-progress: true to cancel superseded runs.
- Update Step 2 / Step 5 wording from "remove and re-add" to "re-apply
mgmt-review-needed".
Requires
permissions.pull-requests: write (currently read).
add-labels / remove-labels in safe-outputs.
- New repo labels:
mgmt-review-in-progress, mgmt-review-analyzed.
Reference
- JS implementation:
azure-sdk-for-js/.github/workflows/mgmt-review.md
Background
The management review workflow exists in both
azure-sdk-for-goandazure-sdk-for-js(.github/workflows/mgmt-review.md). The JS version has a much smoother re-run experience than the Go version, driven by three cooperating mechanisms.How JS supports re-running
1. Two trigger entry points — the JS workflow can be started either by the
mgmt-review-neededlabel or manually viaworkflow_dispatch(with a PR numberitem_numberinput):2. Label state machine (consume-on-start) — on start, a
github-scriptstep removes themgmt-review-neededtrigger label and addsmgmt-review-in-progress; on completion it swaps tomgmt-review-added. Because the trigger label is consumed at the start, re-running is simply re-applyingmgmt-review-needed(a single action), and the label never lingers ambiguously.3. Concurrency with cancel-in-progress — a new run for the same PR cancels the previous in-flight run:
Current Go behavior (the problem)
The Go workflow has none of the above:
mgmt-review-neededlabel; noworkflow_dispatchmanual entry point.mgmt-review-neededafter the run, so there is no visible "in-progress / done" state.mgmt-review-needed— a two-step, ambiguous action.cancel-in-progress, so duplicate/overlapping runs are not cancelled.Proposed change
Port the JS re-run model to the Go workflow:
workflow_dispatchtrigger (with a PR number input) and update theifcondition to accept it.mgmt-review-needed → mgmt-review-in-progress → mgmt-review-analyzed), so re-running becomes a single "re-applymgmt-review-needed" action.concurrencywithcancel-in-progress: trueto cancel superseded runs.mgmt-review-needed".Requires
permissions.pull-requests: write(currentlyread).add-labels/remove-labelsinsafe-outputs.mgmt-review-in-progress,mgmt-review-analyzed.Reference
azure-sdk-for-js/.github/workflows/mgmt-review.md