epugh commented on PR #4203:
URL: https://github.com/apache/solr/pull/4203#issuecomment-4315740781
We took a diversion to update ConfigsetsAPI with an idea that we would reuse
those APIs in the schema designer. Unfortunantly the only reusable API was teh
"download a zipped configset". It turns out the other SchemaDesignerAPI
endpoints that look like they could be replace with a ConfigsetsAPI call can't
be because of Schema Designer specific business logic.
I'll paste below two examples:
## listConfigs vs listConfigSets — cannot replace
listConfigSets returns ListConfigsetsResponse { List<String> configSets } —
a flat list of all raw configset names, including ._designer_films.
listConfigs does designer-specific logic the JS UI depends on:
Filters out system/excluded configsets and raw ._designer_* entries from the
top-level list
Maps ._designer_X → X (strips the prefix) and marks it as status=0 (draft in
progress)
Returns Map<String, Integer> where 0=draft, 1=designer-disabled, 2=enabled —
these status integers drive the color coding and filtering in schema-designer.js
listConfigs must stay.
## updateFileContents vs uploadConfigSetFile — cannot replace
uploadConfigSetFile (PUT /configsets/{configSetName}/{filePath}) is a
general-purpose file upload — it writes bytes to a configset and returns a
plain SolrJerseyResponse.
updateFileContents does three critical designer-specific things that
uploadConfigSetFile cannot do:
solrconfig.xml pre-validation: Before saving, it loads and parses the XML
using InMemoryResourceLoader / SolrConfig.readFromResourceLoader to catch
errors before corrupting the configset. The error is returned in the response
body (updateFileError + fileContent fields) without touching ZK.
Temp collection reload: After saving, calls
configSetHelper.reloadTempCollection(mutableId, false).
Full schema response: Re-indexes sample docs and returns a complete
SchemaDesignerResponse (schema fields, settings, doc count, analysis errors).
Name blocker: uploadConfigSetFile calls
SolrIdentifierValidator.validateConfigSetName() which rejects names starting
with . like ._designer_films, so it literally cannot be used for designer draft
configsets.
updateFileContents must stay.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]