Fix duplicate marketplace categories from case-sensitive displayName matching#7334
Open
pdelagrave wants to merge 1 commit intomainfrom
Open
Fix duplicate marketplace categories from case-sensitive displayName matching#7334pdelagrave wants to merge 1 commit intomainfrom
pdelagrave wants to merge 1 commit intomainfrom
Conversation
…Name matching Category.merge() and findOrCreateCategory() used equals() to match categories by displayName, causing "AI" and "ai" to be treated as distinct categories. This resulted in duplicate category entries on the marketplace page when different recipe modules used different casing for the same category name (e.g. rewrite-java uses "AI" while rewrite-ai uses "ai"). Switch both methods to equalsIgnoreCase() so categories with the same name but different casing are properly merged. The first-seen casing is preserved.
timtebeek
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Category.merge()andfindOrCreateCategory()use case-sensitiveequals()to match categories by displayName. When two entries define the same category with different casing, they are treated as distinct categories instead of being merged, resulting in duplicate category entries in the marketplace tree.How this manifested
In
rewrite-java, therecipes.csvis a combination of auto-generated entries and explicit entries fromjava-categories.yml. Three commits created the issue:8fe912f4a-- auto-generatedrecipes.csvwas added, withClassDefinitionLengthandMethodDefinitionLengthunder category"Ai"(title-cased from theorg.openrewrite.java.aipackage name)4ce95cc5e-- added explicit rows for the same recipes with category"AI"(fromjava-categories.yml), but did not remove the original"Ai"rowse2b6e2afd(v8.75.7) -- removed the duplicate"Ai"rows, fixing the CSVThis means
rewrite-javav8.75.6 shipped with both"Ai"and"AI"entries for the same recipes. Any marketplace that installed that version retains the stale duplicate data, and the case-sensitiveequals()inmerge()keeps both categories alive -- showing two "AI" entries in the UI.Solution
Switch both
Category.merge()andfindOrCreateCategory()fromequals()toequalsIgnoreCase()for displayName comparison. The first-seen casing is preserved as the canonical displayName. This prevents duplicate categories from arising regardless of casing inconsistencies in source data.Two new tests cover:
"AI"and the other"ai"produces a single category