Skip to content

Commit d70de84

Browse files
kapral18cursoragent
andcommitted
fix(renovate-reviewer-sync): request individual reviewers in the bot PR
After normalizing individual CODEOWNERS owners to bare usernames, getComputedTeamReviewers still filtered managed drift to team:-prefixed entries only, so a mode: "sync" rule covering a dep owned by an individual wrote reviewers: ["vigneshshanmugam"] into renovate.json but the bot PR never requested that user, never @-mentioned them, and never recorded them in the bot-managed-reviewer marker. Emit bare usernames alongside elastic/<slug> teams so the request flow, mentions, and marker stay consistent with the written config. gh pr edit --add-reviewer accepts both bare logins and org/team slugs, and requested-reviewers already round-trips both shapes. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 1384775 commit d70de84

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

  • .buildkite/scripts/steps/renovate_review_sync

.buildkite/scripts/steps/renovate_review_sync/helpers.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,29 +76,35 @@ const printNoComputedReviewerRules = (reportPath, rawLimit) => {
7676
process.stdout.write(details.slice(0, parseLimit(rawLimit)).map(formatRule).join('\n'));
7777
};
7878

79-
const getComputedTeamReviewers = (report) => {
79+
const getComputedReviewers = (report) => {
8080
const reviewers = new Set();
8181
for (const drift of getManagedRuleDrift(report)) {
8282
const after = asArray(drift.after);
8383
for (const reviewer of after) {
84-
if (typeof reviewer === 'string' && reviewer.startsWith('team:')) {
84+
if (typeof reviewer !== 'string' || reviewer.length === 0) continue;
85+
if (reviewer.startsWith('team:')) {
8586
reviewers.add(`elastic/${reviewer.slice('team:'.length)}`);
87+
} else {
88+
// Individual CODEOWNERS user. `convertTeamFormat` already normalized this
89+
// to a bare username, matching `printRequestedReviewers`' shape for
90+
// `reviewRequest.login`, so it round-trips through the request flow.
91+
reviewers.add(reviewer);
8692
}
8793
}
8894
}
8995
return Array.from(reviewers).sort();
9096
};
9197

92-
const printComputedTeams = (reportPath, formatTeam) => {
93-
process.stdout.write(getComputedTeamReviewers(readReport(reportPath)).map(formatTeam).join(' '));
94-
};
95-
9698
const printComputedReviewers = (reportPath) => {
97-
printComputedTeams(reportPath, (team) => team);
99+
process.stdout.write(getComputedReviewers(readReport(reportPath)).join(' '));
98100
};
99101

100102
const printComputedMentions = (reportPath) => {
101-
printComputedTeams(reportPath, (team) => `@${team}`);
103+
process.stdout.write(
104+
getComputedReviewers(readReport(reportPath))
105+
.map((reviewer) => `@${reviewer}`)
106+
.join(' ')
107+
);
102108
};
103109

104110
const readStdin = () =>

0 commit comments

Comments
 (0)