diff --git a/deploy/nginx/README.md b/deploy/nginx/README.md index 6283d53b..acb05c6d 100644 --- a/deploy/nginx/README.md +++ b/deploy/nginx/README.md @@ -90,11 +90,15 @@ The shared routes name `site`, `content`, `analysis`, `content_node`, absorbs both: node in this repository taking over most of what Tomcat serves, and the site being startable locally, where they become compose service names. -`/api/` for DeltaSignal exists in none of the Apache configuration, which is why -DeltaSignal cannot work on beta today — the Angular side calls it as a bare -relative path, routed only by the dev server's proxy, which does not exist in a -built artifact. Note the port on the dev box: **8090**, not the 8080 DeltaSignal's -own compose binds, because 8080 there is Tomcat. +`/api/` is DeltaSignal's: the Angular side calls `/api/pathways`, `/api/parse` and +`/api/solve` as bare relative paths, which `common/routes.conf` sends to the +`deltasignal` upstream (the dev server's proxy does the same under `ng serve`). +Beta's site profile turns the Perturb button on because of this route; a deployment +without it must leave `deltaSignal` off. The DeltaSignal service is not part of +this repository's compose: it runs from DeltaSignal's own repository on the same +host, published on loopback only, at **8090**, not the 8080 DeltaSignal's own +compose binds, because 8080 there is Tomcat. If it stops, the button's calls fail, +so it is checked with the rest of beta (`/api/pathways` answers a list). ## Connections, which is a reason this is worth doing diff --git a/e2e/deltasignal-toggle.spec.ts b/e2e/deltasignal-toggle.spec.ts index b26c0514..2ccde966 100644 --- a/e2e/deltasignal-toggle.spec.ts +++ b/e2e/deltasignal-toggle.spec.ts @@ -1,10 +1,10 @@ /** * DeltaSignal is offered only where a deployment asks for it. * - * It is a research feature that depends on a DeltaSignal backend, and `/api` is - * routed only by proxy.conf.js -- the dev server's proxy, which does not exist in - * a built artifact. A deployment without that backend must not offer a button - * whose every call fails, so the profile decides, and absent means off. + * It is a research feature that depends on a DeltaSignal backend, reached at + * `/api` through proxy.conf.js under the dev server and through nginx on beta. A + * deployment without that route must not offer a button whose every call fails, + * so the profile decides, and absent means off. * * Both states are checked against one build by setting `window.__APP_ENV` before * the app's scripts run, which is the runtime profile override the config already @@ -54,8 +54,10 @@ test.describe('The DeltaSignal toggle', () => { await expect(page.locator('cr-deltasignal-panel')).toHaveCount(0); }); - test('offers it on a deployment that does', async ({ page }) => { - await openWithProfile(page, 'development'); - await expect(perturb(page)).toHaveCount(1); - }); + for (const profile of ['development', 'beta']) { + test(`offers it on a deployment that does: ${profile}`, async ({ page }) => { + await openWithProfile(page, profile); + await expect(perturb(page)).toHaveCount(1); + }); + } }); diff --git a/projects/website-angular/src/config/environments.ts b/projects/website-angular/src/config/environments.ts index 4476a00a..1186eea0 100644 --- a/projects/website-angular/src/config/environments.ts +++ b/projects/website-angular/src/config/environments.ts @@ -52,9 +52,9 @@ export interface SiteProfile { * `specs/005-search-page-answers/research.md`, D1 and D3. * * Absent means off, like `deltaSignal`, so a deployment opts in rather than - * inherits. Only `development` has it today: the endpoint is not deployed on - * beta yet, and no keypair has been exchanged, so every other profile would - * offer a button whose calls fail. + * inherits. `development` and `beta` have it: beta's route is served by + * serve-prod.js, which holds the signing key (see the beta profile); any other + * profile would offer a button whose calls fail. */ searchAnswerEndpoint?: string; /**