diff --git a/.github/workflows/src/summarize-checks/summarize-checks.js b/.github/workflows/src/summarize-checks/summarize-checks.js index 994323e236c3..05b4ec8f79ea 100644 --- a/.github/workflows/src/summarize-checks/summarize-checks.js +++ b/.github/workflows/src/summarize-checks/summarize-checks.js @@ -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, @@ -141,7 +141,8 @@ const FYI_CHECK_NAMES = [ "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[]} */ @@ -398,24 +399,24 @@ export async function summarizeChecksImpl( 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 @@ -442,20 +443,21 @@ export async function summarizeChecksImpl( `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)}.`, ); } @@ -722,7 +724,7 @@ export async function getCheckRunTuple( // 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" ) { @@ -793,7 +795,7 @@ export async function getCheckRunTuple( ); } } else { - requiredCheckNames = ["Summarize PR Impact", "[TEST-IGNORE] Summarize PR Impact"]; + requiredCheckNames = [IMPACT_CHECK_NAME, "[TEST-IGNORE] Summarize PR Impact"]; } const filteredReqCheckRuns = unifiedCheckRuns.filter( diff --git a/.github/workflows/summarize-checks.yaml b/.github/workflows/summarize-checks.yaml index a1d066b1df0d..8f644caa3813 100644 --- a/.github/workflows/summarize-checks.yaml +++ b/.github/workflows/summarize-checks.yaml @@ -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" @@ -30,7 +30,7 @@ permissions: 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: diff --git a/.github/workflows/summarize-impact.yaml b/.github/workflows/summarize-impact.yaml index df9045055c50..4e82b60c78ee 100644 --- a/.github/workflows/summarize-impact.yaml +++ b/.github/workflows/summarize-impact.yaml @@ -1,4 +1,4 @@ -name: "[TEST-IGNORE] Summarize PR Impact" +name: "Summarize PR Impact" on: pull_request @@ -8,7 +8,7 @@ permissions: jobs: impact: - name: "[TEST-IGNORE] Summarize PR Impact" + name: "Summarize PR Impact" runs-on: ubuntu-24.04 steps: diff --git a/.github/workflows/swagger-modelvalidation-code.yaml b/.github/workflows/swagger-modelvalidation-code.yaml index 9ab3b15471ee..8e5bba0c8b09 100644 --- a/.github/workflows/swagger-modelvalidation-code.yaml +++ b/.github/workflows/swagger-modelvalidation-code.yaml @@ -1,4 +1,4 @@ -name: "[TEST-IGNORE] Swagger ModelValidation - Analyze Code" +name: "Swagger ModelValidation - Analyze Code" on: pull_request @@ -7,7 +7,7 @@ permissions: jobs: oav: - name: "[TEST-IGNORE] Swagger ModelValidation - Analyze Code" + name: "Swagger ModelValidation - Analyze Code" runs-on: ubuntu-24.04 steps: diff --git a/.github/workflows/swagger-modelvalidation-status.yaml b/.github/workflows/swagger-modelvalidation-status.yaml index 7310b1c94f6e..3f76adb23fd1 100644 --- a/.github/workflows/swagger-modelvalidation-status.yaml +++ b/.github/workflows/swagger-modelvalidation-status.yaml @@ -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 @@ -15,7 +15,7 @@ on: - labeled - unlabeled workflow_run: - workflows: ["\\[TEST-IGNORE\\] Swagger ModelValidation - Analyze Code"] + workflows: ["Swagger ModelValidation - Analyze Code"] types: [completed] permissions: @@ -30,6 +30,6 @@ jobs: 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" diff --git a/.github/workflows/swagger-semanticvalidation-code.yaml b/.github/workflows/swagger-semanticvalidation-code.yaml index ffe0464d4ff2..540c54de140b 100644 --- a/.github/workflows/swagger-semanticvalidation-code.yaml +++ b/.github/workflows/swagger-semanticvalidation-code.yaml @@ -1,4 +1,4 @@ -name: "[TEST-IGNORE] Swagger SemanticValidation - Analyze Code" +name: "Swagger SemanticValidation - Analyze Code" on: pull_request @@ -7,7 +7,7 @@ permissions: jobs: oav: - name: "[TEST-IGNORE] Swagger SemanticValidation - Analyze Code" + name: "Swagger SemanticValidation - Analyze Code" runs-on: ubuntu-24.04 steps: diff --git a/.github/workflows/swagger-semanticvalidation-status.yaml b/.github/workflows/swagger-semanticvalidation-status.yaml index 1166cb44ba20..62f432524f17 100644 --- a/.github/workflows/swagger-semanticvalidation-status.yaml +++ b/.github/workflows/swagger-semanticvalidation-status.yaml @@ -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 @@ -15,7 +15,7 @@ on: - labeled - unlabeled workflow_run: - workflows: ["\\[TEST-IGNORE\\] Swagger SemanticValidation - Analyze Code"] + workflows: ["Swagger SemanticValidation - Analyze Code"] types: [completed] permissions: @@ -30,6 +30,6 @@ jobs: 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" diff --git a/.github/workflows/test/summarize-checks/fixtures/RawGraphQLResponse.json b/.github/workflows/test/summarize-checks/fixtures/RawGraphQLResponse.json index 002bee336055..16d0e10c03c5 100644 --- a/.github/workflows/test/summarize-checks/fixtures/RawGraphQLResponse.json +++ b/.github/workflows/test/summarize-checks/fixtures/RawGraphQLResponse.json @@ -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 diff --git a/.github/workflows/test/summarize-checks/summarize-checks.test.js b/.github/workflows/test/summarize-checks/summarize-checks.test.js index 2e716d5ab9ee..250d1ccea676 100644 --- a/.github/workflows/test/summarize-checks/summarize-checks.test.js +++ b/.github/workflows/test/summarize-checks/summarize-checks.test.js @@ -146,7 +146,7 @@ describe("Summarize Checks Unit Tests", () => { 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.", @@ -256,7 +256,7 @@ describe("Summarize Checks Unit Tests", () => { const expectedOutput = [ '

Next Steps to Merge

✅ All automated merging requirements have been met! To get your PR merged, see aka.ms/azsdk/specreview/merge.', { - name: "[TEST-IGNORE] Automated merging requirements met", + name: "Automated merging requirements met", result: "SUCCESS", summary: `✅ All automated merging requirements have been met.
To merge this PR, refer to aka.ms/azsdk/specreview/merge.
For help, consult comments on this PR and see [aka.ms/azsdk/pr-getting-help](https://aka.ms/azsdk/pr-getting-help).`, }, @@ -283,7 +283,7 @@ describe("Summarize Checks Unit Tests", () => { const expectedOutput = [ '

Next Steps to Merge

✅ All automated merging requirements have been met! To get your PR merged, see aka.ms/azsdk/specreview/merge.', { - name: "[TEST-IGNORE] Automated merging requirements met", + name: "Automated merging requirements met", result: "SUCCESS", summary: `✅ All automated merging requirements have been met.
To merge this PR, refer to aka.ms/azsdk/specreview/merge.
For help, consult comments on this PR and see [aka.ms/azsdk/pr-getting-help](https://aka.ms/azsdk/pr-getting-help).`, }, @@ -391,7 +391,7 @@ describe("Summarize Checks Unit Tests", () => { const expectedOutput = [ "

Next Steps to Merge

⌛ 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.", }, @@ -499,7 +499,7 @@ describe("Summarize Checks Unit Tests", () => { const expectedOutput = [ "

Next Steps to Merge

⌛ 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.", }, @@ -564,7 +564,7 @@ describe("Summarize Checks Unit Tests", () => { const expectedOutput = [ '

Next Steps to Merge

✅ All automated merging requirements have been met! To get your PR merged, see aka.ms/azsdk/specreview/merge.', { - name: "[TEST-IGNORE] Automated merging requirements met", + name: "Automated merging requirements met", result: "SUCCESS", summary: `✅ All automated merging requirements have been met.
To merge this PR, refer to aka.ms/azsdk/specreview/merge.
For help, consult comments on this PR and see [aka.ms/azsdk/pr-getting-help](https://aka.ms/azsdk/pr-getting-help).`, }, @@ -635,7 +635,7 @@ describe("Summarize Checks Unit Tests", () => { const expectedOutput = [ '

Next Steps to Merge

✅ All automated merging requirements have been met! To get your PR merged, see aka.ms/azsdk/specreview/merge.', { - name: "[TEST-IGNORE] Automated merging requirements met", + name: "Automated merging requirements met", result: "SUCCESS", summary: `✅ All automated merging requirements have been met.
To merge this PR, refer to aka.ms/azsdk/specreview/merge.
For help, consult comments on this PR and see [aka.ms/azsdk/pr-getting-help](https://aka.ms/azsdk/pr-getting-help).`, }, @@ -691,7 +691,7 @@ describe("Summarize Checks Unit Tests", () => { const expectedOutput = [ "

Next Steps to Merge

⌛ 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.", }, @@ -739,7 +739,7 @@ describe("Summarize Checks Unit Tests", () => { const expectedOutput = [ "

Next Steps to Merge

⌛ 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.", }, @@ -784,7 +784,7 @@ describe("Summarize Checks Unit Tests", () => { 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.", @@ -827,7 +827,7 @@ describe("Summarize Checks Unit Tests", () => { 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.", diff --git a/.github/workflows/watch-modelvalidation.yaml b/.github/workflows/watch-modelvalidation.yaml index ba3ff8165018..1332e682072e 100644 --- a/.github/workflows/watch-modelvalidation.yaml +++ b/.github/workflows/watch-modelvalidation.yaml @@ -24,4 +24,4 @@ jobs: uses: ./.github/workflows/_reusable-verify-run-status.yaml with: check_run_name: "Swagger ModelValidation" - workflow_name: "[TEST-IGNORE] Swagger ModelValidation" + workflow_name: "Swagger ModelValidation" diff --git a/.github/workflows/watch-semanticvalidation.yaml b/.github/workflows/watch-semanticvalidation.yaml index 757e55e367d6..d63d123f2341 100644 --- a/.github/workflows/watch-semanticvalidation.yaml +++ b/.github/workflows/watch-semanticvalidation.yaml @@ -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"