Skip to content

[summarize-checks] Switch to GitHub Actions #36570

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

Merged
merged 23 commits into from
Aug 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
81beaef
cutover PR
scbedd Aug 5, 2025
8b4ba26
merge main
scbedd Aug 7, 2025
c075fa0
Merge branch 'main' into summarize-checks-cutover
scbedd Aug 7, 2025
85cba33
Merge branch 'main' into summarize-checks-cutover
mikeharder Aug 8, 2025
f7815ee
Merge branch 'main' into summarize-checks-cutover
mikeharder Aug 9, 2025
c2df1cb
Merge branch 'main' into summarize-checks-cutover
mikeharder Aug 9, 2025
45ae380
Merge branch 'main' into summarize-checks-cutover
mikeharder Aug 11, 2025
7e6d481
Merge branch 'main' into summarize-checks-cutover
mikeharder Aug 11, 2025
426ef43
Merge branch 'main' into summarize-checks-cutover
mikeharder Aug 11, 2025
5a310e1
Merge branch 'main' into summarize-checks-cutover
mikeharder Aug 12, 2025
248e4f9
Merge branch 'main' into summarize-checks-cutover
mikeharder Aug 12, 2025
e0779da
fix another test
mikeharder Aug 12, 2025
74034c2
delete watcher workflows
mikeharder Aug 12, 2025
28d9300
[summarize-checks.js] Remove test-ignore
mikeharder Aug 12, 2025
0fbcc23
[set-status.test.js] Remove test-ignore
mikeharder Aug 12, 2025
1011704
comment
mikeharder Aug 12, 2025
c1af4b9
Merge branch 'main' into summarize-checks-cutover
mikeharder Aug 12, 2025
dae2e30
Merge branch 'main' into summarize-checks-cutover
mikeharder Aug 13, 2025
dba86f3
[summarize-checks] remove duplicate param docs
mikeharder Aug 13, 2025
46026e8
Merge branch 'main' into summarize-checks-cutover
mikeharder Aug 13, 2025
ebbf238
Merge branch 'main' into summarize-checks-cutover
mikeharder Aug 13, 2025
7d4ef9d
Merge branch 'summarize-checks-cutover' of https://github.com/Azure/a…
mikeharder Aug 13, 2025
75f0d6f
remove another test-ignore
mikeharder Aug 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 28 additions & 31 deletions .github/workflows/src/summarize-checks/summarize-checks.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// @ts-check

/*
Expand All @@ -19,12 +19,12 @@
*/

// #region imports/constants
import { extractInputs } from "../context.js";
// import { commentOrUpdate } from "../comment.js";
import { execFile } from "../../../shared/src/exec.js";
import { CheckConclusion, PER_PAGE_MAX } from "../../../shared/src/github.js";
import { intersect } from "../../../shared/src/set.js";
import { byDate, invert } from "../../../shared/src/sort.js";
import { commentOrUpdate } from "../comment.js";
import { extractInputs } from "../context.js";
import {
brChRevApproval,
getViolatedRequiredLabelsRules,
Expand Down Expand Up @@ -141,7 +141,8 @@
"Swagger BreakingChange",
"Swagger PrettierCheck",
];
const AUTOMATED_CHECK_NAME = "[TEST-IGNORE] Automated merging requirements met";
const AUTOMATED_CHECK_NAME = "Automated merging requirements met";
const IMPACT_CHECK_NAME = "Summarize PR Impact";
const NEXT_STEPS_COMMENT_ID = "NextStepsToMerge";

/** @type {CheckMetadata[]} */
Expand Down Expand Up @@ -403,24 +404,24 @@

for (const label of labelContext.toRemove) {
core.info(`Removing label: ${label} from ${owner}/${repo}#${issue_number}.`);
// await github.rest.issues.removeLabel({
// owner: owner,
// repo: repo,
// issue_number: issue_number,
// name: label,
// });
await github.rest.issues.removeLabel({
owner: owner,
repo: repo,
issue_number: issue_number,
name: label,
});
}

if (labelContext.toAdd.size > 0) {
core.info(
`Adding labels: ${Array.from(labelContext.toAdd).join(", ")} to ${owner}/${repo}#${issue_number}.`,
);
// await github.rest.issues.addLabels({
// owner: owner,
// repo: repo,
// issue_number: issue_number,
// labels: Array.from(labelContext.toAdd),
// });
await github.rest.issues.addLabels({
owner: owner,
repo: repo,
issue_number: issue_number,
labels: Array.from(labelContext.toAdd),
});
}

// adjust labelNames based on labelsToAdd/labelsToRemove
Expand Down Expand Up @@ -451,20 +452,21 @@
core.summary.write();

// this will remain commented until we're comfortable with the change.
// await commentOrUpdate(
// { github, context, core },
// owner,
// repo,
// issue_number,
// commentName,
// commentBody
// )
await commentOrUpdate(
github,
core,
owner,
repo,
issue_number,
commentBody,
NEXT_STEPS_COMMENT_ID,
);

// finally, update the "Automated merging requirements met" commit status
await updateCommitStatus(github, core, owner, repo, head_sha, automatedChecksMet);

core.info(
`Summarize checks has identified that status of "[TEST-IGNORE] Automated merging requirements met" commit status should be updated to: ${JSON.stringify(automatedChecksMet)}.`,
`Summarize checks has identified that status of "${AUTOMATED_CHECK_NAME}" commit status should be updated to: ${JSON.stringify(automatedChecksMet)}.`,
);
core.summary.addHeading("Automated Checks Met", 2);
core.summary.addCodeBlock(JSON.stringify(automatedChecksMet, null, 2));
Expand Down Expand Up @@ -517,9 +519,6 @@
* @param {string} owner
* @param {string} repo
* @param {number} issue_number
* @param {*} owner
* @param {*} repo
* @param {*} issue_number
* @return {Promise<string[]>}
*/
export async function getExistingLabels(github, owner, repo, issue_number) {
Expand Down Expand Up @@ -731,10 +730,8 @@

const latestCheck = sortedChecks[0];

// just handling both names for ease of integration testing
if (
(latestCheck.name === "[TEST-IGNORE] Summarize PR Impact" ||
latestCheck.name === "Summarize PR Impact") &&
latestCheck.name === IMPACT_CHECK_NAME &&
latestCheck.status === "completed" &&
latestCheck.conclusion === "success"
) {
Expand Down Expand Up @@ -805,7 +802,7 @@
);
}
} else {
requiredCheckNames = ["Summarize PR Impact", "[TEST-IGNORE] Summarize PR Impact"];
requiredCheckNames = [IMPACT_CHECK_NAME];
}

const filteredReqCheckRuns = unifiedCheckRuns.filter(
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/summarize-checks.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: "[TEST-IGNORE] Summarize Checks"
name: "Summarize Checks"

on:
workflow_run:
workflows:
- "\\[TEST-IGNORE\\] Swagger SemanticValidation - Set Status"
- "\\[TEST-IGNORE\\] Swagger ModelValidation - Set Status"
- "\\[TEST-IGNORE\\] Summarize PR Impact"
- "Swagger SemanticValidation - Set Status"
- "Swagger ModelValidation - Set Status"
- "Summarize PR Impact"
- "Swagger Avocado - Set Status"
- "Swagger LintDiff - Set Status"
- "SDK Validation Status"
Expand Down Expand Up @@ -34,7 +34,7 @@
jobs:
run-summarize-checks:
if: ${{ github.event_name == 'pull_request_target' || github.event.workflow_run.conclusion != 'skipped' }}
name: "[TEST-IGNORE] Summarize Checks"
name: "Summarize Checks"
runs-on: ubuntu-24.04

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/summarize-impact.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "[TEST-IGNORE] Summarize PR Impact"
name: "Summarize PR Impact"

on:
pull_request:
Expand All @@ -16,7 +16,7 @@

jobs:
impact:
name: "[TEST-IGNORE] Summarize PR Impact"
name: "Summarize PR Impact"
runs-on: ubuntu-24.04

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/swagger-modelvalidation-code.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "[TEST-IGNORE] Swagger ModelValidation - Analyze Code"
name: "Swagger ModelValidation - Analyze Code"

on: pull_request

Expand All @@ -7,7 +7,7 @@

jobs:
oav:
name: "[TEST-IGNORE] Swagger ModelValidation - Analyze Code"
name: "Swagger ModelValidation - Analyze Code"
runs-on: ubuntu-24.04

steps:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/swagger-modelvalidation-status.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "[TEST-IGNORE] Swagger ModelValidation - Set Status"
name: "Swagger ModelValidation - Set Status"

on:
# Must run on pull_request_target instead of pull_request, since the latter cannot trigger on
Expand All @@ -15,7 +15,7 @@
- labeled
- unlabeled
workflow_run:
workflows: ["\\[TEST-IGNORE\\] Swagger ModelValidation - Analyze Code"]
workflows: ["Swagger ModelValidation - Analyze Code"]
types: [completed]

permissions:
Expand All @@ -30,6 +30,6 @@
name: Set ModelValidation Status
uses: ./.github/workflows/_reusable-set-check-status.yaml
with:
monitored_workflow_name: "[TEST-IGNORE] Swagger ModelValidation - Analyze Code"
required_check_name: "[TEST-IGNORE] Swagger ModelValidation"
monitored_workflow_name: "Swagger ModelValidation - Analyze Code"
required_check_name: "Swagger ModelValidation"
overriding_label: "Approved-ModelValidation"
4 changes: 2 additions & 2 deletions .github/workflows/swagger-semanticvalidation-code.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "[TEST-IGNORE] Swagger SemanticValidation - Analyze Code"
name: "Swagger SemanticValidation - Analyze Code"

on: pull_request

Expand All @@ -7,7 +7,7 @@

jobs:
oav:
name: "[TEST-IGNORE] Swagger SemanticValidation - Analyze Code"
name: "Swagger SemanticValidation - Analyze Code"
runs-on: ubuntu-24.04

steps:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/swagger-semanticvalidation-status.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "[TEST-IGNORE] Swagger SemanticValidation - Set Status"
name: "Swagger SemanticValidation - Set Status"

on:
# Must run on pull_request_target instead of pull_request, since the latter cannot trigger on
Expand All @@ -15,7 +15,7 @@
- labeled
- unlabeled
workflow_run:
workflows: ["\\[TEST-IGNORE\\] Swagger SemanticValidation - Analyze Code"]
workflows: ["Swagger SemanticValidation - Analyze Code"]
types: [completed]

permissions:
Expand All @@ -30,6 +30,6 @@
name: Set SemanticValidation Status
uses: ./.github/workflows/_reusable-set-check-status.yaml
with:
monitored_workflow_name: "[TEST-IGNORE] Swagger SemanticValidation - Analyze Code"
required_check_name: "[TEST-IGNORE] Swagger SemanticValidation"
monitored_workflow_name: "Swagger SemanticValidation - Analyze Code"
required_check_name: "Swagger SemanticValidation"
overriding_label: "Approved-SemanticValidation"
44 changes: 22 additions & 22 deletions .github/workflows/test/set-status.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// @ts-check

import { beforeEach, describe, expect, it } from "vitest";
Expand Down Expand Up @@ -72,8 +72,8 @@
target_url: "https://test.com/set_status_url",
github,
core,
monitoredWorkflowName: "[TEST-IGNORE] Swagger Avocado - Analyze Code",
requiredStatusName: "[TEST-IGNORE] Swagger Avocado",
monitoredWorkflowName: "Swagger Avocado - Analyze Code",
requiredStatusName: "Swagger Avocado",
overridingLabel: "Approved-Avocado",
}),
).resolves.toBeUndefined();
Expand All @@ -83,7 +83,7 @@
repo: "test-repo",
sha: fullGitSha,
state: CommitStatusState.SUCCESS,
context: "[TEST-IGNORE] Swagger Avocado",
context: "Swagger Avocado",
description: "Found label 'Approved-Avocado'",
target_url: "https://test.com/set_status_url",
});
Expand All @@ -103,8 +103,8 @@
target_url: "https://test.com/set_status_url",
github,
core,
monitoredWorkflowName: "[TEST-IGNORE] Swagger BreakingChange - Analyze Code",
requiredStatusName: "[TEST-IGNORE] Swagger BreakingChange",
monitoredWorkflowName: "Swagger BreakingChange - Analyze Code",
requiredStatusName: "Swagger BreakingChange",
overridingLabel:
"BreakingChange-Approved-Benign,BreakingChange-Approved-BugFix,BreakingChange-Approved-UserImpact",
}),
Expand All @@ -115,7 +115,7 @@
repo: "test-repo",
sha: fullGitSha,
state: CommitStatusState.SUCCESS,
context: "[TEST-IGNORE] Swagger BreakingChange",
context: "Swagger BreakingChange",
description: "Found label 'BreakingChange-Approved-Benign'",
target_url: "https://test.com/set_status_url",
});
Expand All @@ -138,8 +138,8 @@
target_url: "https://test.com/set_status_url",
github,
core,
monitoredWorkflowName: "[TEST-IGNORE] Swagger BreakingChange - Analyze Code",
requiredStatusName: "[TEST-IGNORE] Swagger BreakingChange",
monitoredWorkflowName: "Swagger BreakingChange - Analyze Code",
requiredStatusName: "Swagger BreakingChange",
overridingLabel:
"BreakingChange-Approved-Benign, BreakingChange-Approved-BugFix , BreakingChange-Approved-UserImpact",
}),
Expand All @@ -150,7 +150,7 @@
repo: "test-repo",
sha: fullGitSha,
state: CommitStatusState.SUCCESS,
context: "[TEST-IGNORE] Swagger BreakingChange",
context: "Swagger BreakingChange",
description: "Found label 'BreakingChange-Approved-UserImpact'",
target_url: "https://test.com/set_status_url",
});
Expand All @@ -170,8 +170,8 @@
target_url: "https://test.com/set_status_url",
github,
core,
monitoredWorkflowName: "[TEST-IGNORE] Swagger BreakingChange - Analyze Code",
requiredStatusName: "[TEST-IGNORE] Swagger BreakingChange",
monitoredWorkflowName: "Swagger BreakingChange - Analyze Code",
requiredStatusName: "Swagger BreakingChange",
overridingLabel: "BreakingChange-Approved-Benign,,BreakingChange-Approved-Security,",
}),
).resolves.toBeUndefined();
Expand All @@ -181,7 +181,7 @@
repo: "test-repo",
sha: fullGitSha,
state: CommitStatusState.SUCCESS,
context: "[TEST-IGNORE] Swagger BreakingChange",
context: "Swagger BreakingChange",
description: "Found label 'BreakingChange-Approved-Security'",
target_url: "https://test.com/set_status_url",
});
Expand All @@ -205,8 +205,8 @@
target_url: "https://test.com/set_status_url",
github,
core,
monitoredWorkflowName: "[TEST-IGNORE] Swagger BreakingChange - Analyze Code",
requiredStatusName: "[TEST-IGNORE] Swagger BreakingChange",
monitoredWorkflowName: "Swagger BreakingChange - Analyze Code",
requiredStatusName: "Swagger BreakingChange",
overridingLabel:
"BreakingChange-Approved-Benign,BreakingChange-Approved-BugFix,BreakingChange-Approved-UserImpact",
}),
Expand All @@ -217,7 +217,7 @@
repo: "test-repo",
sha: fullGitSha,
state: CommitStatusState.PENDING,
context: "[TEST-IGNORE] Swagger BreakingChange",
context: "Swagger BreakingChange",
target_url: "https://test.com/set_status_url",
});
});
Expand All @@ -240,8 +240,8 @@
target_url: "https://test.com/set_status_url",
github,
core,
monitoredWorkflowName: "[TEST-IGNORE] Swagger BreakingChange - Analyze Code",
requiredStatusName: "[TEST-IGNORE] Swagger BreakingChange",
monitoredWorkflowName: "Swagger BreakingChange - Analyze Code",
requiredStatusName: "Swagger BreakingChange",
overridingLabel: "",
}),
).resolves.toBeUndefined();
Expand All @@ -251,7 +251,7 @@
repo: "test-repo",
sha: fullGitSha,
state: CommitStatusState.PENDING,
context: "[TEST-IGNORE] Swagger BreakingChange",
context: "Swagger BreakingChange",
target_url: "https://test.com/set_status_url",
});
});
Expand Down Expand Up @@ -294,7 +294,7 @@
github.rest.actions.listWorkflowRunsForRepo.mockResolvedValue({
data: [
{
name: "[TEST-IGNORE] Swagger Avocado - Analyze Code",
name: "Swagger Avocado - Analyze Code",
status: checkStatus,
conclusion: checkConclusion,
updated_at: "2025-01-01",
Expand Down Expand Up @@ -333,8 +333,8 @@
target_url: "https://test.com/set_status_url",
github,
core,
monitoredWorkflowName: "[TEST-IGNORE] Swagger Avocado - Analyze Code",
requiredStatusName: "[TEST-IGNORE] Swagger Avocado",
monitoredWorkflowName: "Swagger Avocado - Analyze Code",
requiredStatusName: "Swagger Avocado",
overridingLabel: "Approved-Avocado",
}),
).resolves.toBeUndefined();
Expand All @@ -344,7 +344,7 @@
repo: "test-repo",
sha: fullGitSha,
state: commitStatusState,
context: "[TEST-IGNORE] Swagger Avocado",
context: "Swagger Avocado",
target_url: targetUrl,
});
},
Expand Down
Loading