[code-infra] Fix changelog dependency exclusion and l10n routing#23112
Conversation
The `dependencies` label exclusion and the l10n package routing both read a `prsLabelsMap` that has been an empty object since the migration to `fetchCommitsBetweenRefs` (mui#20406). That util returns `labels` directly on each commit as a string array and never populates the old map, so the exclusion matched nothing (it also read `label.name`, but labels are plain strings now) and l10n commits always fell back to Miscellaneous. Read the per-commit `labels` in both places and switch `resolvePackagesByLabels` from `label.name` to the label string. Drop the redundant author filter too: every Renovate PR carries the `dependencies` label (shared mui-public preset), so the label exclusion covers them regardless of bot login -- the previous `renovate[bot]` check silently stopped matching once Renovate was renamed to `code-infra-renovate[bot]`, which is what let dependency bumps leak in. `getContributors` still excludes both bot logins from attribution. Remove the now-unused `prsLabelsMap`. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Deploy previewhttps://deploy-preview-23112--material-ui-x.netlify.app/Bundle size
Check out the code infra dashboard for more information about this PR. |
|
@brijeshb42, I've created mui/mui-public#1644 to track the |
|
BUMP @Janpot, @brijeshb42. We need this fixed before the next release. |
|
Latest code infra version also has the prBody and message. You can club the other change as well if you want |
|
@brijeshb42 tried bumping it's own PR, but stumbled upon some suboptimal findings: #23140 (comment). |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…5ffb Reconcile with mui#23153: keep its IGNORED_BOT_LOGINS set (used by getContributors for attribution), but drop the author filter it added on the commit stream. This branch already excludes dependency bumps via the fixed `dependencies` label check, which covers every Renovate PR and survives future bot renames, so the author filter is redundant. Co-Authored-By: Claude Opus 4.8 <[email protected]>
| release, | ||
| }) | ||
| ) | ||
| .filter((commit) => !IGNORED_BOT_LOGINS.has(commit.author?.login)) |
There was a problem hiding this comment.
Dropping the author filter here: with the dependencies-label exclusion fixed (it was reading an always-empty prsLabelsMap), the label already excludes every Renovate PR and survives bot renames, so filtering by login is redundant. Kept #23153's IGNORED_BOT_LOGINS set for getContributors attribution -- only the commit-stream filter is removed.
There was a problem hiding this comment.
Is there a specific reason the dependencies label is better suited than renovate login? I sometimes use this label too when I manually update a dependency.
There was a problem hiding this comment.
I can see a couple of points:
- The logic was already there, but did not work after some recent changes
- It's more stable across infra changes as we've noticed
Do you feel like the dep update PRs that you make have a place in the changelog?
If that's the case, we could keep the current filtering, based on names; it's not a deal breaker. 🤔
Problem
Dependency (Renovate) bumps started leaking into the generated changelog, and
[l10n]commits stopped being routed to their product sections.Both features read a
prsLabelsMapthat has been an empty object since #20406 migrated the script tofetchCommitsBetweenRefs. That util attacheslabelsdirectly to each commit (as astring[]) and never populates the old map, so thedependenciesexclusion matched nothing (it also readlabel.name, but labels are plain strings now) andresolvePackagesByLabelsalways returned an empty list, dropping l10n commits into Miscellaneous.Dependency bumps kept being excluded only via the
renovate[bot]author filter, which silently stopped matching once Renovate was renamed tocode-infra-renovate[bot]-- so the bumps began showing up in the changelog.Changes
labelsarray for both thedependenciesexclusion and the l10n package routing.resolvePackagesByLabelsfromlabel.nameto the label string.dependencieslabel (set in the sharedmui-publicpreset), so the label exclusion covers them regardless of bot login, andgetContributorsalready excludes both bot logins from attribution.prsLabelsMap.Relationship to #23153
#23153 fixed the same dependency-bump leak from the other side: it added an
IGNORED_BOT_LOGINSset and pointed bothgetContributorsand the commit-stream author filter at it, so the renamedcode-infra-renovate[bot]is caught by login.This PR keeps that set for
getContributors(bot attribution) but removes the author filter itself. Once thedependencies-label exclusion works again, the label already drops every Renovate PR and is robust to future bot renames, so filtering by login is redundant. After the merge the label is the single exclusion path, withIGNORED_BOT_LOGINSretained only where it is still needed.Not fixed here
The
## changelogPR-body highlights injection (changeLogMessages) is dead from the same migration and is left as-is -- reviving it needs the PR body, whichfetchCommitsBetweenRefsdoes not return. Tracking that separately with code-infra.🤖 Generated with Claude Code