Skip to content

Commit 9fd30f6

Browse files
committed
Allow ARM Auto-Signoff for incremental TypeSpec even when NotReadyForARMReview
- Remove NotReadyForARMReview check from arm-auto-signoff workflow - Update summarize-checks to respect auto-signoff labels and prevent ping-pong - Add incremental TypeSpec test: department and jobTitle properties
1 parent a945ab6 commit 9fd30f6

5 files changed

Lines changed: 22 additions & 5 deletions

File tree

.github/workflows/arm-auto-signoff-status.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ jobs:
4949
github.event.label.name == 'ARMAutoSignedOff-Trivial' ||
5050
github.event.label.name == 'ARMReview' ||
5151
github.event.label.name == 'ARMSignedOff' ||
52-
github.event.label.name == 'NotReadyForARMReview' ||
5352
github.event.label.name == 'SuppressionReviewRequired'))
5453
5554
runs-on: ubuntu-slim

.github/workflows/src/arm-auto-signoff/arm-auto-signoff-status.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ export async function getLabelActionImpl({ owner, repo, issue_number, head_sha,
157157

158158
const allLabelsMatch =
159159
labelNames.includes("ARMReview") &&
160-
!labelNames.includes("NotReadyForARMReview") &&
161160
(!labelNames.includes("SuppressionReviewRequired") ||
162161
labelNames.includes("Approved-Suppression"));
163162

.github/workflows/src/summarize-checks/labelling.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,18 +659,31 @@ function processARMReviewWorkflowLabels(
659659

660660
const blocked = blockedOnRpaas || blockedOnVersioningPolicy || blockedOnArmModeling;
661661

662+
// Check if ARM auto-signoff workflow has determined the PR qualifies for auto sign-off.
663+
// If so, respect that decision and don't remove ARMSignedOff even when blocked.
664+
// This prevents ping-pong between arm-auto-signoff and summarize-checks workflows.
665+
const hasAutoSignedOffLabels =
666+
labelContext.present.has("ARMAutoSignedOff") ||
667+
labelContext.present.has("ARMAutoSignedOff-IncrementalTSP") ||
668+
labelContext.present.has("ARMAutoSignedOff-Trivial");
669+
670+
const autoSignedOff = hasAutoSignedOffLabels && armSignedOffLabel.present;
671+
662672
// If given PR is in scope of ARM review and it is blocked for any reason,
663673
// the "NotReadyForARMReview" label should be present, to the exclusion
664674
// of all other ARM review workflow labels.
665-
notReadyForArmReviewLabel.shouldBePresent = armReviewLabelShouldBePresent && blocked;
675+
// Exception: If auto-signoff has determined the PR qualifies, ARMSignedOff takes precedence.
676+
notReadyForArmReviewLabel.shouldBePresent =
677+
armReviewLabelShouldBePresent && blocked && !autoSignedOff;
666678

667679
// If given PR is in scope of ARM review and the review is not blocked,
668680
// then "ARMSignedOff" label should remain present on the PR if it was
669681
// already present. This means that labels "ARMChangesRequested"
670682
// and "WaitForARMFeedback" are invalid and will be removed by automation
671683
// in presence of "ARMSignedOff".
684+
// Also preserve ARMSignedOff if auto-signoff labels are present (even when blocked).
672685
armSignedOffLabel.shouldBePresent =
673-
armReviewLabelShouldBePresent && !blocked && armSignedOffLabel.present;
686+
armReviewLabelShouldBePresent && (!blocked || autoSignedOff) && armSignedOffLabel.present;
674687

675688
// If given PR is in scope of ARM review and the review is not blocked and
676689
// not signed-off, then the label "ARMChangesRequested" should remain present

.github/workflows/test/arm-auto-signoff/arm-auto-signoff-status.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ describe("getLabelActionImpl", () => {
290290

291291
it.each([
292292
{ labels: ["ARMAutoSignedOff-IncrementalTSP"] },
293-
{ labels: ["ARMAutoSignedOff-IncrementalTSP", "ARMReview", "NotReadyForARMReview"] },
293+
// NotReadyForARMReview check removed - no longer blocks auto-signoff
294294
{ labels: ["ARMAutoSignedOff-IncrementalTSP", "ARMReview", "SuppressionReviewRequired"] },
295295
])("removes label if not all labels match ($labels)", async ({ labels }) => {
296296
const github = createMockGithub({ incrementalTypeSpec: true });

specification/widget/resource-manager/Microsoft.Widget/Widget/employee.tsp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ model EmployeeProperties {
2323
/** City of employee */
2424
city?: string;
2525

26+
/** Department where the employee works */
27+
department?: string;
28+
29+
/** Job title of the employee */
30+
jobTitle?: string;
31+
2632
/** Profile of employee */
2733
@encode("base64url")
2834
profile?: bytes;

0 commit comments

Comments
 (0)