Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions deploy/nginx/common/routes.conf
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ location ~ ^/ContentService/exporter/(diagram|document|event)/ {
proxy_send_timeout 300s;
}

# DeltaSignal. Apache has no such route, which is why DeltaSignal cannot work on
# beta today: the Angular side calls /api/pathways, /api/parse and /api/solve as
# bare relative paths, routed only by proxy.conf.js — the dev server's proxy,
# which does not exist in a built artifact.
# DeltaSignal. The Angular side calls /api/pathways, /api/parse and /api/solve as
# bare relative paths: proxy.conf.js routes them under the dev server, and this
# route in a built deployment. A site profile turns the Perturb button on only
# where one of the two exists (environments.ts, `deltaSignal`).
location /api/ {
include /etc/nginx/common/upstream-proxy.conf;
proxy_pass http://deltasignal/api/;
Expand Down
12 changes: 6 additions & 6 deletions projects/website-angular/src/config/environments.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ describe('site profiles', () => {
});

it('offers DeltaSignal only where a DeltaSignal backend can be reached', () => {
// /api is routed by proxy.conf.js, which is the dev server's proxy: it does
// not exist in a built artifact, and nothing in deploy.yml or the Apache
// config provides it. A deployment that turned this on would offer a button
// whose every call fails, so only `development` may have it until there is a
// deployed backend to point at.
// /api is routed by proxy.conf.js under the dev server, and by beta's nginx
// (deploy/nginx/common/routes.conf) to the DeltaSignal service on the same
// host. A deployment that turned this on without either would offer a
// button whose every call fails, so only those two may have it.
const reachable = ['development', 'beta'];
for (const [name, profile] of Object.entries(SITE_PROFILES)) {
expect(profile.deltaSignal === true, `${name}.deltaSignal`).toBe(name === 'development');
expect(profile.deltaSignal === true, `${name}.deltaSignal`).toBe(reachable.includes(name));
}
});

Expand Down
12 changes: 8 additions & 4 deletions projects/website-angular/src/config/environments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ export const SITE_PROFILES: Record<ProfileName, SiteProfile> = {
searchAnswerEndpoint: '/search-answer',
analysisSummaryEndpoint: '/analysis-summary',
chatHandoffEndpoint: '/chat-handoff',
// Beta's nginx routes /api/ to the DeltaSignal service on this host
// (deploy/nginx/common/routes.conf), so the Perturb button's calls are
// answered here as they are under the dev server's proxy.
deltaSignal: true,
host: 'origin',
originFallback: 'https://beta.reactome.org',
s3: S3,
Expand All @@ -196,10 +200,10 @@ export const SITE_PROFILES: Record<ProfileName, SiteProfile> = {

development: {
variant: 'main',
// The only deployment that can reach a DeltaSignal backend: proxy.conf.js
// routes /api to DELTASIGNAL_BACKEND, which is a dev-server proxy and does
// not exist in a built artifact. Turning this on elsewhere would offer a
// button whose every call fails, so the other profiles leave it absent.
// proxy.conf.js routes /api to DELTASIGNAL_BACKEND under the dev server;
// beta's nginx routes it the same way. Turning this on where neither
// proxies /api would offer a button whose every call fails, so the other
// profiles leave it absent.
deltaSignal: true,
// Same reasoning, and note the path: `/api` above already belongs to the
// DeltaSignal backend, so the answer proxy cannot live under it.
Expand Down
Loading