fix(scoring): anchor the draft title pattern to genuine markers - #1529
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1529 +/- ##
=======================================
Coverage 95.53% 95.53%
=======================================
Files 204 204
Lines 22084 22084
Branches 7972 7972
=======================================
Hits 21097 21097
Misses 412 412
Partials 575 575
🚀 New features to boost your workflow:
|
3891436 to
e71eae4
Compare
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review — held for maintainer review
⏸️ Held for maintainer review — Touches a guarded path — held for manual review Review summary
Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
Review detailsGenerated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative. Replaces two ad-hoc draft-title regexes with a single exported `DRAFT_TITLE_PATTERN` that is anchored to genuine markers (`[draft]`, `Draft:`, `Draft -`). The root cause (over-broad `^[?\s*draft\s*]?` matching any title starting with the letters "draft") is correctly identified and fixed at the right layer. The shared constant eliminates the previous sync risk between `isDraftPullRequest` and `normalizeTitle`. Regex is correct: `\[\s*draft\s*\]` handles bracketed form, `\s*:` catches `Draft:` and `draft :`, `\s+-` requires a space before the dash and thus rejects `draft-js`/`draft-mode` while accepting `Draft - spike` and `Draft -spike`. Tests exercise the real production path (no fabricated payloads) and cover both false-positive and true-positive cases. Nits (4)
🟩 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.
|
Summary
classifyOpenPullRequestmatched any title beginning with the letters "draft", so real work such as "Drafting a new feature", "Draftsman tool", and "draft-js upgrade" was classified as a draft.merge_readyandstale_likely_closebuckets, sopendingMergedPrCountandpendingClosedPrCountindetectPendingPrScenariocame out lower than reality whenever one of those PRs was otherwise countable.normalizeTitleto strip a draft prefix for duplicate detection, so the dedup key for those titles was corrupted (for example "Draft tooling" collapsed onto "tooling").DRAFT_TITLE_PATTERNnow matches only genuine markers ([draft],Draft:, andDraft -with a spaced dash) and is shared by both the classifier and the normalizer so they stay consistent. Requiring a space before the dash keeps hyphenated names such asdraft-jsanddraft-modefrom matching.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥97% coverage of the lines AND branches you changed (aim for 98%+ on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm run test:ciplusnpm audit --audit-level=moderate, all green.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
Not applicable. The change is backend only, with no visible UI, frontend, docs, or extension changes.
Notes
isDraftPullRequest. Regression tests cover the misclassified titles, the genuine markers, and the dedup key behavior innormalizeTitle.