fix(labels): bound custom type label cleanup#3552
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-05 17:56:39 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3552 +/- ##
=======================================
Coverage 93.01% 93.01%
=======================================
Files 297 297
Lines 31038 31045 +7
Branches 11319 11322 +3
=======================================
+ Hits 28870 28877 +7
Misses 1513 1513
Partials 655 655
🚀 New features to boost your workflow:
|
…ypeLabelSet codecov/patch was at 90.90% -- the category-cap overflow branch only had test coverage for entries with a defined-but-ignored value, missing the sibling case where an overflow key's value is explicitly undefined (no warning should fire, since nothing was going to be included either way).
Motivation
typeLabelsso a malicious or compromised repo cannot cause hundreds/thousands of DELETE requests per PR webhook.Description
MAX_TYPE_LABEL_CATEGORIES = 32andMAX_TYPE_LABEL_NAME_LENGTH = 50and document the bounds insrc/settings/pr-type-label.ts.normalizeTypeLabelSetso oversized/overlong manifest entries are warned and ignored instead of being propagated into repository settings.removeLabelsinresolvePrTypeLabelto cap the cleanup list before webhook processing can perform per-label GitHub operations.src/signals/focus-manifest.tsso only validated, in-range entries survive into the per-repo override, and update tests to cover overflow/overlong cases.Testing
npx vitest run test/unit/pr-type-label.test.ts test/unit/focus-manifest.test.ts, and the tests passed.npm run typecheck, which succeeded.npm run test:coverage, but the environment hit long-running queue/backfill test time limits so the full suite did not complete here; the targeted unit regressions passed locally in the run above.npm audit --audit-level=moderatecould not complete in this environment due to an npm registry403 Forbiddenresponse.Codex Task