Repository navigation
SOLR-17914: Implement Create Collection dialog - #5258
Draft
nick-boss-tech wants to merge 14 commits into
Draft
nick-boss-tech wants to merge 14 commits into
nick-boss-tech wants to merge 14 commits into
Conversation
…anced options open
This was referenced Oct 28, 2026
malliaridis
self-requested a review
October 30, 2026 10:27
Christos advised on SOLR-17913 that the collections designs have changed and the card will not be used in its current format, so it comes out of this PR and continues on its own branch. The label_router string stays because the create collection form uses it.
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.
🤖 AI text below 🤖 (reviewed by Nick Shanin)
Ready for review, but held as a draft due to the project's open-PR cap; I'll mark it open on request.
https://issues.apache.org/jira/browse/SOLR-17914
Christos Malliaridis is the sponsor and promised reviewer for this ticket. An earlier version of this diff also carried the SOLR-17913 collection details card; it was removed on 2026-10-30 after Christos advised that the collections designs have changed and the card will not be used in its current format. The card continues on its own branch,
solr-17913-collection-details-card. He offered the former designs as a temporary way to create collections while the new designs are in progress (comment 18133018). This PR follows the new work-in-progress design (Figma node 2635-40394), so the layout may change when that design is final.What happens today
The new UI cannot create a collection. Nothing in the new UI sends a create request. The Collections section is not in the new UI yet. The old UI's duplicate-name check is a
@todo(collections.js:230). The server rejects a duplicate name with a 400 "collection already exists" (CreateCollectionCmd.java:134).What this change does
It adds the create dialog, the create request, and the error mapping.
CreateCollectionFormshows the name, configset, shards, NRT, TLOG and PULL counts, a read-only placement field, and a collapsed advanced section with router, route field, async and properties. Create is enabled only when the input is valid (line 131). The name rule matches the server pattern but also rejects periods (line 84).HttpCollectionsRepositoryposts the request toapi/collections. A 400 whose message starts with "collection already exists" becomesNameExists. Other failures keep the server message (lines 34-50).CreateCollectionResult.nameError()andgeneralError()turn those results into form text (CreateCollectionErrors.kt).Nothing in the app calls the form yet. The Collections page that hosts it is SOLR-17912.
Proof
The new tests pass, and the full JVM suite passes at head
d02ccdcdd8. Run 2026-10-30:HttpCollectionsRepositoryTest5 of 5: request body, duplicate name, alias conflict, server message kept, non-JSON failure.CreateCollectionFormTest10 of 10.CreateCollectionErrorsTest3 of 3.:shared:jvmTest: 65 tests, 0 failures, 0 errors, 2 skipped (UserAuthenticationContentTestandStartContentTest, outside this change).:shared:spotlessCheckpasses.Mutation check: widening the duplicate-name match to any 400 with a message makes
testAliasConflictIsNotMappedToNameExistsandtestKeepsTheServerMessageForOtherFailuresfail. A base run is not possible here: the repository is new code, so the base has nothing to fail on.Browser verification: the wasm browser leg passes at the current head
d02ccdcdd8: 69 tests, 66 passed, 3 skipped (pre-existing@Ignore), 0 failures, 0 errors, on Chrome for Testing 156 (headless), run 2026-10-30. The fix that made it pass,ui/shared/karma.config.d/compose-resources.jsserving the Compose string resources to the wasm test run, is part of this diff. The form is not reachable in the app yet.Screenshots (headless Chromium 156, production
CreateCollectionForminsideSolrTheme, 1024x768 with fixture states; hosted in a secret gist):The choices, with recommendations
1. The server's response is the duplicate-name check. Recommended. The new UI has no collections list to check against. A pre-check would need a new data source and could still race. The server's response cannot race, and the server already returns it (rung 1, see the link above). Is the server response the right check, or should the form also load the collection list?
2. The name rule is stricter than the server. Recommended as built. The design's helper text, "Letters, digits, _ and -", is what the user reads. The server also allows periods, so the form never sends a name it told the user was invalid. This choice is settled here (rung 3).
3. Properties are typed as
key=valuepairs, separated by commas. Recommended. The server takes a string map (CreateCollectionRequestBody.java:54). The design names "properties" but draws no control, so a plain text field is the smallest input that maps to that type. Would you rather have a key and value row editor?4. A failure shows the server's message, or "Could not create the collection." when the response has none. Recommended. A server message is more specific than any fixed text, and the fallback covers responses without one. This choice is settled here (rung 4).
5. The create request ships with the form. Recommended. The first acceptance criterion is "the user can successfully create a new collection", and only the request meets it. The header action that opens this dialog stays with SOLR-17912. Should the request wait for that PR instead?
Limits
AI-generated description. Nick Shanin directed the work and takes responsibility for this contribution.