Skip to content

Commit

Permalink
Upgrade to node 20.10 and postgres 14.10 (#1052)
Browse files Browse the repository at this point in the history
  • Loading branch information
lognaturel authored Dec 8, 2023
1 parent 38410eb commit 31c42c0
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ version: 2.1
jobs:
build:
docker:
- image: cimg/node:18.17.0
- image: cimg/postgres:14.6
- image: cimg/node:20.10.0
- image: cimg/postgres:14.10
environment:
POSTGRES_PASSWORD: odktest

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/oidc-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 18.17.0
node-version: 20.10.0
cache: 'npm'
- run: sudo apt-get install -y curl
- run: make test-oidc-e2e
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/oidc-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
services:
# see: https://docs.github.com/en/enterprise-server@3.5/actions/using-containerized-services/creating-postgresql-service-containers
postgres:
image: postgres:14.6
image: postgres:14.10
env:
POSTGRES_PASSWORD: odktest
ports:
Expand All @@ -23,10 +23,10 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 18.17.0
node-version: 20.10.0
cache: 'npm'
- run: npm ci --legacy-peer-deps
- run: make fake-oidc-server-ci > fake-oidc-server.log &
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/soak-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.17.0]
node-version: [20.10.0]
services:
# see: https://docs.github.com/en/enterprise-server@3.5/actions/using-containerized-services/creating-postgresql-service-containers
postgres:
image: postgres:14.6
image: postgres:14.10
env:
POSTGRES_PASSWORD: odktest
ports:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/standard-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
services:
# see: https://docs.github.com/en/enterprise-server@3.5/actions/using-containerized-services/creating-postgresql-service-containers
postgres:
image: postgres:14.6
image: postgres:14.10
env:
POSTGRES_PASSWORD: odktest
ports:
Expand All @@ -23,10 +23,10 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 18.17.0
node-version: 20.10.0
cache: 'npm'
- run: npm ci --legacy-peer-deps
- run: node lib/bin/create-docker-databases.js
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ODK Central Backend is, first and foremost, a RESTful HTTP API server that manag

## Setting up a development environment

1. Install Node.js 18 (other versions will not work).
1. Install Node.js 20 (other versions will not work).
2. Install PostgreSQL 14 (older versions will not work).
3. Set up the database. This can be done manually (see "Setting up the database manually"), or by running `make run-docker-postgres` if you have Docker installed.
4. Go to the repository root in a command line (where this README is) and run `make` with no arguments. This will install all npm dependencies and run all necessary migrations on the database; see the [makefile](Makefile) for details.
Expand Down
2 changes: 1 addition & 1 deletion oidc-dev/fake-oidc-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {},
"volta": {
"node": "18.17.0"
"node": "20.10.0"
},
"license": "SEE LICENSE IN ../LICENSE",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion oidc-dev/playwright-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"http-proxy-middleware": "^2.0.6"
},
"volta": {
"node": "18.17.0"
"node": "20.10.0"
},
"license": "SEE LICENSE IN ../../LICENSE"
}
2 changes: 1 addition & 1 deletion oidc-tester.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# See: https://hub.docker.com/_/node
# See: https://wiki.debian.org/DebianReleases#Codenames
# See: https://en.wikipedia.org/wiki/Debian_version_history
FROM node:18.17.0-bullseye
FROM node:20.10-bullseye

RUN apt-get update && apt-get install wait-for-it && rm -rf /var/lib/apt/lists/*

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"version": "0.1.0",
"private": true,
"engines": {
"node": "18"
"node": "20"
},
"volta": {
"node": "18.17.0"
"node": "20.10.0"
},
"dependencies": {
"@sentry/node": "~7",
Expand Down
2 changes: 1 addition & 1 deletion soak-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"eslint": "^8.20.0"
},
"volta": {
"node": "18.17.0"
"node": "20.10.0"
},
"license": "SEE LICENSE IN ../LICENSE"
}
35 changes: 18 additions & 17 deletions test/integration/api/submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1374,34 +1374,35 @@ describe('api: /forms/:id/submissions', () => {
result['simple.csv'].should.be.a.SimpleCsv();
})))));

it('should include all repeat rows @slow', testService((service) =>
service.login('alice', (asAlice) =>
asAlice.post('/v1/projects/1/forms?publish=true')
.send(`
it('should include all repeat rows @slow', testService(async (service) => {
const asAlice = await service.login('alice');
await asAlice.post('/v1/projects/1/forms?publish=true')
.send(`
<?xml version="1.0"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:jr="http://openrosa.org/javarosa" xmlns:odk="http://www.opendatakit.org/xforms" xmlns:orx="http://openrosa.org/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<h:head><h:title>single-repeat-1-instance-10qs</h:title><model odk:xforms-version="1.0.0">
<instance><data id="single-repeat-1-instance-10qs"><q1/><q2/><q3/><q4/><q5/><q6/><q7/><q8/><q9/><q10/><q11/><q12/><q13/><q14/><q15/><q16/><q17/><q18/><q19/><q20/><q21/><repeat jr:template=""><q22/><q23/><q24/><q25/><q26/><q27/><q28/><q29/><q30/><q31/><q32/><q33/><q34/><q35/><q36/><q37/><q38/><q39/><q40/><q41/></repeat><repeat><q22/><q23/><q24/><q25/><q26/><q27/><q28/><q29/><q30/><q31/><q32/><q33/><q34/><q35/><q36/><q37/><q38/><q39/><q40/><q41/></repeat><q42/><q43/><q44/><q45/><q46/><q47/><q48/><q49/><q50/><meta><instanceID/></meta></data></instance>
<bind nodeset="/data/q1" type="string"/><bind nodeset="/data/q2" type="string"/><bind nodeset="/data/q3" type="string"/><bind nodeset="/data/q4" type="string"/><bind nodeset="/data/q5" type="string"/><bind nodeset="/data/q6" type="string"/><bind nodeset="/data/q7" type="string"/><bind nodeset="/data/q8" type="string"/><bind nodeset="/data/q9" type="string"/><bind nodeset="/data/q10" type="string"/><bind nodeset="/data/q11" type="string"/><bind nodeset="/data/q12" type="string"/><bind nodeset="/data/q13" type="string"/><bind nodeset="/data/q14" type="string"/><bind nodeset="/data/q15" type="string"/><bind nodeset="/data/q16" type="string"/><bind nodeset="/data/q17" type="string"/><bind nodeset="/data/q18" type="string"/><bind nodeset="/data/q19" type="string"/><bind nodeset="/data/q20" type="string"/><bind nodeset="/data/q21" type="string"/><bind nodeset="/data/repeat/q22" type="string"/><bind nodeset="/data/repeat/q23" type="string"/><bind nodeset="/data/repeat/q24" type="string"/><bind nodeset="/data/repeat/q25" type="string"/><bind nodeset="/data/repeat/q26" type="string"/><bind nodeset="/data/repeat/q27" type="string"/><bind nodeset="/data/repeat/q28" type="string"/><bind nodeset="/data/repeat/q29" type="string"/><bind nodeset="/data/repeat/q30" type="string"/><bind nodeset="/data/repeat/q31" type="string"/><bind nodeset="/data/repeat/q32" type="string"/><bind nodeset="/data/repeat/q33" type="string"/><bind nodeset="/data/repeat/q34" type="string"/><bind nodeset="/data/repeat/q35" type="string"/><bind nodeset="/data/repeat/q36" type="string"/><bind nodeset="/data/repeat/q37" type="string"/><bind nodeset="/data/repeat/q38" type="string"/><bind nodeset="/data/repeat/q39" type="string"/><bind nodeset="/data/repeat/q40" type="string"/><bind nodeset="/data/repeat/q41" type="string"/><bind nodeset="/data/q42" type="string"/><bind nodeset="/data/q43" type="string"/><bind nodeset="/data/q44" type="string"/><bind nodeset="/data/q45" type="string"/><bind nodeset="/data/q46" type="string"/><bind nodeset="/data/q47" type="string"/><bind nodeset="/data/q48" type="string"/><bind nodeset="/data/q49" type="string"/><bind nodeset="/data/q50" type="string"/><bind jr:preload="uid" nodeset="/data/meta/instanceID" readonly="true()" type="string"/></model></h:head>
<h:body><input ref="/data/q1"><label>Q1</label></input><input ref="/data/q2"><label>Q2</label></input><input ref="/data/q3"><label>Q3</label></input><input ref="/data/q4"><label>Q4</label></input><input ref="/data/q5"><label>Q5</label></input><input ref="/data/q6"><label>Q6</label></input><input ref="/data/q7"><label>Q7</label></input><input ref="/data/q8"><label>Q8</label></input><input ref="/data/q9"><label>Q9</label></input><input ref="/data/q10"><label>Q10</label></input><input ref="/data/q11"><label>Q11</label></input><input ref="/data/q12"><label>Q12</label></input><input ref="/data/q13"><label>Q13</label></input><input ref="/data/q14"><label>Q14</label></input><input ref="/data/q15"><label>Q15</label></input><input ref="/data/q16"><label>Q16</label></input><input ref="/data/q17"><label>Q17</label></input><input ref="/data/q18"><label>Q18</label></input><input ref="/data/q19"><label>Q19</label></input><input ref="/data/q20"><label>Q20</label></input><input ref="/data/q21"><label>Q21</label></input><group ref="/data/repeat"><label>Repeat</label><repeat nodeset="/data/repeat"><input ref="/data/repeat/q22"><label>Q22</label></input><input ref="/data/repeat/q23"><label>Q23</label></input><input ref="/data/repeat/q24"><label>Q24</label></input><input ref="/data/repeat/q25"><label>Q25</label></input><input ref="/data/repeat/q26"><label>Q26</label></input><input ref="/data/repeat/q27"><label>Q27</label></input><input ref="/data/repeat/q28"><label>Q28</label></input><input ref="/data/repeat/q29"><label>Q29</label></input><input ref="/data/repeat/q30"><label>Q30</label></input><input ref="/data/repeat/q31"><label>Q31</label></input><input ref="/data/repeat/q32"><label>Q32</label></input><input ref="/data/repeat/q33"><label>Q33</label></input><input ref="/data/repeat/q34"><label>Q34</label></input><input ref="/data/repeat/q35"><label>Q35</label></input><input ref="/data/repeat/q36"><label>Q36</label></input><input ref="/data/repeat/q37"><label>Q37</label></input><input ref="/data/repeat/q38"><label>Q38</label></input><input ref="/data/repeat/q39"><label>Q39</label></input><input ref="/data/repeat/q40"><label>Q40</label></input><input ref="/data/repeat/q41"><label>Q41</label></input></repeat></group><input ref="/data/q42"><label>Q42</label></input><input ref="/data/q43"><label>Q43</label></input><input ref="/data/q44"><label>Q44</label></input><input ref="/data/q45"><label>Q45</label></input><input ref="/data/q46"><label>Q46</label></input><input ref="/data/q47"><label>Q47</label></input><input ref="/data/q48"><label>Q48</label></input><input ref="/data/q49"><label>Q49</label></input><input ref="/data/q50"><label>Q50</label></input></h:body></h:html>`)
.set('Content-Type', 'text/xml')
.expect(200)
.then(() => Promise.all((new Array(50)).fill(null).map(() =>
asAlice.post('/v1/projects/1/forms/single-repeat-1-instance-10qs/submissions')
.send(`<data id="single-repeat-1-instance-10qs">
.set('Content-Type', 'text/xml')
.expect(200);
for (let i = 0; i < 50; i += 1) {
// eslint-disable-next-line no-await-in-loop
await asAlice.post('/v1/projects/1/forms/single-repeat-1-instance-10qs/submissions')
.send(`<data id="single-repeat-1-instance-10qs">
<meta><instanceID>${uuid()}</instanceID></meta>
${[ 1, 2, 3, 4, 5, 6, 7, 8, 9 ].map((q) => `<q${q}>${uuid()}</q${q}>`).join('')}
<repeat>${[ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 ].map((q) => `<q${q}>${uuid()}</q${q}>`).join('')}</repeat>
${[ 42, 43, 44, 45, 46, 47, 48, 49, 50 ].map((q) => `<q${q}>${uuid()}</q${q}>`).join('')}
</data>`)
.set('Content-Type', 'text/xml')
.expect(200)))
.then(() => pZipStreamToFiles(asAlice.get('/v1/projects/1/forms/single-repeat-1-instance-10qs/submissions.csv.zip'))
.then((result) => {
result.filenames.should.eql([ 'single-repeat-1-instance-10qs.csv', 'single-repeat-1-instance-10qs-repeat.csv' ]);
result['single-repeat-1-instance-10qs.csv'].split('\n').length.should.equal(52);
result['single-repeat-1-instance-10qs-repeat.csv'].split('\n').length.should.equal(52);
}))))));
.set('Content-Type', 'text/xml')
.expect(200);
}
const result = await pZipStreamToFiles(asAlice.get('/v1/projects/1/forms/single-repeat-1-instance-10qs/submissions.csv.zip'));
result.filenames.should.eql([ 'single-repeat-1-instance-10qs.csv', 'single-repeat-1-instance-10qs-repeat.csv' ]);
result['single-repeat-1-instance-10qs.csv'].split('\n').length.should.equal(52);
result['single-repeat-1-instance-10qs-repeat.csv'].split('\n').length.should.equal(52);
}));

it('should not include data from other forms', testService((service) =>
service.login('alice', (asAlice) => Promise.all([
Expand Down

0 comments on commit 31c42c0

Please sign in to comment.