Repository navigation
Spec 010 T066: the analysis report PDF to pdf-export (pdf-export spec 002 T018, T021) - #960
Merged
Merged
Conversation
… 002 T018, T021) The analysis gateway sends GET (and HEAD) /AnalysisService/report/... to pdf-export, a second upstream (REPORT_UPSTREAM), unqueued: the report lane and REPORT_LIMIT are gone. A client's reports in flight count towards PER_CLIENT and are refused past it; a reader who leaves gives its place back. pdf-export is told the client in X-Reactome-Client, set to the gateway's clientOf over anything the request sent, and a pdf-export that cannot be reached is a 503 in the analysis service's JSON form. Everything else still goes to the AnalysisService. nginx sets X-Reactome-Client from the client's address on /AnalysisService/, and test-config.sh now runs each deployment's image against a stand-in upstream to show a request naming another client is still named by its address (seen failing without the directive). pdf-export pinned to 55cde47 (its T020 replay, T026, T027); its printer's working folder a tmpfs owned by its user (PDF_EXPORT_WORK); still loopback only; mem_limit 3g for the kept reports. The "PDF Result" button opens the report's address in a new tab instead of fetching and saving it. The register gains the gateway's three report rows and the report's two missing ones; spec 010 gains FR-025 and T066. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adamjohnwright
added a commit
to reactome/pdf-export
that referenced
this pull request
Nov 14, 2026
Spec 002 T018, T021: done in reactome/WebsiteAngular#960
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.
The website's analysis report PDF,
GET /AnalysisService/report/…, answered by pdf-export instead of the AnalysisService. This is pdf-export spec 002 T018 and T021, done here as spec 010 T066 (Story 6, the analysis gateway) with a new FR-025.What changes
The analysis gateway (
tools/analysis-gateway/gateway.ts)GET(andHEAD)/AnalysisService/report/…goes to pdf-export, a second upstream (REPORT_UPSTREAM, default127.0.0.1:4370). It is not queued: the report lane andREPORT_LIMITare gone. Every other request still goes to the AnalysisService.PER_CLIENTis kept. A client's reports in flight count towards it, and a report past it is refused (503, never queued). A reader who leaves a report gives its place back.X-Reactome-Client, set to the gateway's ownclientOf(an IPv6 client by its /64). Any value the request sent is removed.503in the analysis service's JSON form, as pdf-export writes its own503(Retry-After,no-store, CORS). The AnalysisService's502is unchanged./healthnow reportsreports: { upstream, active }in place of the report lane.nginx (
routes-core.conf):/AnalysisService/setsX-Reactome-Client $remote_addr, overwriting any incoming value. The routes are unchanged, so the dev proxy and nginx tables still agree (routes.spec.ts).Compose and the image (T018)
55cde47, currentmain: T020's replay (chore: stop installing with --legacy-peer-deps #215) and the decisions Three e2e tests pass only on retry, and CI is configured not to notice #217 and chore: move the Angular train to 21.2.23 and run on Node 24 #218.tmpfsat/work(PDF_EXPORT_WORK). It is mode 0700, owned by the service's user, andnoexec. This matters because a report killed mid-print leaves its page, which holds the submitted identifiers, until the service restarts (R10).contracts/analysis-api.md).mem_limitgoes from 2g to 3g, to make room for the reports kept in memory (512 MB by default).The "PDF Result" button opens the report's address in a new tab. Before, the page fetched and saved it, which would save pdf-export's "being made" page as
report.pdf.ManagedDownloadDirectivetakes[crManagedDownload]="false"to leave a link to the browser.The register (
documentation/declared-differences.md): the report's status moves to "website routed". New rows:503when it can't be reached;HEADanswered405by pdf-export.Tests, each seen failing
gateway.spec.ts), 7 new tests against a stand-in pdf-export. Seven mutations, each caught:HEADnot sent to pdf-exportdeploy/nginx/test-config.sh): afternginx -t, each deployment's image runs against a stand-inanalysisupstream in a namespace with no network. A request sendingX-Reactome-Client,X-Real-IP,X-Forwarded-ForandCF-Connecting-IPnaming another client must reach it named by its own address. With the directive removed it fails on all three deployments (client=203.0.113.9); with it, all pass.compose.spec.ts): the tmpfs,PDF_EXPORT_WORKandREPORT_UPSTREAMchecks fail onmain's compose.e2e/analysis-results.spec.ts, "the result files download"): with the report stubbed, clicking "PDF Result" opens a tab at the report's address, the page fetches nothing and nothing downloads. Without the change, no tab opens (timeout). This is folded into that test, which has its own recording. A new test would need a new recording, which I could not take here.Compared on the development host
These ran on loopback only, with no public host, production service or ReactomeGSA involved. pdf-export
serveran at55cde47from source on the private release 98 graph, behind this branch's gateway, against this host's own AnalysisService. The token was made as R5/R9 describe: seven gene symbols and two made-up identifiers.ci/replay.ts, AnalysisService against the gateway path, over T001's error cases: 11 cases, 9 the same, 2 the listed differences (a malformed token, one holding%2F), 0 others. Call 4's refusals matched the stub.Content-Type,Content-Disposition, CORS and body were identical, with the 400's timestamp masked.number=1) through the gateway answered200 application/pdf,report.pdf, 11 pages, in 17 s. The working folder was empty afterwards.503, with pdf-export unreachable, as above.200 application/pdf.To deploy (beta)
docker compose build pdf-export analysis-gateway(pdf-export rebuilds at the new pin).docker compose up -d pdf-export analysis-gateway: pdf-export gets its tmpfs andPDF_EXPORT_WORK, and the gateway getsREPORT_UPSTREAM.REPORT_LIMITis no longer read, so drop it from.envif it's set there. Nothing else in.envchanges.docker compose build nginx && docker compose run --rm nginx nginx -t && docker compose up -d nginx, for the new header./healthon 4350 showsreports.upstreamat 4370, and a report from the site opens in a tab and downloads.Production and release nginx still send
/AnalysisService/to Tomcat directly, so their reports stay Java's until the gateway runs there.🤖 Generated with Claude Code