Skip to content

12141 - Storage Driver API#12182

Merged
ChengShi-1 merged 31 commits into
developfrom
storage-driver-endpoint
May 4, 2026
Merged

12141 - Storage Driver API#12182
ChengShi-1 merged 31 commits into
developfrom
storage-driver-endpoint

Conversation

@jp-tosca

@jp-tosca jp-tosca commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Which issue(s) this PR closes:

Special notes for your reviewer:

Suggestions on how to test this:

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?:

Additional documentation:

@jp-tosca jp-tosca self-assigned this Feb 25, 2026
@jp-tosca jp-tosca moved this to In Progress 💻 in IQSS Dataverse Project Feb 25, 2026
@jp-tosca jp-tosca added GREI Re-arch Issues related to the GREI Dataverse rearchitecture Size: 50 A percentage of a sprint. 35 hours. Project: HDV SPA Rollout labels Feb 25, 2026
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java Fixed
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java Fixed
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java Fixed
@cmbz cmbz added the FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25) label Feb 25, 2026
@github-actions

This comment has been minimized.

@cmbz cmbz added the FY26 Sprint 18 FY26 Sprint 18 (2026-02-25 - 2026-03-11) label Feb 26, 2026
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses #12141 by moving Dataverse Storage Driver endpoints out of the Admin API namespace and exposing them under the Dataverses API.

Changes:

  • Moved storage driver GET/PUT/DELETE endpoints from /api/admin/dataverse/{alias}/storageDriver to /api/dataverses/{identifier}/storageDriver.
  • Replaced the former “list storage drivers” admin endpoint with a dataverse-scoped endpoint intended to list allowed drivers.
  • Updated integration tests and admin docs/release notes to reflect the endpoint move.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 20 comments.

Show a summary per file
File Description
src/test/java/edu/harvard/iq/dataverse/api/UtilIT.java Updates helper methods to call the new dataverses storage driver endpoints (but list path currently mismatches new API).
src/test/java/edu/harvard/iq/dataverse/api/S3AccessIT.java Updates calls to the storage-driver listing helper to include a dataverse alias.
src/test/java/edu/harvard/iq/dataverse/api/DatasetsIT.java Updates storage-driver listing helper usage for dataset storage driver test.
src/main/java/edu/harvard/iq/dataverse/engine/command/impl/SetDataverseStorageDriverCommand.java New command to set a collection’s storage driver by label.
src/main/java/edu/harvard/iq/dataverse/engine/command/impl/GetDataverseStorageDriverCommand.java New command to fetch direct/effective storage driver id with release-based permission requirements.
src/main/java/edu/harvard/iq/dataverse/engine/command/impl/GetDataverseAllowedStorageDriverCommand.java New command to list drivers (currently returns all drivers; permission model may need alignment).
src/main/java/edu/harvard/iq/dataverse/engine/command/impl/DeleteDataverseStorageDriverComman.java New command to reset a collection’s configured storage driver (class name contains a typo).
src/main/java/edu/harvard/iq/dataverse/engine/command/impl/SetDataverseMetadataLanguageCommand.java Removes an unused import.
src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java Adds new /storageDriver and /allowedStorageDrivers endpoints under /api/dataverses/{identifier}; removes unrelated commented-out logo code; introduces unused imports.
src/main/java/edu/harvard/iq/dataverse/api/Admin.java Removes the old admin storage driver endpoints.
src/main/java/edu/harvard/iq/dataverse/api/Info.java Adds imports but currently leaves them unused (compile-breaking).
doc/sphinx-guides/source/admin/dataverses-datasets.rst Updates curl examples to the new endpoint locations; superuser-only wording likely no longer matches implementation.
doc/release-notes/12141-storage-driver-endpoints.md Adds release note for breaking endpoint changes; contains typos and path accuracy issues.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java Outdated
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Info.java Outdated
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java Outdated
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Info.java Outdated
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java Outdated
Comment thread src/test/java/edu/harvard/iq/dataverse/api/UtilIT.java Outdated
import com.google.common.collect.Lists;
import com.google.api.client.util.ArrayMap;
import com.google.api.client.util.Data;
import com.google.api.services.storage.Storage.AnywhereCaches.Get;

Copilot AI Mar 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These newly added imports are unused in this file and will fail compilation (Java treats unused imports as errors). Please remove them unless they’re actually needed.

Suggested change
import com.google.api.services.storage.Storage.AnywhereCaches.Get;

Copilot uses AI. Check for mistakes.
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java Outdated
Comment thread doc/release-notes/12141-storage-driver-endpoints.md Outdated
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java Fixed
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java Fixed
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java Fixed
@jp-tosca jp-tosca moved this from In Progress 💻 to Ready for Review ⏩ in IQSS Dataverse Project Mar 3, 2026
@jp-tosca jp-tosca removed their assignment Mar 3, 2026
@github-actions

This comment has been minimized.

4 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@jp-tosca jp-tosca marked this pull request as ready for review March 9, 2026 14:44
Comment thread doc/release-notes/12141-storage-driver-endpoints.md Outdated
@stevenwinship stevenwinship self-assigned this Mar 11, 2026
@stevenwinship stevenwinship moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Mar 11, 2026
@cmbz cmbz added this to the 6.11 milestone Mar 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java Outdated
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Info.java
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java
Comment thread doc/sphinx-guides/source/admin/dataverses-datasets.rst
@github-actions

This comment has been minimized.

@jp-tosca

jp-tosca commented Apr 1, 2026

Copy link
Copy Markdown
Contributor Author

@stevenwinship this is ready to review, thanks!

GetDataverseAllowedStorageDriverCommand getAllowedStorageDriversCommand = new GetDataverseAllowedStorageDriverCommand(request, dv);
return ok(execCommand(getAllowedStorageDriversCommand));
} catch (WrappedResponse wr) {
return handleWrappedResponse(wr);

Check warning

Code scanning / CodeQL

Information exposure through an error message Medium

Error information
can be exposed to an external user.

Copilot Autofix

AI about 1 month ago

To fix this without changing endpoint behavior more than necessary, avoid passing the wrapped response through handleWrappedResponse(wr) in this method and instead:

  1. Log the exception server-side with context (id) and stack trace.
  2. Return a generic error response to the client (same status family, but non-revealing message).

In src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java, update the catch (WrappedResponse wr) block in listStorageDrivers(...) (around lines 2255–2257). Replace the direct handleWrappedResponse(wr) return with a sanitized error(...) response (e.g., BAD_REQUEST with generic text) and add a logger.log(...) call. No new imports are needed because Logger/Level are already imported and used in this file pattern.

Suggested changeset 1
src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java b/src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java
--- a/src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java
+++ b/src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java
@@ -2253,7 +2253,8 @@
             GetDataverseAllowedStorageDriverCommand getAllowedStorageDriversCommand = new GetDataverseAllowedStorageDriverCommand(request, dv);
             return ok(execCommand(getAllowedStorageDriversCommand));
         } catch (WrappedResponse wr) {
-            return handleWrappedResponse(wr);
+            logger.log(Level.WARNING, "Failed to list allowed storage drivers for dataverse: " + id, wr);
+            return error(Response.Status.BAD_REQUEST, "Unable to list allowed storage drivers.");
         } 
     }
 
EOF
@@ -2253,7 +2253,8 @@
GetDataverseAllowedStorageDriverCommand getAllowedStorageDriversCommand = new GetDataverseAllowedStorageDriverCommand(request, dv);
return ok(execCommand(getAllowedStorageDriversCommand));
} catch (WrappedResponse wr) {
return handleWrappedResponse(wr);
logger.log(Level.WARNING, "Failed to list allowed storage drivers for dataverse: " + id, wr);
return error(Response.Status.BAD_REQUEST, "Unable to list allowed storage drivers.");
}
}

Copilot is powered by AI and may make mistakes. Always verify output.
@github-actions

This comment has been minimized.

@stevenwinship stevenwinship self-assigned this Apr 1, 2026
@github-project-automation github-project-automation Bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Apr 1, 2026
@stevenwinship stevenwinship removed their assignment Apr 1, 2026
@cmbz cmbz added the FY26 Sprint 21 FY26 Sprint 21 (2026-04-08 - 2026-04-22) label Apr 8, 2026
@cmbz cmbz added the FY26 Sprint 22 FY26 Sprint 22 (2026-04-22 - 2026-05-06) label Apr 22, 2026
@ChengShi-1 ChengShi-1 self-assigned this Apr 28, 2026
@ChengShi-1 ChengShi-1 moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Apr 28, 2026
@ChengShi-1

Copy link
Copy Markdown
Contributor

@jp-tosca Could you solve the conflict here? Thank you!

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:storage-driver-endpoint
ghcr.io/gdcc/configbaker:storage-driver-endpoint

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@ChengShi-1 ChengShi-1 merged commit 9d2418e into develop May 4, 2026
20 of 21 checks passed
@github-project-automation github-project-automation Bot moved this from QA ✅ to Merged 🚀 in IQSS Dataverse Project May 4, 2026
ErykKul added a commit to IQSS/dataverse-client-javascript that referenced this pull request May 5, 2026
PR #12182 merged on dataverse develop and moved the per-collection
storage-driver endpoint:

  OLD: PUT /api/admin/dataverse/{alias}/storageDriver
  NEW: PUT /api/dataverses/{alias}/storageDriver

The CI integration tests on PR #403 now run against a Dataverse
container that includes the move, so setStorageDriverViaApi was
hitting the old admin path and getting 404, which cascaded into
every dataset/file test that depends on the directUploadTestCollection
having LocalStack as its storage driver.

Fix: update setStorageDriverViaApi to use the new public endpoint.
The endpoint still requires X-Dataverse-Key for write operations
(superuser only), so authentication is unchanged.
ErykKul added a commit to IQSS/dataverse-frontend that referenced this pull request May 5, 2026
Pulls the latest prerelease of the SDK published from PR #403 after
its CI went green following the IQSS/dataverse#12182 storage-driver
endpoint move. This version ships:

- The tree node listing helpers (listDatasetTreeNode +
  iterateDatasetTreeNode) that the tree-view track will consume.
- The public re-export of DataverseApiAuthMechanism, replacing the
  current deep import in src/standalone-uploader/index.tsx.
- The server-driven S3 tagging (FileUploadDestination.tagging) that
  removes the duplicate client-side flag.

Lockfile updated; no behaviour change in this commit (consumer code
still uses the existing deep import + inline axios; follow-up commits
will wire in the new public surfaces).
@jp-tosca jp-tosca moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25) FY26 Sprint 18 FY26 Sprint 18 (2026-02-25 - 2026-03-11) FY26 Sprint 20 FY26 Sprint 20 (2026-03-26 - 2026-04-08) FY26 Sprint 21 FY26 Sprint 21 (2026-04-08 - 2026-04-22) FY26 Sprint 22 FY26 Sprint 22 (2026-04-22 - 2026-05-06) GREI Re-arch Issues related to the GREI Dataverse rearchitecture Size: 50 A percentage of a sprint. 35 hours.

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

API Get Dataverse Storage Driver

9 participants