fix: order issue-type keyword rules by signal strength - #3579
Conversation
inferMappedValueFromText takes the first rule that both matches and has a configured mapping. type:feature sat second and its patterns include bare action verbs (add, implement, build, develop) that appear in almost any title, so it captured every title that both named a subject and started with a verb: "Add dependency upgrade" -> Feature (Dependency Update) "Implement compatibility support" -> Feature (Compatibility) "Add integration test for the sync"-> Feature (Automation) "Add GitHub Action for releases" -> Feature (Automation) Move only that rule to the end of the array and leave every other rule's relative order untouched, so the change is confined to the reported problem. type:test stays above type:compat so "integration test" remains a test. This is the ordered-cascade approach of matching the strongest signal first and taking the first match, as OpenAlex used when reclassifying 49.6M works. No configuration is touched: project_field_mappings.Type, the canonical issue types and every locked file are unchanged, so the derived values remain valid options and nothing downstream has to migrate.
|
Warning Review limit reachedNext included review available in 27 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: lightspeedwp/.github/.coderabbit.yml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Template RoutingBranch Type: This PR was automatically routed based on the branch naming strategy. |
PR Summary by QodoOrder issue-type keyword rules by signal strength
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
📋 Changelog Quality Validation
Status✅ Validation PASSED - No new failures introduced by this PR. No action required. |
Linked issues
Fixes #3577
Found by Qodo review of #3573, which surfaced it against code that predates that fix.
Context
scripts/agents/includes/derive-project-fields.cjsondevelop. Pre-existing, not a regression from fix: correct stale issue-type inference and CommonJS title normalisation #3568.Reproduction
inferTypeFromContext()with a title that both names a subject and starts with an action verb.Add dependency upgradeImplement compatibility supportAdd interoperability for runnersAdd integration test for the syncAdd GitHub Action for releasesRoot Cause
inferMappedValueFromTexttakes the first rule that both matches and has a configured mapping.type:featuresat second and its patterns include bare action verbs —add,implement,build,develop— that occur in almost any title, so it shadowed every subject rule below it. The specific rules were reachable only from titles that happened to contain no action verb.Fix Summary
type:featurerule to the end of the array, leaving every other rule's relative order untouched so the change stays confined to the reported problem.type:testabovetype:compatsointegration testremains a test rather than becoming Compatibility.No configuration is touched.
project_field_mappings.Type,.github/issue-types.ymland every locked file are unchanged, so derived values remain valid options and nothing downstream has to migrate.Verification
Tests added/updated to cover the bug
Manual verification steps — N/A, no UI; verified by executing the inference directly
Negative/edge cases checked
New suite
type keyword rules are ordered by signal strengthcovers all five reported titles plusAdd a new endpointandImplement dark mode(the generic rule must still work), body-level inference, and label precedence.Proven to have teeth: reverting only the ordering makes 6 of those 12 cases fail; all pass with the reorder.
Full suite 282 suites / 5645 tests passed.
eslint0 errors,semgrep0 findings,markdownlint0 issues.validate:issue-fieldspasses: cross-file label and issue-type parity intact.Changelog gate: 10 failing entries with and without the new entry — 0 new failures.
Risk & Rollback
Add a new endpointand similar genuinely feature-shaped titles are unaffected.type:*label still beats every keyword rule, so labelled items are unaffected.Changelog