-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
WF "SDK Breaking Change Labels" may add an invalid artifact named label-=false
or label-=true
.
Examples:
- true
- update labels: https://github.com/Azure/azure-rest-api-specs/actions/runs/16814496699
- SDK Breaking Change Labels: https://github.com/Azure/azure-rest-api-specs/actions/runs/16814492237
false: https://github.com/Azure/azure-rest-api-specs/actions/runs/16817684261
I believe the root cause is spread across two files:
azure-rest-api-specs/.github/shared/src/sdk-types.js
Lines 26 to 38 in 4dfa749
export const sdkLabels = { | |
"azure-sdk-for-go": { | |
breakingChange: "BreakingChange-Go-Sdk", | |
breakingChangeApproved: "BreakingChange-Go-Sdk-Approved", | |
breakingChangeSuppression: "BreakingChange-Go-Sdk-Suppression", | |
breakingChangeSuppressionApproved: "BreakingChange-Go-Sdk-Suppression-Approved", | |
}, | |
"azure-sdk-for-java": { | |
breakingChange: undefined, | |
breakingChangeApproved: undefined, | |
breakingChangeSuppression: undefined, | |
breakingChangeSuppressionApproved: undefined, | |
}, |
azure-rest-api-specs/.github/workflows/src/sdk-breaking-change-labels.js
Lines 89 to 107 in 4dfa749
const breakingChangeLanguage = specGenSdkArtifactInfo.language; | |
if (breakingChangeLanguage) { | |
labelName = sdkLabels[`${breakingChangeLanguage}`].breakingChange; | |
} | |
// Set label action and name based on the artifacts | |
if (labelActionText === true) { | |
labelAction = LabelAction.Add; | |
} else if (labelActionText === false) { | |
labelAction = LabelAction.Remove; | |
} | |
} | |
if (!labelAction) { | |
core.info("No label action found, defaulting to None"); | |
labelAction = LabelAction.None; | |
} | |
return { labelName, labelAction, headSha: head_sha, issueNumber: issue_number }; |
For Java and Net, the labels are undefined, which causes us to return objects like:
{ labelName: "", labelAction: LabelAction.Add, ... }
Which causes use to add an empty label artifact:
- if: | | |
(fromJson(steps.get-label-and-action.outputs.result).labelAction == 'add' || | |
fromJson(steps.get-label-and-action.outputs.result).labelAction == 'remove') | |
name: Upload artifact with results | |
uses: ./.github/actions/add-label-artifact | |
with: | |
name: "${{ fromJson(steps.get-label-and-action.outputs.result).labelName}}" | |
# Convert "add/remove" to "true/false" | |
value: "${{ fromJson(steps.get-label-and-action.outputs.result).labelAction == 'add' }}" |
Fortunately, when update-labels processes this artifact, it's a no-op. Trying to add or remove a label named "" should always fail and effectively be a no-op.
But, this still should be fixed in sdk-breaking-change-labels. I think the fix could be as simple as this:

We would now return:
{ labelName: "", labelAction: LabelAction.None, ... }
Which is a cleaner no-op, avoids adding the label artifact and triggering update-labels.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status