Azure / Azure/azure-rest-api-specs

[summarize-checks] Function `isReleaseBranch()` should use stricter regexes

Open
#38,522 0 comments 0 reactions 1 assignee Claimed by @mikeharder View on GitHub
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 37m
Merged PRs (30d)
446

Description

I noticed this PR got the ARMReview labels, even though the base branch is not a valid `release-*` branch: #38272

The base branch is `kamboj-prjwl/release-network-2025-03-01`, which most of our automation should treat as a "feature branch" (no required checks). However, in one place we do treat this branch name as a "release branch", and I think this is a bug we should fix:

https://github.com/Azure/azure-rest-api-specs/blob/3abb5423877b238acefaa8c528eb947f5a761026/.github/workflows/src/summarize-checks/labelling.js#L582-L585

I think the regex should be improved to this, which was probably the original intent. We only want to match strict branch names, not partial matches.

```js
function isReleaseBranch(branchName) {
const branchRegex = [/^main$/, /^RPSaaSMaster$/, /^release.*$/, /^ARMCoreRPDev$/];
return branchRegex.some((b) => b.test(branchName));
}
```

For completeness, we should also determine if this was an existing bug in openapi-alps, or was introduced during the migration.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.