Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production deploy #3377

Merged
merged 38 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
91784c2
fix: Log error stack explicitly on DPA failures (#3328)
DafyddLlyr Jun 27, 2024
b58431a
chore: Bump planx-core (#3329)
DafyddLlyr Jun 27, 2024
90b09f9
feat: Remove optional/required distinction in List schema (#3332)
DafyddLlyr Jun 28, 2024
f7410aa
fix: Trim all form values on node creation (#3330)
DafyddLlyr Jun 28, 2024
e873e11
feat: Remove 'unique' property from List schema (`QuestionField`) (#3…
DafyddLlyr Jun 28, 2024
766e7b2
test: Outstanding List component validation tests (#3323)
DafyddLlyr Jun 28, 2024
50c8b1a
chore: Bump Hasura fargate CPU and memory (staging) (#3335)
DafyddLlyr Jun 28, 2024
afda8e6
fix: Make `val` optional in SetValue component (#3333)
DafyddLlyr Jun 28, 2024
b07f862
refactor: Editor forms tidy up and unify (#3324)
ianjon3s Jun 28, 2024
764a9dc
chore: bump planx-core and @opensystemslab/map (#3337)
jessicamcinchak Jun 28, 2024
fba15e7
feat: stub out editor & API endpoint and send events for Idox Nexus (…
jessicamcinchak Jun 28, 2024
720f1d8
chore: bump planx-core (#3340)
jessicamcinchak Jun 28, 2024
a062ff7
Revert "fix: Trim all form values on node creation" (#3339)
DafyddLlyr Jun 28, 2024
2a095c0
feat: `ChecklistFieldInput` for List component (#3304)
DafyddLlyr Jul 1, 2024
af3659e
fix: Broken lockfiles (#3355)
DafyddLlyr Jul 1, 2024
0f05cc9
chore: Fix broken lockfiles (#3358)
DafyddLlyr Jul 1, 2024
95b54c4
chore: Add `packageManager` field to all `package.json` files (#3359)
DafyddLlyr Jul 2, 2024
69fe9a1
chore(deps): bump graphql from 16.8.1 to 16.9.0 in /api.planx.uk (#3342)
dependabot[bot] Jul 2, 2024
bd40f26
chore(deps-dev): bump uuid and @types/uuid in /api.planx.uk (#3346)
dependabot[bot] Jul 2, 2024
496bc86
[skip pizza] bump prettier from 3.2.4 to 3.3.2 in /e2e (#3356)
dependabot[bot] Jul 2, 2024
45cccff
chore(deps): bump pg from 8.11.3 to 8.12.0 in /sharedb.planx.uk (#3354)
dependabot[bot] Jul 2, 2024
6d6e3d3
[skip pizza] bump uuid from 9.0.0 to 10.0.0 in /hasura.planx.uk/tests…
dependabot[bot] Jul 2, 2024
9374fc1
chore(deps-dev): bump eslint-plugin-simple-import-sort from 10.0.0 to…
dependabot[bot] Jul 2, 2024
a0032b1
chore(deps-dev): bump typescript from 5.4.3 to 5.5.2 in /api.planx.uk…
dependabot[bot] Jul 2, 2024
8ba938d
chore(deps-dev): bump esbuild from 0.21.4 to 0.22.0 in /api.planx.uk …
dependabot[bot] Jul 2, 2024
47bfd25
chore(deps): bump notifications-node-client from 8.1.0 to 8.2.0 in /a…
dependabot[bot] Jul 2, 2024
433f09e
chore(deps): bump @turf/area from 6.5.0 to 7.0.0 in /editor.planx.uk …
dependabot[bot] Jul 2, 2024
0ddc012
[skip pizza] bump typescript from 5.4.3 to 5.5.3 in /e2e (#3360)
dependabot[bot] Jul 2, 2024
dc215a2
feat: Repointing data fetches from ``Teams`` table to ``team_settings…
RODO94 Jul 3, 2024
c844532
chore: Only open dependabot PRs for major versions (#3361)
DafyddLlyr Jul 3, 2024
772ea6a
chore: Bump planx-core (#3365)
DafyddLlyr Jul 3, 2024
712819f
chore: show number units on inactive List if defined (#3367)
jessicamcinchak Jul 3, 2024
2d5ad70
feat: Fetch `team_settings` data for Editor forms and adding Update f…
RODO94 Jul 3, 2024
04a98cb
chore: Run `pnpm lint:fix` in Editor (#3372)
DafyddLlyr Jul 5, 2024
7cda94d
Revert "Revert "feat: build pizzas on alpine"" (#3374)
jessicamcinchak Jul 5, 2024
6d8c06b
feat: `team_settings` form error validation (#3368)
RODO94 Jul 5, 2024
89adc20
feat: `team_settings` column rename from `boundary_json` to `boundary…
RODO94 Jul 5, 2024
721ab2f
chore: Add Espom and Ewell certs to AWS (#3376)
DafyddLlyr Jul 5, 2024
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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,8 @@ UNIFORM_CLIENT_AYLESBURY_VALE=👻
UNIFORM_CLIENT_CHILTERN=👻
UNIFORM_CLIENT_WYCOMBE=👻

## Forthcoming Idox Nexus integration
IDOX_NEXUS_CLIENT=👻

## End-to-end test team (borrows Lambeth's details)
GOV_UK_PAY_SECRET_E2E=👻
12 changes: 6 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ updates:
- "theopensystemslab/planx"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
update-types: ["version-update:semver-patch", "version-update:semver-minor"]

# Hasura
- package-ecosystem: "npm"
Expand All @@ -38,7 +38,7 @@ updates:
- "theopensystemslab/planx"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
update-types: ["version-update:semver-patch", "version-update:semver-minor"]

- package-ecosystem: "docker"
directory: "/hasura.planx.uk"
Expand Down Expand Up @@ -76,7 +76,7 @@ updates:
- "theopensystemslab/planx"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
update-types: ["version-update:semver-patch", "version-update:semver-minor"]

# ShareDB
- package-ecosystem: "npm"
Expand All @@ -90,7 +90,7 @@ updates:
- "theopensystemslab/planx"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
update-types: ["version-update:semver-patch", "version-update:semver-minor"]

- package-ecosystem: "docker"
directory: "/sharedb.planx.uk"
Expand All @@ -115,7 +115,7 @@ updates:
- "theopensystemslab/planx"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
update-types: ["version-update:semver-patch", "version-update:semver-minor"]

- package-ecosystem: "docker"
directory: "/api.planx.uk"
Expand All @@ -142,7 +142,7 @@ updates:
- "theopensystemslab/planx"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
update-types: ["version-update:semver-patch", "version-update:semver-minor"]

# Infrastructure
# - package-ecosystem: "npm"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pizza-teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
action: destroy
api_key: ${{ secrets.VULTR_API_KEY }}
domain: ${{ env.DOMAIN }}
os_type: ubuntu
os_type: alpine
plan: vc2-1c-1gb
pull_request_id: ${{ env.PULLREQUEST_ID }}
region: lhr
Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ jobs:
action: create
api_key: ${{ secrets.VULTR_API_KEY }}
domain: ${{ env.DOMAIN }}
os_type: ubuntu
os_type: alpine
plan: vc2-1c-1gb
pull_request_id: ${{ env.PULLREQUEST_ID }}
region: lhr
Expand All @@ -324,13 +324,19 @@ jobs:
password: ${{ steps.create.outputs.default_password }}
command_timeout: 20m
script: |
apt-get update -y

apk update
apk add docker
addgroup root docker
rc-update add docker default
service docker start
apk add docker-cli-compose

apk add git
git clone "${{ secrets.AUTHENTICATED_REPO_URL }}"
cd planx-new
git fetch origin "pull/${{ env.PULLREQUEST_ID }}/head" && git checkout FETCH_HEAD

apt-get install awscli -y
apk add aws-cli
export AWS_ACCESS_KEY_ID=${{ secrets.PIZZA_AWS_ACCESS_KEY_ID }}
export AWS_SECRET_ACCESS_KEY=${{ secrets.PIZZA_AWS_SECRET_ACCESS_KEY }}
export AWS_REGION=eu-west-2
Expand All @@ -352,15 +358,21 @@ jobs:
username: root
password: ${{ secrets.SSH_PASSWORD }}
command_timeout: 10m
# TODO: some of below script might be superfluous for server update (rather than create)
script: |
apt-get update -y
apk update
apk add docker
addgroup root docker
rc-update add docker default
service docker start
apk add docker-cli-compose

git clone "${{ secrets.AUTHENTICATED_REPO_URL }}"
cd planx-new
git add . && git stash
git fetch origin "pull/${{ env.PULLREQUEST_ID }}/head" && git checkout FETCH_HEAD

apt-get install awscli -y
apk add aws-cli
export AWS_ACCESS_KEY_ID=${{ secrets.PIZZA_AWS_ACCESS_KEY_ID }}
export AWS_SECRET_ACCESS_KEY=${{ secrets.PIZZA_AWS_SECRET_ACCESS_KEY }}
export AWS_REGION=eu-west-2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ api.planx.uk/tmp/
# Ignore certificate files
**/*.chain
**/*.cert
**/*.crt
**/*.key
**/*.pfx
**/*.pkcs12
Expand Down
1 change: 1 addition & 0 deletions api.planx.uk/lib/hasura/metadata/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface ScheduledEvent {
export interface CombinedResponse {
bops?: ScheduledEventResponse;
uniform?: ScheduledEventResponse;
idox?: ScheduledEventResponse;
email?: ScheduledEventResponse;
s3?: ScheduledEventResponse;
}
Expand Down
2 changes: 1 addition & 1 deletion api.planx.uk/modules/admin/session/digitalPlanningData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const getDigitalPlanningApplicationPayload = async (
return res.send(data);
} catch (error) {
return next({
message: `Failed to make Digital Planning Application payload: ${error}`,
message: `Failed to make Digital Planning Application payload: ${error}. Stack: ${(error as Error).stack}`,
});
}
};
12 changes: 11 additions & 1 deletion api.planx.uk/modules/send/createSendEvents/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const createSendEvents: CreateSendEventsController = async (
res,
next,
) => {
const { email, uniform, bops, s3 } = res.locals.parsedReq.body;
const { email, uniform, bops, s3, idox } = res.locals.parsedReq.body;
const { sessionId } = res.locals.parsedReq.params;

try {
Expand Down Expand Up @@ -47,6 +47,16 @@ const createSendEvents: CreateSendEventsController = async (
combinedResponse["uniform"] = uniformEvent;
}

if (idox) {
const idoxEvent = await createScheduledEvent({
webhook: `{{HASURA_PLANX_API_URL}}/idox/${idox.localAuthority}`,
schedule_at: new Date(now.getTime() + 60 * 1000),
payload: idox.body,
comment: `idox_nexus_submission_${sessionId}`,
});
combinedResponse["idox"] = idoxEvent;
}

if (s3) {
const s3Event = await createScheduledEvent({
webhook: `{{HASURA_PLANX_API_URL}}/upload-submission/${s3.localAuthority}`,
Expand Down
1 change: 1 addition & 0 deletions api.planx.uk/modules/send/createSendEvents/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const combinedEventsPayloadSchema = z.object({
bops: eventSchema.optional(),
uniform: eventSchema.optional(),
s3: eventSchema.optional(),
idox: eventSchema.optional(),
}),
params: z.object({
sessionId: z.string().uuid(),
Expand Down
24 changes: 24 additions & 0 deletions api.planx.uk/modules/send/idox/nexus.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import supertest from "supertest";
import app from "../../../server";

describe(`sending an application to Idox Nexus`, () => {
it("fails without authorization header", async () => {
await supertest(app)
.post("/idox/southwark")
.send({ payload: { sessionId: "123" } })
.expect(401);
});

it("errors if the payload body does not include a sessionId", async () => {
await supertest(app)
.post("/idox/southwark")
.set({ Authorization: process.env.HASURA_PLANX_API_KEY! })
.send({ payload: { somethingElse: "123" } })
.expect(400)
.then((res) => {
expect(res.body).toEqual({
error: "Missing application data to send to Idox Nexus",
});
});
});
});
Loading
Loading