Skip to content
Closed
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
14 changes: 9 additions & 5 deletions deploy/nginx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 10 additions & 8 deletions e2e/deltasignal-toggle.spec.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);
});
}
});
6 changes: 3 additions & 3 deletions projects/website-angular/src/config/environments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down
Loading