Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
54 changes: 28 additions & 26 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 @@ -398,24 +399,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 All @@ -442,20 +443,21 @@
`Updating comment '${NEXT_STEPS_COMMENT_ID}' on ${owner}/${repo}#${issue_number} with body: ${commentBody}`,
);
// 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)}.`,
);
}

Expand Down Expand Up @@ -722,7 +724,7 @@
// 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 @@ -793,7 +795,7 @@
);
}
} else {
requiredCheckNames = ["Summarize PR Impact", "[TEST-IGNORE] Summarize PR Impact"];
requiredCheckNames = [IMPACT_CHECK_NAME, "[TEST-IGNORE] Summarize PR Impact"];
}

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 All @@ -30,7 +30,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 @@ -8,7 +8,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"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"resource": {
"checkSuites": {
Expand Down Expand Up @@ -339,13 +339,13 @@
"id": "WFR_kwLOAlSEjc8AAAAD3GhuLA",
"databaseId": 16582733356,
"workflow": {
"name": "[TEST-IGNORE] Summarize PR Impact"
"name": "Summarize PR Impact"
}
},
"checkRuns": {
"nodes": [
{
"name": "[TEST-IGNORE] Summarize PR Impact",
"name": "Summarize PR Impact",
"status": "COMPLETED",
"conclusion": "SUCCESS",
"isRequired": false
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/test/summarize-checks/summarize-checks.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Octokit } from "@octokit/rest";
import { describe, expect, it } from "vitest";
import { processArmReviewLabels } from "../../src/summarize-checks/labelling.js";
Expand Down Expand Up @@ -146,7 +146,7 @@
const expectedOutput = [
expectedComment,
{
name: "[TEST-IGNORE] Automated merging requirements met",
name: "Automated merging requirements met",
result: "FAILURE",
summary:
"❌ This PR cannot be merged because some requirements are not met. See the details.",
Expand Down Expand Up @@ -256,7 +256,7 @@
const expectedOutput = [
'<h2>Next Steps to Merge</h2>✅ All automated merging requirements have been met! To get your PR merged, see <a href="https://aka.ms/azsdk/specreview/merge">aka.ms/azsdk/specreview/merge</a>.',
{
name: "[TEST-IGNORE] Automated merging requirements met",
name: "Automated merging requirements met",
result: "SUCCESS",
summary: `✅ All automated merging requirements have been met.<br/>To merge this PR, refer to <a href="https://aka.ms/azsdk/specreview/merge">aka.ms/azsdk/specreview/merge</a>.<br/>For help, consult comments on this PR and see [aka.ms/azsdk/pr-getting-help](https://aka.ms/azsdk/pr-getting-help).`,
},
Expand All @@ -283,7 +283,7 @@
const expectedOutput = [
'<h2>Next Steps to Merge</h2>✅ All automated merging requirements have been met! To get your PR merged, see <a href="https://aka.ms/azsdk/specreview/merge">aka.ms/azsdk/specreview/merge</a>.',
{
name: "[TEST-IGNORE] Automated merging requirements met",
name: "Automated merging requirements met",
result: "SUCCESS",
summary: `✅ All automated merging requirements have been met.<br/>To merge this PR, refer to <a href="https://aka.ms/azsdk/specreview/merge">aka.ms/azsdk/specreview/merge</a>.<br/>For help, consult comments on this PR and see [aka.ms/azsdk/pr-getting-help](https://aka.ms/azsdk/pr-getting-help).`,
},
Expand Down Expand Up @@ -391,7 +391,7 @@
const expectedOutput = [
"<h2>Next Steps to Merge</h2>⌛ Please wait. Next steps to merge this PR are being evaluated by automation. ⌛",
{
name: "[TEST-IGNORE] Automated merging requirements met",
name: "Automated merging requirements met",
result: "pending",
summary: "The requirements for merging this PR are still being evaluated. Please wait.",
},
Expand Down Expand Up @@ -499,7 +499,7 @@
const expectedOutput = [
"<h2>Next Steps to Merge</h2>⌛ Please wait. Next steps to merge this PR are being evaluated by automation. ⌛",
{
name: "[TEST-IGNORE] Automated merging requirements met",
name: "Automated merging requirements met",
result: "pending",
summary: "The requirements for merging this PR are still being evaluated. Please wait.",
},
Expand Down Expand Up @@ -564,7 +564,7 @@
const expectedOutput = [
'<h2>Next Steps to Merge</h2>✅ All automated merging requirements have been met! To get your PR merged, see <a href="https://aka.ms/azsdk/specreview/merge">aka.ms/azsdk/specreview/merge</a>.',
{
name: "[TEST-IGNORE] Automated merging requirements met",
name: "Automated merging requirements met",
result: "SUCCESS",
summary: `✅ All automated merging requirements have been met.<br/>To merge this PR, refer to <a href="https://aka.ms/azsdk/specreview/merge">aka.ms/azsdk/specreview/merge</a>.<br/>For help, consult comments on this PR and see [aka.ms/azsdk/pr-getting-help](https://aka.ms/azsdk/pr-getting-help).`,
},
Expand Down Expand Up @@ -635,7 +635,7 @@
const expectedOutput = [
'<h2>Next Steps to Merge</h2>✅ All automated merging requirements have been met! To get your PR merged, see <a href="https://aka.ms/azsdk/specreview/merge">aka.ms/azsdk/specreview/merge</a>.',
{
name: "[TEST-IGNORE] Automated merging requirements met",
name: "Automated merging requirements met",
result: "SUCCESS",
summary: `✅ All automated merging requirements have been met.<br/>To merge this PR, refer to <a href="https://aka.ms/azsdk/specreview/merge">aka.ms/azsdk/specreview/merge</a>.<br/>For help, consult comments on this PR and see [aka.ms/azsdk/pr-getting-help](https://aka.ms/azsdk/pr-getting-help).`,
},
Expand Down Expand Up @@ -691,7 +691,7 @@
const expectedOutput = [
"<h2>Next Steps to Merge</h2>⌛ Please wait. Next steps to merge this PR are being evaluated by automation. ⌛",
{
name: "[TEST-IGNORE] Automated merging requirements met",
name: "Automated merging requirements met",
result: "pending",
summary: "The requirements for merging this PR are still being evaluated. Please wait.",
},
Expand Down Expand Up @@ -739,7 +739,7 @@
const expectedOutput = [
"<h2>Next Steps to Merge</h2>⌛ Please wait. Next steps to merge this PR are being evaluated by automation. ⌛",
{
name: "[TEST-IGNORE] Automated merging requirements met",
name: "Automated merging requirements met",
result: "pending",
summary: "The requirements for merging this PR are still being evaluated. Please wait.",
},
Expand Down Expand Up @@ -784,7 +784,7 @@
const targetBranch = "main";
const labelNames = [];
const expectedCheckOutput = {
name: "[TEST-IGNORE] Automated merging requirements met",
name: "Automated merging requirements met",
result: "FAILURE",
summary:
"❌ This PR cannot be merged because some requirements are not met. See the details.",
Expand Down Expand Up @@ -827,7 +827,7 @@
const labelNames = [];
const fyiCheckRuns = [];
const expectedCheckOutput = {
name: "[TEST-IGNORE] Automated merging requirements met",
name: "Automated merging requirements met",
result: "FAILURE",
summary:
"❌ This PR cannot be merged because some requirements are not met. See the details.",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/watch-modelvalidation.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Use ~ to sort the workflow to the bottom of the list
name: "~Watch - Swagger ModelValidation"

Expand All @@ -24,4 +24,4 @@
uses: ./.github/workflows/_reusable-verify-run-status.yaml
with:
check_run_name: "Swagger ModelValidation"
workflow_name: "[TEST-IGNORE] Swagger ModelValidation"
workflow_name: "Swagger ModelValidation"
2 changes: 1 addition & 1 deletion .github/workflows/watch-semanticvalidation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
uses: ./.github/workflows/_reusable-verify-run-status.yaml
with:
check_run_name: "Swagger SemanticValidation"
workflow_name: "[TEST-IGNORE] Swagger SemanticValidation"
workflow_name: "Swagger SemanticValidation"