chore(labeler): normalize module labels and backfill contributor tiers (#462)
Co-authored-by: Will Sarg <12886992+willsarg@users.noreply.github.com>
This commit is contained in:
parent
df31359ec4
commit
a35d1e37c8
7 changed files with 351 additions and 14 deletions
4
.github/pull_request_template.md
vendored
4
.github/pull_request_template.md
vendored
|
|
@ -12,7 +12,11 @@ Describe this PR in 2-5 bullets:
|
|||
- Risk label (`risk: low|medium|high`):
|
||||
- Size label (`size: XS|S|M|L|XL`, auto-managed/read-only):
|
||||
- Scope labels (`core|agent|channel|config|cron|daemon|doctor|gateway|health|heartbeat|integration|memory|observability|onboard|provider|runtime|security|service|skillforge|skills|tool|tunnel|docs|dependencies|ci|tests|scripts|dev`, comma-separated):
|
||||
<<<<<<< chore/labeler-spacing-trusted-tier
|
||||
- Module labels (`<module>: <component>`, for example `channel: telegram`, `provider: kimi`, `tool: shell`):
|
||||
=======
|
||||
- Module labels (`<module>:<component>`, for example `channel:telegram`, `provider:kimi`, `tool:shell`):
|
||||
>>>>>>> main
|
||||
- Contributor tier label (`trusted contributor|experienced contributor|principal contributor|distinguished contributor`, auto-managed/read-only; author merged PRs >=5/10/20/50):
|
||||
- If any auto-label is incorrect, note requested correction:
|
||||
|
||||
|
|
|
|||
4
.github/workflows/auto-response.yml
vendored
4
.github/workflows/auto-response.yml
vendored
|
|
@ -36,7 +36,11 @@ jobs:
|
|||
{ label: "trusted contributor", minMergedPRs: 5 },
|
||||
];
|
||||
const contributorTierLabels = contributorTierRules.map((rule) => rule.label);
|
||||
<<<<<<< chore/labeler-spacing-trusted-tier
|
||||
const contributorTierColor = "39FF14";
|
||||
=======
|
||||
const contributorTierColor = "2ED9FF"; // Keep in sync with .github/workflows/labeler.yml
|
||||
>>>>>>> main
|
||||
const managedContributorLabels = new Set(contributorTierLabels);
|
||||
const action = context.payload.action;
|
||||
const changedLabel = context.payload.label?.name;
|
||||
|
|
|
|||
27
.github/workflows/labeler.yml
vendored
27
.github/workflows/labeler.yml
vendored
|
|
@ -325,13 +325,18 @@ jobs:
|
|||
return pattern.test(text);
|
||||
}
|
||||
|
||||
function formatModuleLabel(prefix, segment) {
|
||||
return `${prefix}: ${segment}`;
|
||||
}
|
||||
|
||||
function parseModuleLabel(label) {
|
||||
const separatorIndex = label.indexOf(":");
|
||||
if (separatorIndex <= 0 || separatorIndex >= label.length - 1) return null;
|
||||
return {
|
||||
prefix: label.slice(0, separatorIndex),
|
||||
segment: label.slice(separatorIndex + 1),
|
||||
};
|
||||
if (typeof label !== "string") return null;
|
||||
const match = label.match(/^([^:]+):\s*(.+)$/);
|
||||
if (!match) return null;
|
||||
const prefix = match[1].trim().toLowerCase();
|
||||
const segment = (match[2] || "").trim().toLowerCase();
|
||||
if (!prefix || !segment) return null;
|
||||
return { prefix, segment };
|
||||
}
|
||||
|
||||
function sortByPriority(labels, priorityIndex) {
|
||||
|
|
@ -389,7 +394,7 @@ jobs:
|
|||
for (const [prefix, segments] of segmentsByPrefix) {
|
||||
const hasSpecificSegment = [...segments].some((segment) => segment !== "core");
|
||||
if (hasSpecificSegment) {
|
||||
refined.delete(`${prefix}:core`);
|
||||
refined.delete(formatModuleLabel(prefix, "core"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -418,7 +423,7 @@ jobs:
|
|||
if (uniqueSegments.length === 0) continue;
|
||||
|
||||
if (uniqueSegments.length === 1) {
|
||||
compactedModuleLabels.add(`${prefix}:${uniqueSegments[0]}`);
|
||||
compactedModuleLabels.add(formatModuleLabel(prefix, uniqueSegments[0]));
|
||||
} else {
|
||||
forcePathPrefixes.add(prefix);
|
||||
}
|
||||
|
|
@ -609,7 +614,7 @@ jobs:
|
|||
segment = normalizeLabelSegment(segment);
|
||||
if (!segment) continue;
|
||||
|
||||
detectedModuleLabels.add(`${rule.prefix}:${segment}`);
|
||||
detectedModuleLabels.add(formatModuleLabel(rule.prefix, segment));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -635,7 +640,7 @@ jobs:
|
|||
|
||||
for (const keyword of providerKeywordHints) {
|
||||
if (containsKeyword(searchableText, keyword)) {
|
||||
detectedModuleLabels.add(`provider:${keyword}`);
|
||||
detectedModuleLabels.add(formatModuleLabel("provider", keyword));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -661,7 +666,7 @@ jobs:
|
|||
|
||||
for (const keyword of channelKeywordHints) {
|
||||
if (containsKeyword(searchableText, keyword)) {
|
||||
detectedModuleLabels.add(`channel:${keyword}`);
|
||||
detectedModuleLabels.add(formatModuleLabel("channel", keyword));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue