Skip to content

Commit 4a8f70e

Browse files
committed
Merge branch 'main' into summarize-checks-cutover
2 parents c075fa0 + 1c58843 commit 4a8f70e

File tree

261 files changed

+25786
-3412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+25786
-3412
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ updates:
3838
eslint:
3939
patterns:
4040
- "*eslint*"
41+
openapi-validator:
42+
patterns:
43+
- "@microsoft.azure/openapi-validator*"
4144
versioning-strategy: increase-if-necessary
4245
- package-ecosystem: "npm"
4346
directories:

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ on:
1616
types: [completed]
1717

1818
permissions:
19+
# actions.listWorkflowRunsForRepo
20+
# actions.listWorkflowRunArtifacts
1921
actions: read
20-
checks: read
22+
# default
2123
contents: read
24+
# issues.listLabelsOnIssue
2225
issues: read
26+
# issues.listLabelsOnIssue
2327
pull-requests: read
28+
# repos.listCommitStatusesForRef
29+
statuses: read
2430

2531
jobs:
2632
arm-auto-signoff:

.github/workflows/sdk-breaking-change-labels.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
value: "${{ fromJson(steps.get-label-and-action.outputs.result).labelAction == 'add' }}"
6060
6161
- if: ${{ always() && fromJson(steps.get-label-and-action.outputs.result).headSha }}
62-
name: Upload artifact with issue number
62+
name: Upload artifact with head SHA
6363
uses: ./.github/actions/add-empty-artifact
6464
with:
6565
name: "head-sha"

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export async function getLabelActionImpl({ owner, repo, issue_number, head_sha,
5656
};
5757

5858
// TODO: Try to extract labels from context (when available) to avoid unnecessary API call
59+
// permissions: { issues: read, pull-requests: read }
5960
const labels = await github.paginate(github.rest.issues.listLabelsOnIssue, {
6061
owner: owner,
6162
repo: repo,
@@ -72,6 +73,7 @@ export async function getLabelActionImpl({ owner, repo, issue_number, head_sha,
7273

7374
core.info(`Labels: ${labelNames}`);
7475

76+
// permissions: { actions: read }
7577
const workflowRuns = await github.paginate(github.rest.actions.listWorkflowRunsForRepo, {
7678
owner,
7779
repo,
@@ -106,6 +108,7 @@ export async function getLabelActionImpl({ owner, repo, issue_number, head_sha,
106108
return removeAction;
107109
}
108110

111+
// permissions: { actions: read }
109112
const artifacts = await github.paginate(github.rest.actions.listWorkflowRunArtifacts, {
110113
owner,
111114
repo,
@@ -143,6 +146,7 @@ export async function getLabelActionImpl({ owner, repo, issue_number, head_sha,
143146
return removeAction;
144147
}
145148

149+
// permissions: { statuses: read }
146150
const statuses = await github.paginate(github.rest.repos.listCommitStatusesForRef, {
147151
owner: owner,
148152
repo: repo,

.github/workflows/src/sdk-breaking-change-labels.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ export async function getLabelAndAction({ github, context, core }) {
3939
* @param {string} params.details_url
4040
* @param {typeof import("@actions/core")} params.core
4141
* @param {import('./retries.js').RetryOptions} [params.retryOptions]
42-
* @returns {Promise<{labelName: string | undefined, labelAction: LabelAction, issueNumber: number}>}
42+
* @returns {Promise<{labelName: string | undefined, labelAction: LabelAction, headSha: string, issueNumber: number}>}
4343
*/
4444
export async function getLabelAndActionImpl({ details_url, core, retryOptions = {} }) {
4545
// Override default logger from console.log to core.info
4646
retryOptions = { logger: core.info, ...retryOptions };
4747

48+
let head_sha = "";
4849
let issue_number = NaN;
4950
let labelAction;
5051
/** @type {String | undefined} */
@@ -74,6 +75,9 @@ export async function getLabelAndActionImpl({ details_url, core, retryOptions =
7475
// Parse the JSON data
7576
const specGenSdkArtifactInfo = JSON.parse(result.artifactData);
7677
const labelActionText = specGenSdkArtifactInfo.labelAction;
78+
79+
head_sha = specGenSdkArtifactInfo.headSha;
80+
7781
issue_number = parseInt(specGenSdkArtifactInfo.prNumber, 10);
7882
if (!issue_number) {
7983
core.warning(
@@ -100,5 +104,5 @@ export async function getLabelAndActionImpl({ details_url, core, retryOptions =
100104
labelAction = LabelAction.None;
101105
}
102106

103-
return { labelName, labelAction, issueNumber: issue_number };
107+
return { labelName, labelAction, headSha: head_sha, issueNumber: issue_number };
104108
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ export const breakingChangesCheckType = {
411411
* @returns {void}
412412
*/
413413
export function processArmReviewLabels(context, existingLabels) {
414-
// only kick this off if the ARMReview label is present
415-
if (existingLabels.includes("ARMReview")) {
414+
// only kick this off if the ARMReview label is present and NotReadyForARMReview is not present
415+
if (existingLabels.includes("ARMReview") && !existingLabels.includes("NotReadyForARMReview")) {
416416
// the important part about how this will work depends how the users use it
417417
// EG: if they add the "ARMSignedOff" label, we will remove the "ARMChangesRequested" and "WaitForARMFeedback" labels.
418418
// if they add the "ARMChangesRequested" label, we will remove the "WaitForARMFeedback" label.

.github/workflows/src/update-labels.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ export async function updateLabelsImpl({
8585

8686
if (key.startsWith("label-")) {
8787
const name = key.substring("label-".length);
88+
89+
if (!name) {
90+
throw new Error(`Invalid value for label name: '${name}'`);
91+
}
92+
8893
if (value === "true") {
8994
labelsToAdd.push(name);
9095
} else if (value === "false") {

.github/workflows/test/sdk-breaking-change-labels.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ describe("sdk-breaking-change-labels", () => {
188188
expect(result).toEqual({
189189
labelName: "",
190190
labelAction: LabelAction.None,
191+
headSha: "",
191192
issueNumber: NaN,
192193
});
193194

@@ -258,6 +259,7 @@ describe("sdk-breaking-change-labels", () => {
258259
expect(result).toEqual({
259260
labelName: "",
260261
labelAction: LabelAction.None,
262+
headSha: "",
261263
issueNumber: NaN,
262264
});
263265
});

0 commit comments

Comments
 (0)