Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3279d5b
removed duplicate code
Feb 5, 2025
a906e75
added remove_metadata and fixed get_item
Mar 16, 2025
1415456
added owningCollection and request validation
Mar 17, 2025
bbc3483
enable result count, otherwise non authenticated might get into problems
Mar 18, 2025
89b6757
docs: fix typos across repo
Nov 5, 2025
9c332d2
added resourcepolicy specific for dtq
Jan 20, 2026
e46b57a
add None check
Jan 21, 2026
5c4e9f0
add resourcePolicy from d
Jan 22, 2026
259a975
add group info to resourcePolicy
jr-rk Feb 12, 2026
73b886e
Merge pull request #10 from dataquest-dev/add_group_to_rp
jr-rk Feb 13, 2026
283e39c
fix group properties adding
jr-rk Feb 13, 2026
59402c0
fix: upstream bugfixes and proxy support
Feb 13, 2026
c7ca664
Remove upstream_ref from .gitignore
vidiecan Feb 13, 2026
291bc46
add rp by ai
Feb 16, 2026
3b3063a
fix rp create/delete
jr-rk Feb 17, 2026
e02c3f7
Merge pull request #13 from dataquest-dev/rp_ai
vidiecan Feb 17, 2026
1121bc7
added repr to ResourcePolicy
Feb 18, 2026
7c3c515
Merge pull request #11 from dataquest-dev/fix/upstream-bugfixes-and-p…
milanmajchrak Feb 18, 2026
9f3cd61
reauth
Feb 19, 2026
44fb29e
Merge branch 'dtq' of https://github.com/dataquest-dev/dspace-rest-py…
Feb 19, 2026
e1c05a9
better logs
Feb 23, 2026
51b65fe
add timeout
Feb 24, 2026
db03111
more robust check
Feb 25, 2026
d3c8673
Merge pull request #14 from dataquest-dev/add_timeout
vidiecan Mar 17, 2026
f9ca942
fix(client): return empty bundles on 404 instead of crashing (#16)
vidiecan Aug 17, 2026
c9b4872
merge: bring CLARIN branch (main) into dtq
jr-rk Aug 17, 2026
7937db1
test: add unit + integration suite for downstream usage, with CI
Aug 17, 2026
2687c6c
test: harden suite after adversarial review (faithfulness + gaps)
Aug 17, 2026
ea3e670
ci: run push builds only on dtq
Aug 17, 2026
a2b7140
fix(client): fail-safe get_bitstreams + None on failed create_item/bu…
Aug 17, 2026
3273055
Merge pull request #18 from dataquest-dev/test/dtq-usage-coverage
vidiecan Aug 17, 2026
4049e94
fix(client): raise informative error on non-404 fetch failure
Aug 17, 2026
dbabf5d
Merge pull request #19 from dataquest-dev/fix/explicit-fetch-errors
vidiecan Aug 17, 2026
feeb399
fix(client): correctness sweep - logging, timeouts, file handle, None…
Aug 17, 2026
e9eef06
fix: address Copilot review (handler guard, header copy, docstrings)
Aug 17, 2026
68c4c42
Merge pull request #20 from dataquest-dev/fix/python-correctness-sweep
vidiecan Aug 17, 2026
0c7411b
test: CLARIN consumer-contract suite + main-tailored differential CI
jr-rk Aug 20, 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
164 changes: 164 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
name: Tests

on:
push:
# dtq is the mainline; main is the CLARIN branch we are validating a merge
# into. feat/** and fix/** get CI before they open a PR.
branches: [ dtq, main, 'feat/**', 'fix/**' ]
pull_request:
workflow_dispatch: # manual validation of a merge candidate

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Matches the DSpace-ISstag-integration consumer CI matrix; the library
# itself declares support for >=3.8 (see setup.py).
python-version: ["3.10", "3.12"]

steps:
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
setup.py
requirements-test.txt

- name: Install package + test deps
run: |
python -m pip install --upgrade pip
pip install .
pip install -r requirements-test.txt

- name: Run tests
# Coverage floor guards against the CLARIN surface silently sliding back
# toward the zero it had before test/clarin-usage-coverage landed.
run: >
python -m pytest tests/ -v
--cov=dspace_rest_client --cov-report=term-missing
--cov-fail-under=70

differential-contract:
# THE MERGE GATE. Run the CLARIN consumer-contract suite against BOTH the
# dtq implementation (this checkout) and the main implementation (swapped in
# from origin/main). A test green on both proves the merge preserves that
# behaviour. Tests that deliberately encode a dtq fix or behaviour change
# are marked @pytest.mark.dtq_only and are skipped on the main leg.
#
# Leg selection targets the four CLARIN test files explicitly: the DQ test
# modules import dtq-only symbols (ResourcePolicy, ...) at module scope, so
# collecting them against the main implementation would be an import error.
name: CLARIN contract vs ${{ matrix.impl }} impl
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
impl: [dtq, main]

steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # need origin/main to swap the implementation in

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
cache: pip
cache-dependency-path: requirements-test.txt

- name: Install test deps
run: |
python -m pip install --upgrade pip
pip install -r requirements-test.txt

- name: Swap in the ${{ matrix.impl }} implementation
if: matrix.impl != 'dtq'
run: git checkout "origin/${{ matrix.impl }}" -- dspace_rest_client/

- name: Run CLARIN contract suite
run: |
FILES="tests/test_clarin_read.py tests/test_clarin_write.py \
tests/test_models_clarin.py tests/test_clarin_usage_contract.py"
if [ "${{ matrix.impl }}" = "dtq" ]; then
python -m pytest $FILES -v # full CLARIN surface, incl. dtq_only
else
python -m pytest $FILES -v -m "not dtq_only" # shared contract only
fi

# ---- Consumer smoke jobs -------------------------------------------------
# Turn "the API surface is a superset" into "the consumers still import/run".
# Gated on CONSUMER_READ_TOKEN: until that read-scoped token for the private
# consumer repos exists, the gate job reports enabled=false and consumer-smoke
# is skipped (a clean green), per plan §6.3.
check-consumer-token:
runs-on: ubuntu-latest
outputs:
enabled: ${{ steps.probe.outputs.enabled }}
steps:
- id: probe
env:
TOKEN: ${{ secrets.CONSUMER_READ_TOKEN }}
run: echo "enabled=${{ env.TOKEN != '' }}" >> "$GITHUB_OUTPUT"

consumer-smoke:
needs: check-consumer-token
if: needs.check-consumer-token.outputs.enabled == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- repo: DSpace-ISstag-integration
ref: main
smoke: python -m pytest tests/ mcp/tests/ -q
- repo: dspace-rest-test
ref: master
smoke: python -c "import dspace_rest_client.client"
- repo: dspace-import-clarin
ref: main
smoke: python -c "import dspace_rest_client.client"
# dspace-item-importer is intentionally omitted until its .gitmodules
# is repointed off the deleted `dtq-dev` branch (plan §6.3 / brief §5).
steps:
- uses: actions/checkout@v6
with:
path: candidate

- uses: actions/checkout@v6
with:
repository: dataquest-dev/${{ matrix.repo }}
ref: ${{ matrix.ref }}
token: ${{ secrets.CONSUMER_READ_TOKEN }}
submodules: recursive
path: consumer

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Point the consumer submodule at this candidate commit
run: |
rm -rf consumer/libs/dspace-rest-python
cp -r candidate consumer/libs/dspace-rest-python

- name: Install and smoke
working-directory: consumer
run: |
python -m pip install --upgrade pip
pip install ./libs/dspace-rest-python
if [ -f requirements.lock ]; then pip install -r requirements.lock; fi
if [ -f libs/dspace-rest-python/requirements-test.txt ]; then
pip install -r libs/dspace-rest-python/requirements-test.txt
fi
${{ matrix.smoke }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
__pycache__/
*.py[cod]
*$py.class
*.egg-info/
build/
dist/
.pytest_cache/
.python-version
Pipfile.lock
__pypackages__/
Expand All @@ -9,3 +13,5 @@ __pypackages__/
env/
venv/
.idea/
.coverage
coverage.xml
Loading