Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a8a0064
Empty commit just to run actions
milanmajchrak Apr 8, 2026
c206107
Empty commit just to run actions
milanmajchrak Apr 8, 2026
b9f81e3
Upgrade codeql-action v2 to v3, rebase on target branch
milanmajchrak Apr 8, 2026
e8d0da1
Add Flyway migration to create dataset table for DatashareDataset entity
milanmajchrak Apr 8, 2026
c0b5928
Update CI-FIX-SUMMARY with dataset table migration details
milanmajchrak Apr 8, 2026
c6d1069
Fix proxy wildcard tests to use actual MockWebServer hostname
milanmajchrak Apr 8, 2026
d521145
Fix license headers, checkstyle violations, and unused imports
milanmajchrak Apr 8, 2026
a8103af
Update CI-FIX-SUMMARY with all fixes
milanmajchrak Apr 8, 2026
267e856
Trigger CI run
milanmajchrak Apr 8, 2026
3b9b059
Re-enable searchFilterIssued in defaultConfiguration searchFilters
milanmajchrak Apr 8, 2026
550e7d0
Update CI-FIX-SUMMARY with IT fix details
milanmajchrak Apr 8, 2026
b567750
Fix DatashareDatasetServiceImpl.find() to return null instead of thro…
milanmajchrak Apr 8, 2026
4c2ecdc
Update CI-FIX-SUMMARY with DatashareDatasetServiceImpl.find() fix
milanmajchrak Apr 8, 2026
4f0a370
Fix additional DatashareDatasetServiceImpl stub methods
milanmajchrak Apr 8, 2026
398f5fd
Re-enable searchFilterIssued in all discovery configurations
milanmajchrak Apr 8, 2026
b7b4257
Update CI-FIX-SUMMARY with discovery.xml full uncomment details
milanmajchrak Apr 8, 2026
3237c27
Fix discovery IT failures: add DataShare filter/facet/sort matchers
milanmajchrak Apr 9, 2026
ca8c36a
Update CI-FIX-SUMMARY with discovery test matcher fixes
milanmajchrak Apr 9, 2026
591f389
Fix BrowsesResourceControllerIT failures: align browse config and fix…
milanmajchrak Apr 9, 2026
5f11856
Fix DiscoveryRestControllerIT and VocabularyRestRepositoryIT for Data…
milanmajchrak Apr 9, 2026
a26dacb
Update CI-FIX-SUMMARY with browse, NPE, discovery, and vocabulary fix…
milanmajchrak Apr 9, 2026
e8426ef
Upgrade Wandalen/wretry.action from v1.3.0 to v3
milanmajchrak Apr 9, 2026
f2a8477
Fix all checkstyle violations in DataShare code (no suppressions)
milanmajchrak Apr 9, 2026
a7cf9b7
Fix CurationScriptIT: replace unreliable demo7.dspace.org with http:/…
milanmajchrak Apr 9, 2026
298336f
Skip codecov upload when CODECOV_TOKEN secret is not configured
milanmajchrak Apr 9, 2026
bfdce69
Fix codecov: use continue-on-error instead of secrets in job-level if
milanmajchrak Apr 9, 2026
1215431
Remove codecov job and coverage-report profile from CI
milanmajchrak Apr 9, 2026
481c93d
Address code review: revert customer config, adapt tests for DataShar…
milanmajchrak Apr 10, 2026
dab6a11
Move searchFilterIssued/sortDateIssued to test-discovery.xml, rename …
milanmajchrak Apr 13, 2026
7c90240
Do not track scripts into github
milanmajchrak Apr 13, 2026
a0d322e
Merge branch 'datashare-UoEMainLibrary-dspace-8_x' into uoe/fix-githu…
milanmajchrak Apr 14, 2026
168459a
Restore .gitignore: fix binary corruption from merge conflict
milanmajchrak Apr 15, 2026
ddf35b8
UoE/fix: Github actions
milanmajchrak Apr 20, 2026
bafcdff
Removed ds schema; fix temporal coverage step and DataCite crosswalk …
milanmajchrak Apr 20, 2026
03a6782
Removed ds schema; fix temporal coverage step and DataCite crosswalk …
milanmajchrak Apr 20, 2026
af1ddf7
Added missing Other input field for the license
milanmajchrak Apr 20, 2026
c0260eb
Added missing Other input field for the license
milanmajchrak Apr 20, 2026
78421ae
feat: add bitstream accessStatus endpoint with embargoDate
milanmajchrak Apr 20, 2026
7f20416
Remove Datashare ds schema and restore related migrations
milanmajchrak Apr 21, 2026
dec281d
UoE/feat: add bitstream accessStatus endpoint with embargoDate
milanmajchrak Apr 21, 2026
3cd7bb8
UoE/Removed ds schema; fix temporal coverage step and DataCite crossw…
milanmajchrak Apr 21, 2026
081f0b3
Initial commit
milanmajchrak Apr 21, 2026
35cdb5a
Merge branch 'uoe-fix-github-actions-it-2' of github.com:dataquest-de…
milanmajchrak Apr 21, 2026
64029f0
Fix checkstyle violation and missing license header in DataShare files
milanmajchrak Apr 21, 2026
4685227
Fix BitstreamMatcher to include accessStatus embed/link for new acces…
milanmajchrak Apr 21, 2026
8e4f3ee
UoE/fix: Github actions - it2
milanmajchrak Apr 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 1 addition & 40 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Run Maven ${{ matrix.type }}
env:
TEST_FLAGS: ${{ matrix.mvnflags }}
run: mvn --no-transfer-progress -V install -P-assembly -Pcoverage-report $TEST_FLAGS
run: mvn --no-transfer-progress -V install -P-assembly $TEST_FLAGS

Comment thread
milanmajchrak marked this conversation as resolved.
# If previous step failed, save results of tests to downloadable artifact for this job
# (This artifact is downloadable at the bottom of any job's summary page)
Expand All @@ -70,43 +70,4 @@ jobs:
name: ${{ matrix.type }} results
path: ${{ matrix.resultsdir }}

# Upload code coverage report to artifact, so that it can be shared with the 'codecov' job (see below)
- name: Upload code coverage report to Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.type }} coverage report
path: 'dspace/target/site/jacoco-aggregate/jacoco.xml'
retention-days: 14

# Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test
# job above. This is necessary because Codecov uploads seem to randomly fail at times.
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
codecov:
# Must run after 'tests' job above
needs: tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

# Download artifacts from previous 'tests' job
- name: Download coverage artifacts
uses: actions/download-artifact@v4

# Now attempt upload to Codecov using its action.
# NOTE: We use a retry action to retry the Codecov upload if it fails the first time.
#
# Retry action: https://github.com/marketplace/actions/retry-action
# Codecov action: https://github.com/codecov/codecov-action
- name: Upload coverage to Codecov.io
uses: Wandalen/wretry.action@v1.3.0
with:
action: codecov/codecov-action@v4
# Ensure codecov-action throws an error when it fails to upload
with: |
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
# Try re-running action 5 times max
attempt_limit: 5
# Run again in 30 seconds
attempt_delay: 30000
6 changes: 3 additions & 3 deletions .github/workflows/codescan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
# https://github.com/github/codeql-action
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
# Codescan Javascript as well since a few JS files exist in REST API's interface
languages: java, javascript
Expand All @@ -56,8 +56,8 @@ jobs:
# NOTE: Based on testing, this autobuild process works well for DSpace. A custom
# DSpace build w/caching (like in build.yml) was about the same speed as autobuild.
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# Perform GitHub Code Scanning.
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Ignore the MVN compiled output directories from version tracking
target/
scripts/

## Ignore tags index files created by Exuberant Ctags
tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.sql.SQLException;
import java.util.Date;

import org.dspace.content.Bitstream;
import org.dspace.content.Item;
import org.dspace.core.Context;

Expand Down Expand Up @@ -39,4 +40,27 @@ public String getAccessStatusFromItem(Context context, Item item, Date threshold
* @throws SQLException An exception that provides information on a database access error or other errors.
*/
public String getEmbargoFromItem(Context context, Item item, Date threshold) throws SQLException;

/**
* Calculate the access status for a bitstream.
*
* @param context the DSpace context
* @param bitstream the bitstream
* @param threshold the embargo threshold date
* @return an access status value
* @throws SQLException An exception that provides information on a database access error or other errors.
*/
public String getAccessStatusFromBitstream(Context context, Bitstream bitstream, Date threshold)
throws SQLException;

/**
* Retrieve embargo information for a bitstream.
*
* @param context the DSpace context
* @param bitstream the bitstream to check for embargo information
* @param threshold the embargo threshold date
* @return an embargo date string
* @throws SQLException An exception that provides information on a database access error or other errors.
*/
public String getEmbargoFromBitstream(Context context, Bitstream bitstream, Date threshold) throws SQLException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.Date;

import org.dspace.access.status.service.AccessStatusService;
import org.dspace.content.Bitstream;
import org.dspace.content.Item;
import org.dspace.core.Context;
import org.dspace.core.service.PluginService;
Expand Down Expand Up @@ -72,4 +73,14 @@ public String getAccessStatus(Context context, Item item) throws SQLException {
public String getEmbargoFromItem(Context context, Item item) throws SQLException {
return helper.getEmbargoFromItem(context, item, forever_date);
}

@Override
public String getAccessStatusFromBitstream(Context context, Bitstream bitstream) throws SQLException {
return helper.getAccessStatusFromBitstream(context, bitstream, forever_date);
}

@Override
public String getEmbargoFromBitstream(Context context, Bitstream bitstream) throws SQLException {
return helper.getEmbargoFromBitstream(context, bitstream, forever_date);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,40 @@ private Date retrieveShortestEmbargo(Context context, Bitstream bitstream) throw

return embargoDate;
}

/**
* Calculate the access status for a single bitstream.
*
* @param context the DSpace context
* @param bitstream the bitstream
* @param threshold the embargo threshold date
* @return an access status value
*/
@Override
public String getAccessStatusFromBitstream(Context context, Bitstream bitstream, Date threshold)
throws SQLException {
return calculateAccessStatusForDso(context, bitstream, threshold);
}

/**
* Retrieve the embargo date for a single bitstream.
*
* @param context the DSpace context
* @param bitstream the bitstream to check for embargo information
* @param threshold the embargo threshold date
* @return an embargo date string, or null if no embargo
*/
@Override
public String getEmbargoFromBitstream(Context context, Bitstream bitstream, Date threshold)
throws SQLException {
if (bitstream == null) {
return null;
}
String accessStatus = calculateAccessStatusForDso(context, bitstream, threshold);
if (!EMBARGO.equals(accessStatus)) {
return null;
}
Date embargoDate = retrieveShortestEmbargo(context, bitstream);
return embargoDate != null ? embargoDate.toString() : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.sql.SQLException;

import org.dspace.content.Bitstream;
import org.dspace.content.Item;
import org.dspace.core.Context;

Expand Down Expand Up @@ -54,4 +55,24 @@ public interface AccessStatusService {
* @throws SQLException An exception that provides information on a database access error or other errors.
*/
public String getEmbargoFromItem(Context context, Item item) throws SQLException;

/**
* Calculate the access status for a Bitstream.
*
* @param context the DSpace context
* @param bitstream the bitstream
* @return an access status value
* @throws SQLException An exception that provides information on a database access error or other errors.
*/
public String getAccessStatusFromBitstream(Context context, Bitstream bitstream) throws SQLException;

/**
* Retrieve embargo information for a Bitstream.
*
* @param context the DSpace context
* @param bitstream the bitstream to check for embargo information
* @return an embargo date string
* @throws SQLException An exception that provides information on a database access error or other errors.
*/
public String getEmbargoFromBitstream(Context context, Bitstream bitstream) throws SQLException;
}
34 changes: 15 additions & 19 deletions dspace-api/src/main/java/org/dspace/app/itemupdate/ItemUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.dspace.content.Item;
import org.dspace.content.datashare.DatashareItemDataset;
import org.dspace.content.factory.ContentServiceFactory;
import org.dspace.content.service.ItemService;
import org.dspace.core.Context;
Expand All @@ -38,10 +39,6 @@
import org.dspace.handle.factory.HandleServiceFactory;
import org.dspace.handle.service.HandleService;

//DATASHARE - start
import org.dspace.content.datashare.DatashareItemDataset;
//DATASHARE - end

/**
* Provides some batch editing capabilities for items in DSpace.
* <ul>
Expand Down Expand Up @@ -427,21 +424,20 @@ protected void processArchive(Context context, String sourceDirPath, String item
Item item = itarch.getItem();

// DATASHARE - start
for (UpdateAction action : actionMgr)
{
// action must either a DeleteBitstreamsAction
if(org.dspace.app.itemupdate.DeleteBitstreamsAction.class.isInstance(action) ||
org.dspace.app.itemupdate.AddBitstreamsAction.class.isInstance(action)) {
try {
// delete dataset this will be regenerated later
new DatashareItemDataset(context, item).delete();
} catch(Exception e) {
// Do nothing
}
}
}
// DATASHARE - end

for (UpdateAction action : actionMgr) {
// action must either a DeleteBitstreamsAction
if (org.dspace.app.itemupdate.DeleteBitstreamsAction.class.isInstance(action) ||
org.dspace.app.itemupdate.AddBitstreamsAction.class.isInstance(action)) {
try {
// delete dataset this will be regenerated later
new DatashareItemDataset(context, item).delete();
} catch (Exception e) {
// Do nothing
}
}
}
// DATASHARE - end

itemService.update(context, item); //need to update before commit
context.uncacheEntity(item);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ public void requestOpenAccess(Context context, RequestItem ri)
// DATASHARE - start
/**
* Checks if requested item is emailable based on size constraints.
* Items/bitstreams larger than the configured maximum size emailable.bitstreams.max.size MB
* Items/bitstreams larger than the configured maximum size emailable.bitstreams.max.size MB
* will not be emailed.
*
*
* @param context DSpace context
* @param ri The request item
* @return true if the item can be emailed, false otherwise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ public DSpaceControlledVocabularyIndex getVocabularyIndex(String nameVocab) {

Set<String> metadataFields = new HashSet<>();
Map<String, List<String>> formsToFields = this.authoritiesFormDefinitions.get(nameVocab);
if (formsToFields == null) {
return null;
}
for (Map.Entry<String, List<String>> formToField : formsToFields.entrySet()) {
metadataFields.addAll(formToField.getValue().stream().map(value ->
StringUtils.replace(value, "_", "."))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.content.datashare;

import org.dspace.content.DSpaceObject;
import org.dspace.content.DSpaceObjectLegacySupport;
import org.dspace.content.Item;
import org.dspace.content.datashare.service.DatashareDatasetService;
import org.dspace.content.factory.ContentServiceFactory;
import org.dspace.core.Constants;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;
import org.dspace.content.DSpaceObject;
import org.dspace.content.DSpaceObjectLegacySupport;
import org.dspace.content.Item;
import org.dspace.content.datashare.service.DatashareDatasetService;
import org.dspace.content.factory.ContentServiceFactory;
import org.dspace.core.Constants;

/**
* DataShare item dataset. That is a zip file that contains all item bitstreams.
Expand Down
Loading
Loading