SOLR-17731: Fix shadowed v2 alias and snapshot APIs #5353
🤖 AI text below 🤖
Should deleting a missing snapshot remain a no-op for the CLI? It succeeded idempotently on v1. After this change the v2 404 prints “Failed,” but the command still exits 0. This test explicitly enforces both because run() requires exit 0. I’d preserve the CLI’s no-op for an already absent snapshot. If we want to make it a CLI error instead, the test should require a nonzero exit status.
🤖 AI text below 🤖
Could we cover a proxied base URL before moving all four CLI commands to v2? With a base path like /solr-tenant/solr, the v2 URL builder replaces the first /solr substring, producing /api-tenant/solr instead of /solr-tenant/api. That rewrite already exists, but the v1 snapshot CLI didn’t use it. Can we preserve the configured prefix or keep these commands on v1 until the rewrite is fixed?
🤖 AI text below 🤖
Could we keep an async-create assertion in the new HTTP tests? The removed unit test checked that the body’s async ID reached the collection command; the replacement cases all submit synchronously. A generated-client test could assert the returned request ID, wait for terminal success via REQUESTSTATUS, and then check that the snapshot appears in the listing.
🤖 AI text below 🤖
If the CLI migration stays in this PR, could the upgrade notes say that snapshot create now requires a server with the v2 route fix? A new CLI pointed at an unupgraded node through --solr-url can hit the same HTTP 405 this PR fixes. Operators with proxy allowlists or custom permissions scoped to /solr/admin/collections should also check the new /api/collections/.../snapshots paths.
yeah, i think the version of bin/solr is in lockstep with the version of Solr server. We don't ship a seperate binary (maybe we should), so these types of things I think are okay..
i see... took me and claude a bit to figure out what you mean, that the bug is already here, this PR just exposes it... I actually have similar worries for our v2 api calls in the Admin UI, though I have never tested that...
goign to move it to it's own PR...
@epugh You modified this file instead of the one for solr-10. That suggests that the changes here should be main-only. But the milestone is set to 10.x, which is a contradiction. What's going on?
thanks @dsmiley .. So, I think this is me getting a bit too fast and loose.. AI tooling really likes to add stuff to these major-changes-in docs, and often I delete the entry as "not a major chnage". In this case, I was a bit on the fence about if this change was going to be 11 only, but then decided it was 10 and 11.
I'll open up a fresh PR in the morning to fix this, and beef up my workflow a bit to prevent it in the future.
I don't see an inbound reference in the timeline of the new PR you speak of. Anyway, I'm backporting this, including moving the major-changes-in-solr-11.adoc to major-changes-in-solr-10.adoc. I suggest you use that part for the fixup.
epugh
https://issues.apache.org/jira/browse/SOLR-17731
Description
The DELETE resource paths shadow
GET /api/aliases/{aliasName}andPOST /api/collections/{collName}/snapshots/{snapshotName}, causing valid requests to return HTTP 405. This PR restores both routes and brings the alias and collection snapshot APIs into line with the v2 conventions.Solution
GetAliasByNameResponsefor each entry in the v2 alias listing. Entries now containname, acollectionsarray, andproperties, matching the detail response. Update the Admin UI to consume this structure and preserve the v1LISTALIASESresponse format.bin/solr snapshot create,delete,list, anddescribeto the generated v2 clients. Use typed metadata directly when describing a snapshot, removing the legacy response parsing.Implementation and test development assisted by Claude and Codex.
Tests
Validation performed during development:
AdminUiCollectionsScreenTest: 7 passing Selenium tests, including alias collections and properties../gradlew tidy./gradlew check -x test./gradlew :solr:packaging:devFullThe snapshot BATS suite has not been run.