Repository navigation
Conversation
Characterization-tested fixes (test written to the intended behaviour first,
then the method corrected) to methods the main-lineage consumers call:
get_bundle_by_name / get_items_from_collection / get_resource_policy
non-200 or empty body -> clean None/[] instead of a NoneType subscript
crash; get_resource_policy also records last_err so a caller can tell an
HTTP error from a genuine empty result.
get_user_by_email 404/any non-200 -> None (+ last_err), not a truthy
uuid-less User that slips past a consumer `if user:` guard.
create_submit_group 201 with an empty body -> None, not Group(None).
add_member post the canonical /eperson/epersons/{uuid} href;
the bare /epersons/ path 404s and DSpace rejects the uri-list.
Group(None) / User(None) empty object, not a TypeError.
get_owningCollection (dtq-only) non-200 -> None + last_err, so ISstag's
src/repo/_audit.py `owning_col is None and last_err.status_code == 401`
reauth retry stops being dead code.
Stacked on the test/CI PR, which supplies the _helpers builders, pytest.ini
markers and the differential-contract job these tests run under. Merge that
PR first. The failure-mode assertions are marked dtq_only (deselected on the
main leg): main carries the same bugs, but propagating these fixes to main is
deliberately out of scope here.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- get_items_from_collection: a failed request returned [], the consumers' end-of-collection signal, silently truncating their paging loops. It now goes through fetch_resource and returns None (last_err set on a non-200). - get_user_by_email: DSpace answers an unknown email with 204 No Content. 204 is the clean miss (None, no log, no last_err); 404 and any other non-user answer return None but log ERROR and keep last_err; the raw email is never logged. Transport errors propagate instead of looking like a miss. - create_group / create_user / create_submit_group: return None when the parsed body has no uuid, since Group(None)/User(None) are now accepted and would be truthy, uuid-less objects. - get_owningCollection: an unparseable 200 records last_err; a transport error returns None (logged) so one timeout does not abort a prefetch loop. - add_member: correct the comment - DSpace resolves the posted eperson by its trailing UUID, the bare /epersons/ href was not broken.
vidiecan
force-pushed
the
fix/clarin-shared-surface-hardening
branch
from
October 7, 2026 07:26
2a95b6f to
4eaf688
Compare
vidiecan
force-pushed
the
test/clarin-usage-coverage
branch
from
October 7, 2026 07:26
0c7411b to
13ba16c
Compare
Rebased onto the new #23 head (dtq a62a63e) + review fixesNew head: Conflict resolution
Review fixes (each test written first and seen failing)
Note on transport errors: Verified locally
Deferred (not changed here)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
The
dspace_rest_client/production fixes that were previously bundled with thetest/CI PR, split out per review so the test PR stays scoped. Stacked on
test/clarin-usage-coverage(base of this PR) — it supplies the_helpersbuilders,
pytest.inimarkers and thedifferential-contractjob these testsrun under. Merge that PR first.
Targets
dtq. The failure-mode assertions aredtq_onlyand deselected on themain leg;
maincarries the same bugs, but propagating these fixes tomainisdeliberately out of scope here.
Fixes (each characterization-tested: test written first, then the method)
get_bundle_by_name/get_items_from_collection/get_resource_policyNoneTypesubscript crash on non-200None/[]get_resource_policyIndexErroron empty policy list; no error/empty distinctionNone, recordslast_errget_user_by_emailUseron 404 (slips pastif user:)None, recordslast_err, no noisy 404 logcreate_submit_groupGroup(None)crash on a 201 with empty bodyNoneadd_member/epersons/{uuid}href → DSpace 422/404/eperson/epersons/{uuid}Group(None)/User(None)TypeErrorget_owningCollection(dtq-only)Collectionon non-200 → ISstag_audit.py401-reauth was dead codeNone+last_errVerified locally
Leg A (full suite,
dtqimpl with these fixes): 137 pass.