Fix DiscoJuice feeds 204 on no-SP dev instances: ship discofeedResponse.json in main resources - #1414
Closed
Kasinhou wants to merge 1 commit into
Closed
Fix DiscoJuice feeds 204 on no-SP dev instances: ship discofeedResponse.json in main resources#1414Kasinhou wants to merge 1 commit into
Kasinhou wants to merge 1 commit into
Conversation
… when deployed
ClarinDiscoJuiceFeedsDownloadService.openURLConnection() resolves the bundled
DiscoJuice feed via getResource("discofeedResponse.json") whenever
shibboleth.discofeed.url starts with `TEST:`. That resource only existed under
src/test/resources, so it is absent from the packaged server webapp: on a real
deployment `TEST:` resolves to null, downloadJSON() catches the resulting
IOException, the feed cache stays empty, and GET /api/discojuice/feeds returns
204. The UI DiscoJuice auto-popup then crashes on an undefined feed.
Move the fixture into src/main/resources (same classpath location) so it ships
in the webapp and TEST: serves a non-empty feed at runtime. It stays on the
test classpath too, so ClarinDiscoJuiceFeedsControllerIT is unaffected.
Enables no-SP dev instances (e.g. dev-6) to serve a populated feed via
local.cfg: shibboleth.discofeed.allowed=true + shibboleth.discofeed.url=TEST:
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Author
|
Closed as wont fix an actual problem |
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.
Problem
On dev-6 (no Shibboleth SP),
GET /server/api/discojuice/feedsreturns HTTP 204. The Angular UI's DiscoJuice auto-popup then crashes indiscojuice.js($.merge(a.data, undefined)→ Cannot read properties of undefined (reading 'length')), which:/loginand/register(the latter redirects to/login), andThis breaks three
dspace-ui-tests(NAME=lindat-9) Playwright tests. The frontenddiscojuice.jsis byte-identical to v7 and works on dev-5 (prod) because there the feed is populated by a real SP — so the fix is backend-only.Root cause
ClarinDiscoJuiceFeedsDownloadService.openURLConnection()serves the bundled feed viagetResource("discofeedResponse.json")whenshibboleth.discofeed.urlstarts withTEST:. ButdiscofeedResponse.jsonlived only undersrc/test/resources, so it is not packaged into the server webapp. On a real deploymentTEST:resolves tonull→NoContentException→downloadJSON()swallows theIOException→ the feed cache stays empty → controller returns 204.(dev-6 also can't use the default
shibboleth.discofeed.url = https://dev-5.pc:8443/...: that host uses a self-signed cert and the defaultdisable.ssl.check.specific.requests = falsemakes Java reject it — another path to an empty feed.)Change
Move
discofeedResponse.jsonfromsrc/test/resourcestosrc/main/resources(identical classpath locationorg/dspace/app/rest/). It now ships in the webapp soTEST:serves a non-empty feed at runtime. It remains on the test classpath, soClarinDiscoJuiceFeedsControllerITis unaffected.Verified
mvn -pl dspace-server-webapp process-resourcescopies it totarget/classes/org/dspace/app/rest/discofeedResponse.json— exactly wheregetResource(...)looks at runtime.Deploy step for dev-6 (server-side
local.cfg, not committed — keeps it scoped to dev-6)With this,
/api/discojuice/feedsreturns 200 with the bundled feed (?callback=dj_md_1wraps it), the DiscoJuice crash is gone, and the three UI tests pass. No global config is changed, so prod (dev-5) keeps fetching its real SP feed.🤖 Generated with Claude Code