medusajs/medusa

10 rules learned from 999 merged PRs: the files and habits in medusajs/medusa that kept needing a fix after merge.

Merged PRs read
999
Needed a fix
50 (5.0%)
Reverted
1
Merged between
2026-06-12 and 2026-11-10

Tested on PRs the rules had never seen

7 of the 76 code PRs that breached a rule needed a fix (9%), against 3 of the 75 that breached none (4%).

Rules were learned from older PRs, then tested on later PRs they hadn't seen. How we tested

PRTitle and the rule it breachedWhat happened
fix(core-flows): import only declared dependencies at runtimeFragile area: packages/core/ (21 of 138 earlier PRs needed a fix) fixed in #17479, same day
feat(dashboard, core-flows, js-sdk, types, medusa): add export customers featureFragile area: packages/medusa/ (14 of 62 earlier PRs needed a fix) fixed in #17314, same day
feat: Ensure writes target live version, other caching improvementsHotspot: packages/modules/search/src/types/index.ts (4 of 5 earlier PRs needed a fix) fixed in #16966, 4 days later

Fix-prone files and folders

PRs that touched these paths needed a follow-up fix more often than the 8% repo average. Counts are PRs that touched the path.

  1. Hotspot: packages/modules/providers/search-postgres/src/services/postgres-search.ts

    6 of 9 earlier PRs that changed this needed a fix.

    3 clean, 6 fixed (67%)
  2. Hotspot: packages/modules/search/src/types/index.ts

    5 of 9 earlier PRs that changed this needed a fix.

    4 clean, 5 fixed (56%)
  3. Hotspot: packages/modules/search/src/providers/search-medusa/utils/plan.ts

    5 of 9 earlier PRs that changed this needed a fix.

    4 clean, 5 fixed (56%)
  4. Hotspot: packages/modules/search/src/providers/search-medusa/utils/query.ts

    5 of 9 earlier PRs that changed this needed a fix.

    4 clean, 5 fixed (56%)
  5. Hotspot: packages/modules/search/src/services/search-module-service.ts

    6 of 11 earlier PRs that changed this needed a fix.

    5 clean, 6 fixed (55%)
  6. Hotspot: packages/modules/search/src/utils/seeding.ts

    5 of 10 earlier PRs that changed this needed a fix.

    5 clean, 5 fixed (50%)
  7. Fragile area: packages/medusa/

    21 of 97 earlier PRs that changed this needed a fix.

    76 clean, 21 fixed (22%)
  8. Fragile area: packages/modules/

    29 of 147 earlier PRs that changed this needed a fix.

    118 clean, 29 fixed (20%)
  9. Fragile area: packages/medusa-test-utils/

    4 of 25 earlier PRs that changed this needed a fix.

    21 clean, 4 fixed (16%)
  10. Fragile area: packages/core/

    32 of 205 earlier PRs that changed this needed a fix.

    173 clean, 32 fixed (16%)

Conventions

Habits most PRs here follow, where PRs that broke them needed a fix more often. Counts on each bar are the PRs that broke it.

No habit here made the list.

Recent PRs that needed a fix

Rules flagged 134 recent PRs, and 20 of those needed a fix (15%), against 7% of all recent PRs. These are the 15 with the strongest rule that needed a fix, with the PR that fixed each.

PRTitleSizeRule it breachedWhat happened
feat: Implement Medusa Cloud as a search provider +2,393 -10 touches packages/modules/search/src/services/search-module-service.ts5 clean, 6 fixed fixed in #16516, 2 days later
feat: Implement a provider-agnostic swap index +1,474 -793 touches packages/modules/search/src/services/search-module-service.ts5 clean, 6 fixed fixed in #16781, 7 days later
feat: Add search admin methods +1,180 -24 touches packages/modules/search/src/services/search-module-service.ts5 clean, 6 fixed fixed in #16594, 7 days later
feat: Ensure writes target live version, other caching improvements +571 -76 touches packages/modules/search/src/services/search-module-service.ts5 clean, 6 fixed fixed in #16966, 4 days later
feat: Ensure reindex clears stale versions +439 -84 touches packages/modules/search/src/utils/seeding.ts5 clean, 5 fixed fixed in #16930, 6 days later
feat: Make reindex timestamp configurable +443 -71 touches packages/modules/search/src/utils/seeding.ts5 clean, 5 fixed fixed in #16894, 13 days later
feat: Implement postgres search provider +4,142 -163 touches packages/medusa/76 clean, 21 fixed fixed in #16581, 9 days later
feat: Implement Adyen as a payment provider +2,137 -3 touches packages/medusa/76 clean, 21 fixed fixed in #17579, same day
feat: Add search helpers, add default search endpoint +1,279 -83 touches packages/medusa/76 clean, 21 fixed fixed in #16903, 13 days later
feat: Cleanup the provided search endpoint to be more generic +767 -555 touches packages/medusa/76 clean, 21 fixed fixed in #17044, 11 days later
feat(dashboard, core-flows, js-sdk, types, medusa): add export customers feature +1,089 -9 touches packages/medusa/76 clean, 21 fixed fixed in #17314, same day
Feat/add support clearing unused indexes +1,000 -84 touches packages/medusa/76 clean, 21 fixed fixed in #17035, 13 days later
fix: Simplify how redis cache data is stored +137 -380 touches packages/modules/118 clean, 29 fixed fixed in #16549, 3 days later
fix: Faceting fixes for search +414 -75 touches packages/modules/118 clean, 29 fixed fixed in #16676, 5 days later
Fix/search improvements +288 -165 touches packages/modules/118 clean, 29 fixed fixed in #16891, 11 days later

Get this for your own repo

Precall reads your repo's history the same way and comments on new PRs that touch the spots that kept breaking. Download the rules file for medusajs/medusa.