Skip to content

DSpace9/copy the assetstore during import - #1452

Merged
milanmajchrak merged 2 commits into
dtq-dev-9-basefrom
ci/copy-assetstore-on-import-8603
Aug 13, 2026
Merged

DSpace9/copy the assetstore during import#1452
milanmajchrak merged 2 commits into
dtq-dev-9-basefrom
ci/copy-assetstore-on-import-8603

Conversation

@Kasinhou

@Kasinhou Kasinhou commented Aug 12, 2026

Copy link
Copy Markdown

What

The v9 import restores the SQL dump, which brings the bitstream rows but not the files. Without copying the assetstore, /dspace/assetstore stays empty — every bitstream download returns 500, and OAI silently serves generated CMDI instead of the authored files.

This adds an ASSETSTORE_PATH input and a copy assetstore step to import-8603, doing the same docker cp that dtq-dev's import-db action does for v7.

Notes

  • No chown (unlike v7): the v9 runtime image has no dspace user and runs as root, so v7's chown -R dspace:dspace fails with invalid user.
  • Before merging: /opt/dspace-envs/8603/assetstore must exist on dev-6, otherwise docker cp fails. Leave ASSETSTORE_PATH empty to import without bitstream files.

The dump restores the bitstream rows (internal_id, size_bytes, checksum) but
not the files, so /dspace/assetstore stayed empty on the v9 stack and every
bitstream download returned 500 - including tiny licence files, so it was not
route-specific.

It also broke OAI silently. SpecialItemService.getUploadedMetadata() reads the
authored CMDI from the METADATA bundle, and its catch block returns an empty
Document, so an unreadable file degrades to the generated CMDI profile rather
than failing. That surfaced only as six mismatching OAI records in the REST
test suite and took days to attribute.

dev-5 already does this copy in the import-db composite action; the v9 stack
had no equivalent step. Two deliberate differences from dev-5's version:

- The copy runs before `dspace oai import -c`. Copying the files and even
  restarting the container is not enough - the records keep serving the
  generated substitute until that cache is cleared.
- No `chown -R dspace:dspace`. The v9 runtime stage is FROM eclipse-temurin
  with no USER directive, so there is no `dspace` user (the one in the
  Dockerfile exists only in the build stage) and the webapp runs as root, which
  can both read and write root-owned files. dev-5's command fails outright here
  with "chown: invalid user: 'dspace:dspace'".

The step verifies the result inside the container and fails if the assetstore
is still empty, so a silent recurrence is not possible. ASSETSTORE_PATH can be
set to an empty string to import without bitstream files.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Kasinhou Kasinhou changed the title DSpace9.3/ci(import-8603): copy the assetstore during import, as dev-5 does DSpace9/copy the assetstore during import Aug 12, 2026
Drop the extra guards (missing-path / basename / still-empty checks) and the
long comment, keeping just the empty-check + docker cp that dtq-dev's import-db
action uses for v7. Also shorten the ASSETSTORE_PATH input description.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the deploy.yml GitHub Actions workflow to copy the DSpace 8603 assetstore from the dev machine into the running DSpace container during the import-8603 job, aiming to ensure bitstream files exist after restoring a SQL dump (so downloads and OAI-derived metadata match production).

Changes:

  • Add a new ASSETSTORE_PATH input for both workflow_call and workflow_dispatch (defaulting to /opt/dspace-envs/8603/assetstore).
  • Export ASSETSTORE_PATH into the import-8603 job environment.
  • Insert a new “copy assetstore” step after restarting the DSpace container and before creating the administrator.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/deploy.yml
@Kasinhou
Kasinhou requested a review from milanmajchrak August 13, 2026 13:32
@milanmajchrak
milanmajchrak merged commit f6cf600 into dtq-dev-9-base Aug 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants