Skip to content

ConfigSetUploadTool: use generated strongly-typed V2 API; add -z support test#35

Draft
Copilot wants to merge 9 commits intomainfrom
copilot/migrate-configset-upload-tool
Draft

ConfigSetUploadTool: use generated strongly-typed V2 API; add -z support test#35
Copilot wants to merge 9 commits intomainfrom
copilot/migrate-configset-upload-tool

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 23, 2026

ConfigSetUploadTool was using the generic GenericV2SolrRequest with a hardcoded path string instead of the generated, strongly-typed SolrJ V2 request class. Additionally, -z (ZooKeeper host) support was untested despite being wired up via getConnectionOptions().

Changes

ConfigsetsApi.java — add x-genericEntity to upload endpoints

The uploadConfigSet and uploadConfigSetFile @RequestBody annotations now carry the GENERIC_ENTITY_PROPERTY extension, matching the pattern used by ClusterFileStoreApis.uploadFile. This tells the OpenAPI code generator to emit a ContentWriter that streams the body as application/octet-stream instead of JSON.

@RequestBody(
    required = true,
    extensions = {
      @Extension(properties = {@ExtensionProperty(name = GENERIC_ENTITY_PROPERTY, value = "true")})
    })
InputStream requestBody

ConfigSetUploadTool.java — replace GenericV2SolrRequest with generated class

Before:

var request = new GenericV2SolrRequest(SolrRequest.METHOD.PUT, "/configsets/" + confName);
request.withContent(zipData, "application/octet-stream");

After:

var zipStream = new ByteArrayInputStream(zipData);
var request = new ConfigsetsApi.UploadConfigSet(confName, zipStream);

The generated ConfigsetsApi.UploadConfigSet correctly sets the V2 API version, encodes the path parameter, handles overwrite/cleanup query params, and writes the body as application/octet-stream.

ConfigSetUploadToolTest.java — add -z coverage

Added testUpconfigWithZkHost to verify that passing -z <zkAddr> resolves a live Solr node from ZooKeeper and successfully uploads the configset via the HTTP V2 API.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • develocity.apache.org
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java -XX:ReservedCodeCacheSize=256m -XX:TieredStopAtLevel=1 -XX:&#43;UseParallelGC -XX:ActiveProcessorCount=1 --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED (dns block)
  • metadata.google.internal
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java -Dcommon-solr.dir=/home/REDACTED/work/solr/solr/solr -Dgradle.lib.dir=/home/REDACTED/.gradle/wrapper/dists/gradle-8.10-bin/deqhafrv1ntovfmgh0nh3npr9/gradle-8.10/lib -Dgradle.user.home=/home/REDACTED/.gradle -Dgradle.worker.jar=/home/REDACTED/.gradle/caches/8.10/workerMain/gradle-worker.jar -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Djava.security.manager=default -Djava.security.policy=/home/REDACTED/work/solr/solr/gradle/testing/randomization/policies/solr-tests.policy -Djava.util.logging.config.file=/home/REDACTED/work/solr/solr/gradle/testing/defaults-tests/logging.properties -Djdk.map.althashing.threshold=0 -Djetty.insecurerandom=1 -Djetty.testMode=1 -Djunit4.childvm.count=1 -Djunit4.childvm.id=0 -Dorg.gradle.internal.worker.tmpdir=/home/REDACTED/work/solr/solr/solr/core/build/tmp/test/work -DtempDir=/home/REDACTED/work/solr/solr/build/tmp/tests-tmp -Dtests.LUCENE_VERSION=10.4.0 -Dtests.asserts=true -Dtests.codec=random (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Migrate ConfigSetUploadTool to Solr HTTP V2 helper Migrate ConfigSetUploadTool to Solr HTTP V2 API (ConfigsetsApi.UploadConfigSet) Mar 23, 2026
Copilot AI requested a review from epugh March 23, 2026 16:34
…t and UpdateACLToolTest

Agent-Logs-Url: https://github.com/epugh/solr/sessions/206b9da4-e307-462a-aa43-677fdd7d647e

Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
Copilot AI changed the title Migrate ConfigSetUploadTool to Solr HTTP V2 API (ConfigsetsApi.UploadConfigSet) Migrate ConfigSetUploadTool to HTTP V2 API and ZkSubcommandsTest to SolrCloudTestCase Mar 29, 2026
Copilot AI changed the title Migrate ConfigSetUploadTool to HTTP V2 API and ZkSubcommandsTest to SolrCloudTestCase Migrate ZkSubcommandsTest to SolrCloudTestCase; add -s support to ConfigSetUploadTool; extract ConfigSet tool tests Mar 29, 2026
Copilot AI and others added 2 commits March 29, 2026 20:11
Copilot AI changed the title Migrate ZkSubcommandsTest to SolrCloudTestCase; add -s support to ConfigSetUploadTool; extract ConfigSet tool tests ConfigSetUploadTool: use generated strongly-typed V2 API; add -z support test Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants