Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
58fe750
fix: add crumb to secondary summary (#872)
jenbutongit Jul 21, 2022
34e9b9c
fix: update to 103.* (#879)
jenbutongit Aug 1, 2022
c51e74a
feat: update to node 16 (#889)
jenbutongit Aug 18, 2022
60cf4e3
fix: image tagging workflow
jenbutongit Aug 18, 2022
e9f62d0
fix: cache
jenbutongit Aug 18, 2022
fb9a5ea
move anchore to nightly
jenbutongit Aug 18, 2022
6c8ce21
fix: GHCR auth
jenbutongit Aug 18, 2022
9dd747d
fix: update docs and run nightlies with action
jenbutongit Aug 18, 2022
04485cc
fix/image-fixes (#894)
jenbutongit Aug 19, 2022
81afc84
fix: various node 16 image fixes (#896)
jenbutongit Aug 22, 2022
5052630
Fix: global styles (#898)
jenbutongit Aug 25, 2022
12acb0d
fix: textfield regex (#909)
jenbutongit Sep 8, 2022
52aca7d
feat/use cypress.io (#924)
jenbutongit Oct 1, 2022
7f6ae4e
fix/pipeline (#927)
jenbutongit Oct 1, 2022
f35f1a6
fix: main pipeline (#929)
jenbutongit Oct 3, 2022
d4017c2
fix: ensure deploy job has access to assign-semver
jenbutongit Oct 3, 2022
03ada01
dependabot (#933)
jenbutongit Oct 10, 2022
a617a39
use npm key (#935)
jenbutongit Oct 10, 2022
1df3635
fix: add action for dependabot (#946)
jenbutongit Oct 10, 2022
7df2bee
Update dependabot.yml
jenbutongit Oct 10, 2022
0d3d6df
fix: dependabot
jenbutongit Oct 11, 2022
b64e413
fix: dependabot
jenbutongit Oct 11, 2022
2eb47ee
fix: dependabot
jenbutongit Oct 11, 2022
1ea537a
Update branch--lint-unit-and-smoke-test.yml
jenbutongit Oct 11, 2022
737e925
ci: add dependabot PAT
jenbutongit Oct 11, 2022
22e7d6a
allow immutable
jenbutongit Oct 11, 2022
dbdd895
ci: check for deps-dev commit
jenbutongit Oct 11, 2022
96cf9ab
ci: only run when dependabot has updated
jenbutongit Oct 11, 2022
e773d28
ci: only run when not chore(deps)
jenbutongit Oct 11, 2022
c1d1ece
fix: resolve yarn npm audit -AR issues (#948)
jenbutongit Oct 18, 2022
88b06e0
chore: patching more dependencies (#949)
jenbutongit Oct 18, 2022
30d19ba
feat: initialise with htmlMessage (#961)
jenbutongit Oct 20, 2022
cb26983
feat: confirmation session timeout (#962)
jenbutongit Oct 20, 2022
c5dc6c9
chore: add condition for if header.referrer can't be found (#970)
RichardBray Nov 25, 2022
e0b4bfd
fix: dateForComparison (#978)
jenbutongit Dec 5, 2022
5326e85
fix: add paymentSessionTimeout (#980)
jenbutongit Dec 8, 2022
d428d28
feat: add config for multiple fields-per-personalisation (#1019)
jenbutongit Mar 24, 2023
38586e9
fix: bump-dependencies (#1032)
jenbutongit Apr 3, 2023
b2ea1f6
fix: fix issue with app crashing when editing or assigning nested con…
ziggy-cyb Apr 27, 2023
7ff0b34
feat: add additional controls for JWT (#1061)
jenbutongit May 3, 2023
a16ec68
Added the ability to pass through conditional lists to a GOVnotify te…
ziggy-cyb May 12, 2023
a4b627e
fix: lists passed to GOVnotify work with no list items shown (#1080)
ziggy-cyb May 24, 2023
1cb9130
feat: allow payReturnUrl to be overridden per form and add `feeOption…
jenbutongit Jul 12, 2023
6a6d713
chore: add log step for smoke-test workflows (#1104)
jenbutongit Jul 24, 2023
7012aea
feat: allow redirects after callback submission (#1101)
jenbutongit Jul 24, 2023
e1220b8
feat: add backlink fallback (#1108)
jenbutongit Aug 15, 2023
62576fc
fix: added region1 urls for GTM to content security policy (#1110)
ziggy-cyb Aug 18, 2023
5cd1879
Updated runner Dockerfile to update vulnerable packages
ziggy-cyb Sep 7, 2023
7490c04
Adding back save per page functionality (#1)
adamdavies1 Sep 18, 2023
d5497b9
Adding multi input functionality (#4)
adamdavies1 Sep 19, 2023
12ef9ed
Merge pull request #1 from adamdavies1/main
adamdavies1 Sep 19, 2023
3207de7
Added changes to model
SophieOHagan99 Oct 3, 2023
d0335dc
Added changes to designer repo
SophieOHagan99 Oct 4, 2023
a02358d
Updated runner config
SophieOHagan99 Oct 4, 2023
7b4d229
Updated form json
SophieOHagan99 Oct 5, 2023
90e9e15
Updated engine components
SophieOHagan99 Oct 5, 2023
8dabffe
Updated engine models
SophieOHagan99 Oct 5, 2023
d37a8a6
Updated Page Controllers
SophieOHagan99 Oct 5, 2023
17dc195
Engine views updated
SophieOHagan99 Oct 6, 2023
9b107d7
Finish engine updates
SophieOHagan99 Oct 6, 2023
2357139
Update initialise session
SophieOHagan99 Oct 6, 2023
8659320
Finished updating plugins
SophieOHagan99 Oct 6, 2023
d9fc98e
Updated server routes
SophieOHagan99 Oct 6, 2023
9bc86c5
Updated server schemas
SophieOHagan99 Oct 6, 2023
f92bf01
Updated services
SophieOHagan99 Oct 6, 2023
363ac56
Updated server utils
SophieOHagan99 Oct 6, 2023
89bd8c4
Updated server views
SophieOHagan99 Oct 6, 2023
cbdcc86
Updated server index.ts
SophieOHagan99 Oct 6, 2023
1a8acbf
Updated tests
SophieOHagan99 Oct 10, 2023
35fbe5f
Updated package.json
SophieOHagan99 Oct 10, 2023
7a8697f
Fixed additional validation functions
SophieOHagan99 Oct 10, 2023
6c681cc
Update yarn lock
SophieOHagan99 Oct 10, 2023
7c632b3
Fixed yarn issues
SophieOHagan99 Oct 10, 2023
3443088
Updated hapi jwt to 10.4
SophieOHagan99 Oct 10, 2023
3704290
Commenting out auth test to check jwt usage
SophieOHagan99 Oct 10, 2023
0988b1a
Added jsonwebtoken explicitly
SophieOHagan99 Oct 10, 2023
a487886
Downgraded jsonwebtoken to 8.5.1
SophieOHagan99 Oct 11, 2023
c43115a
Fixed Condition Evaluation Context unit test
SophieOHagan99 Oct 11, 2023
1c6f297
Fixed initialisesession test not being in describe
SophieOHagan99 Oct 11, 2023
85473aa
Fixed typo in default.js
SophieOHagan99 Oct 11, 2023
2bc0b4f
Fixed wording on complete a form e2e test
SophieOHagan99 Oct 12, 2023
b4e2fe6
Fixed back expression to use backlink text
SophieOHagan99 Oct 12, 2023
49e6b72
Fixed label in listcomponent e2e tests
SophieOHagan99 Oct 12, 2023
2e8169a
Fixed summary html page
SophieOHagan99 Oct 23, 2023
a113160
Fixed initialise session e2e test
SophieOHagan99 Oct 23, 2023
973057d
Fixed backlink e2e tests
SophieOHagan99 Oct 23, 2023
3f00c98
Fixed the complete a form e2e tests
SophieOHagan99 Oct 23, 2023
28ed5ef
Merge pull request #2 from communitiesuk/FS-3456-upgrade-node
SophieOHagan99 Nov 3, 2023
b166b44
BAU updating routing for asset information
adamdavies1 Nov 17, 2023
06e661b
revert of save per page url
adamdavies1 Nov 17, 2023
c069abc
Merge remote-tracking branch 'digital-form-builder-upstream-upgrade/m…
SophieOHagan99 Nov 23, 2023
bca99d9
Fixed e2e tests
SophieOHagan99 Nov 23, 2023
c5cfc5d
Updated environments for e2e tests
SophieOHagan99 Nov 23, 2023
197f209
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 23, 2023
f794184
Updated yarn lock
SophieOHagan99 Nov 23, 2023
78cfd29
Merge branch 'FS-3456-node-upgrade' of github.com:communitiesuk/digit…
SophieOHagan99 Nov 23, 2023
428a180
Updated dependencies
SophieOHagan99 Nov 23, 2023
4ff02ec
Updated lockfile
SophieOHagan99 Nov 23, 2023
0e74061
Flagged false positive secrets
SophieOHagan99 Nov 23, 2023
cbf46e2
Commented false flag on schema test
SophieOHagan99 Nov 23, 2023
16e6644
Added optional chaining package to designer
SophieOHagan99 Nov 23, 2023
c5f9533
Changed optional chaining to dev dependency
SophieOHagan99 Nov 23, 2023
0e2511f
Added proposal-optional-chaining
SophieOHagan99 Nov 23, 2023
d22e7c8
added logical assignment operators dependency
SophieOHagan99 Nov 23, 2023
64502f0
Reverted environment
SophieOHagan99 Nov 24, 2023
233f806
Added in new code
SophieOHagan99 Jan 8, 2024
7798c39
Updated branch
SophieOHagan99 Apr 30, 2024
34c0654
Merge branch 'main' into FS-3456-node-upgrade
SophieOHagan99 May 10, 2024
641bfd1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 10, 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: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/README.md
**/node_modules
**/dist
.yarn/cache
.yarn/build-state.yml
.yarn/install-state.gz
*.jest.*
jest
12 changes: 7 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"extends": [
"prettier",
"plugin:json/recommended"
],
"extends": ["plugin:json/recommended", "plugin:prettier/recommended"],
"plugins": ["@babel", "prettier"],
"parser": "babel-eslint",
"env": {
Expand Down Expand Up @@ -38,7 +35,12 @@
{
"files": ["*.ts", "*.tsx"],
"parser": "@typescript-eslint/parser",
"plugins": ["@babel", "prettier", "@typescript-eslint", "eslint-plugin-tsdoc"],
"plugins": [
"@babel",
"prettier",
"@typescript-eslint",
"eslint-plugin-tsdoc"
],
"parserOptions": {
"ecmaFeatures": { "jsx": true }
}
Expand Down
61 changes: 7 additions & 54 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,9 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
reviewers:
- gstevenson
ignore:
- dependency-name: webpack
versions:
- 5.26.0
- 5.36.2
- 5.37.0
- 5.37.1
- 5.38.1
- 5.39.1
- dependency-name: i18next
versions:
- 19.9.2
- 20.2.2
- 20.2.4
- 20.3.1
- dependency-name: prismjs
versions:
- 1.23.0
- dependency-name: "@wdio/local-runner"
versions:
- 7.0.0
- dependency-name: "@babel/plugin-transform-runtime"
versions:
- 7.13.10
- 7.13.15
- 7.14.3
- dependency-name: "@babel/register"
versions:
- 7.12.13
- 7.13.14
- 7.13.16
- dependency-name: sass-loader
versions:
- 11.0.1
- 11.1.0
- 11.1.1
- 12.0.0
- dependency-name: copy-webpack-plugin
versions:
- 7.0.0
- 8.1.1
- dependency-name: lodash
versions:
- 4.17.21
- dependency-name: node-sass
versions:
- 5.0.0
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
reviewers:
- jenbutongit
11 changes: 1 addition & 10 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,12 @@ Please delete options that are not relevant.
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce
the testing if necessary.

Before PR's can be merged they will need to be tested by QA and approved where
applicable. To flag the change to QA assign **@XGovFormBuilder/qa** as one of the reviewers.

- [ ] Test A
- [ ] Test B

# Checklist:

- [ ] My changes do not introduce any new linting errors
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation and versioning
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] I have rebased onto main and there are no code conflicts
- [ ] I have checked deployments are working in all environments
- [ ] I have updated the architecture diagrams as per Contribute.md
- [ ] I have updated the architecture diagrams as per Contribute.md OR added an architectural decision record entry
159 changes: 31 additions & 128 deletions .github/workflows/branch--lint-unit-and-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,143 +2,46 @@ name: Branch QA
on:
pull_request:
branches:
- master
- main
paths-ignore:
- "docs/**"
- "**/README.md"
- "python/**"
workflow_dispatch:

jobs:
dependencies:
uses: ./.github/workflows/dependabot.yml
secrets: inherit #pragma: allowlist secret
lint-and-test:
runs-on: ubuntu-latest
needs: [dependencies]
if: ${{!contains(github.event.head_commit.message, 'chore(deps-dev)')}}
name: Workspace
strategy:
matrix:
app: [designer, runner, model]
name: lint-and-test-${{matrix.app}}
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "12.x"

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Configure yarn caching
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn install

- name: Check existing forms
if: ${{ matrix.app == 'runner' }}
run: yarn runner check-forms

- name: Build dependencies
run: yarn build:dependencies

- name: Lint
run: yarn ${{matrix.app}} lint

- name: Test
run: yarn ${{matrix.app}} test-cov

- name: Upload test results artifacts
uses: actions/upload-artifact@v2
if: ${{ success() || failure() }}
with:
name: test-results-${{matrix.app}}
path: ${{matrix.app}}/test-results
retention-days: 14

- name: Upload test coverage artifacts
uses: actions/upload-artifact@v2
if: ${{ success() || failure() }}
with:
name: test-coverage-${{matrix.app}}
path: ${{matrix.app}}/test-coverage
retention-days: 14
workspace: [model, designer, runner]
uses: ./.github/workflows/lint-and-test.yml
with:
workspace: ${{ matrix.workspace }}

build-designer:
name: Designer
uses: ./.github/workflows/build.yml
with:
app: designer
secrets: inherit #pragma: allowlist secret

build-runner:
name: Runner
uses: ./.github/workflows/build.yml
with:
app: runner
secrets: inherit #pragma: allowlist secret

smoke-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Docker compose pull
run: docker-compose pull
# DAYOFYEAR key is used to rotate docker-layer-caching to avoid the layers dandle issue
# see https://github.com/satackey/action-docker-layer-caching/issues/55
# if you change this, please remember to apply the same changes to main--lint-unit-build-and-publish-images.yml
# so main branch cache can be shared with branches
- run: echo "DAYOFYEAR = $(date +%j)"
- run: echo "DAYOFYEAR=$(date +%j)" >> $GITHUB_ENV
- name: Docker layer caching
uses: satackey/action-docker-layer-caching@v0.0.11
continue-on-error: true
with:
key: digital-form-builder-${{ env.DAYOFYEAR }}-{hash}
restore-keys: |
digital-form-builder-${{ env.DAYOFYEAR }}
- name: Create .env for ${{ matrix.app }} workspace
run: |
touch ./${{ matrix.app }}/.env
echo LAST_TAG_GH=2.0.${{ github.run_number }}-rc >> ./${{ matrix.app }}/.env
echo LAST_COMMIT_GH=${{ github.sha }} >> ./${{ matrix.app }}/.env
cat ./${{ matrix.app }}/.env
- name: Docker compose build
run: |
docker-compose build --parallel
- name: Docker compose up
run: docker-compose up -d
- name: Install smoke tests dependencies
run: yarn workspaces focus @xgovformbuilder/test
- name: Check designer container is running
run: |
docker ps
docker run --network container:designer appropriate/curl -4 --retry 10 --retry-connrefused --retry-delay 10 http://localhost:3000/
- name: Check runner container is running
run: |
docker ps
docker run --network container:runner appropriate/curl -4 --retry 10 --retry-connrefused --retry-delay 10 http://localhost:3009/
- name: Smoke Test
run: |
yarn smoke-tests/designer smoke-test-headless
ls -lah smoke-tests/designer/reports/
- name: Run pa11y
run: yarn designer dlx pa11y-ci
- name: Run Lighthouse on urls and validate with lighthouserc
uses: treosh/lighthouse-ci-action@v8
with:
configPath: "./lighthouserc.js"
uploadArtifacts: true
- name: "Tar files"
if: ${{ success() || failure() }}
run: tar -cvf smoke-tests.tar smoke-tests/designer/reports
- uses: actions/upload-artifact@v2
if: ${{ success() || failure() }}
with:
name: smoke-tests
path: smoke-tests.tar
retention-days: 14
needs: [build-runner, build-designer]
uses: ./.github/workflows/smoke-test.yml
with:
runner-cache-ref: ${{needs.build-runner.outputs.tag}}
designer-cache-ref: ${{needs.build-designer.outputs.tag}}
secrets: inherit #pragma: allowlist secret
98 changes: 98 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: build app

on:
workflow_call:
inputs:
app:
description: the app to build "designer" or "runner"
required: true
type: string
publish:
description: Set to true to publish to GHCR. Defaults to false
type: boolean
required: false
semver:
description: The semantic version you wish to publish with
required: false
type: string
outputs:
tag:
description: tag used for docker caching
value: ${{ jobs.build-app.outputs.tag }}
hash:
description: hash used for docker caching
value: ${{ jobs.build-app.outputs.hash }}

jobs:
build-app:
if: ${{!contains(github.event.head_commit.message, 'chore(deps-dev)')}}
runs-on: ubuntu-latest
name: Docker build
outputs:
tag: ${{ steps.hashFile.outputs.tag }}
hash: ${{ steps.hashFile.outputs.hash }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: yarn

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{inputs.app}}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{inputs.app}}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
config-inline: |
[registry."ghcr.io"]

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# The hash is a function of the Dockerfile and the yarn.lock Packages take up the bulk of the time during a docker build. The hash is used to cache the docker builds.
# As long as the yarn.lock and dockerfiles are the same, you will be able to share this cache with another commit/branch.
- id: hashFile
env:
HASH_TARGET: "${{inputs.app}}/Dockerfile"
run: |
echo "::set-output name=hash::${{hashFiles(env.HASH_TARGET, 'yarn.lock')}}"
echo "::set-output name=tag::ghcr.io/xgovformbuilder/cache-digital-form-builder-${{inputs.app}}:${{hashFiles(env.HASH_TARGET)}}"

- name: Build ${{inputs.app}}
if: ${{inputs.publish != true }}
uses: docker/build-push-action@v3
with:
file: ${{inputs.app}}/Dockerfile
push: false
context: .
tags: ${{ steps.hashFile.outputs.tag }}
cache-from: type=registry,ref=${{ steps.hashFile.outputs.tag }}

- name: Build ${{inputs.app}} and push
if: ${{inputs.semver && inputs.publish == true }}
uses: docker/build-push-action@v3
with:
file: ${{inputs.app}}/Dockerfile
push: false
context: .
tags: |
ghcr.io/xgovformbuilder/digital-form-builder-${{inputs.app}}:${{inputs.semver}}
ghcr.io/xgovformbuilder/digital-form-builder-${{inputs.app}}:latest
build-args: |
LAST_TAG_GH=${{inputs.semver}}
LAST_COMMIT=${{github.sha}}
Loading