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

HAAR-1871: update project with all typescript template changes #72

Merged
merged 205 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
205 commits
Select commit Hold shift + click to select a range
2f73e58
Initial commit
andrewrlee Nov 12, 2020
c89f6f8
Alee/init (#1)
andrewrlee Nov 19, 2020
472adbb
Fixing docker image (#2)
andrewrlee Nov 19, 2020
36a57e7
Fix secret name (#3)
andrewrlee Nov 19, 2020
8683f28
Correcting variable names and removing unnecessary ones (#4)
andrewrlee Nov 19, 2020
418349e
Fixing variable name (#5)
andrewrlee Nov 19, 2020
c2af2d4
Removing trailing slashes from env vars (#6)
andrewrlee Nov 19, 2020
49ace58
Fix hostname (#7)
andrewrlee Nov 19, 2020
ccc0c03
Update dependencies (#8)
andrewrlee Dec 7, 2020
ac0dfa6
Reducing docker image size (#9)
andrewrlee Dec 15, 2020
c8a5587
Add rename script (#10)
andrewrlee Dec 18, 2020
1a11c21
Alee/decoupling auth client from redis (#11)
andrewrlee Dec 21, 2020
ec4f5ed
Update to latest hmpps orb version (#12)
mattops Jan 11, 2021
27a10a5
Fixing build-info.json placement (#13)
brightonsbox Jan 12, 2021
1ac0a0c
Convert to arrow functions in utils (#14)
psoleckimoj Jan 26, 2021
b3713ee
Make the use of logger naming consistent (#15)
psoleckimoj Jan 27, 2021
61b41df
Adding outdated job (#16)
andrewrlee Feb 18, 2021
594b004
Updating dependencies (#17)
andrewrlee Mar 5, 2021
a581d49
Moving to enable no-implicit-any (#18)
andrewrlee Mar 5, 2021
db09442
DT-1659: 🔨 Remove helm copying secrets from AWS (#19)
petergphillips Mar 8, 2021
716fdfb
Adding moj design system (#20)
andrewrlee Mar 17, 2021
8a43d6d
Add new veracode scan for schedueled workflow (#21)
mattops Mar 19, 2021
9fefb8f
Removing deprecated body parser (#22)
andrewrlee Mar 25, 2021
e8532ef
DT-1627: 📄 Update license with correct year (#23)
petergphillips May 11, 2021
cf8f8d7
Added missing ping endpoint as used by Kubernetes for liveliness prob…
andymarke May 12, 2021
ea38330
DT-2012 - upgrade hmpps orb, and add veracode policy scan job. (#25)
mattops May 14, 2021
e7df526
Use generic-service and generic-prometheus-alerts charts (#26)
mattops May 18, 2021
a2d85cd
Updating dependencies and adding slack notifications to outdated chec…
andrewrlee May 24, 2021
336b8fa
Moving to group middleware into related modules, following the patter…
andrewrlee May 28, 2021
5f29995
Fix the slack notification on `check_outdated` (#30)
Jun 4, 2021
3ef04f5
Updating node dependencies (#31)
andrewrlee Jun 16, 2021
5e81ee3
Fixing configuration of security audit (#32)
brightonsbox Jun 16, 2021
2003f62
Alee/update dependencies (#33)
andrewrlee Jun 24, 2021
3d93d8e
DT-2166 - add trivy image scanning job (#35)
mattops Jun 28, 2021
96d73dc
Fix trivy scan job slack notifications channel (#36)
mattops Jun 28, 2021
f541d64
Use node executor and parameterise the version (#34)
markreesmoj Jun 28, 2021
0d87899
Deploy template project to template k8s namespace (#37)
mattops Jun 30, 2021
4422c3f
DT-2260 - update to latest circleci orb and chart dependencies (#38)
mattops Jun 30, 2021
bc34e5f
Updating dependencies and improving README (#39)
andrewrlee Jul 1, 2021
e9450ed
DT-2282: ⬆️ Fix veracode policy scan (#40)
petergphillips Jul 6, 2021
7fd93c9
Moving cypress tests to typescript (#41)
andrewrlee Jul 27, 2021
264f33f
DT-2404: 💄 Switch to sign in / out instead of login / out (#42)
petergphillips Aug 6, 2021
fb0d2d0
DT-2404: ✅ Run tests automatically on commit (#43)
petergphillips Aug 6, 2021
80eee9d
Update dependencies (#44)
andrewrlee Aug 16, 2021
f41de78
DT-2297 - Veracode - switch to daily pipeline scan (results in circle…
mattops Aug 19, 2021
f5d881e
DT-2297- randomise timing of circleci security workflow due to rate l…
mattops Aug 24, 2021
17a4437
update typescript (#48)
connormaglynn Sep 1, 2021
4a64ef0
Fixing docker caching apt-get layer (#49)
andrewrlee Sep 6, 2021
dd68b5d
Fix docker build failing, and reduce image size (#50)
mattops Sep 7, 2021
94db4f2
Remove use of semi colons before arrays (#51)
garethmdavies Sep 29, 2021
d7d9133
WFP-610 update to npmv7 and fix some audit (#52)
markreesmoj Oct 7, 2021
2115d45
WFP-610 upgrade to jest-junit 13 to bring in new ansi-regex (#54)
markreesmoj Oct 8, 2021
5946417
Upgrading dependencies (#55)
andrewrlee Oct 8, 2021
223e269
FIXBUILD: update ansi-regex subdependency (#56)
markreesmoj Oct 11, 2021
d943820
DT-2702: 🔨 Use new generic service configuration (#57)
petergphillips Oct 11, 2021
349bdb7
Update dependencies (#58)
andrewrlee Oct 14, 2021
aa16d4a
Moving to use HMPPS header (#59)
brightonsbox Oct 20, 2021
cc41f5d
Fix path of unit test results that are uploaded as artifacts (#60)
ushkarev Oct 20, 2021
6ff0d36
DT-2814: 🐛 Fix cron timings for veracode (#61)
petergphillips Nov 3, 2021
a6c72ba
NN-3747 fixing json structure for the stubUserRoles call and populati…
Nov 5, 2021
f247b8a
Bumping node version (#63)
andrewrlee Nov 10, 2021
db9a433
DT-2796: 🔨 Migrate dev to live context (#64)
petergphillips Nov 18, 2021
d94f72c
Update dependencies and move to NPM v8 (#65)
psoleckimoj Dec 7, 2021
dccca36
Upgrading dependencies (#66)
andrewrlee Jan 6, 2022
a192197
Update modules and remove express-request-id (#67)
psoleckimoj Jan 25, 2022
2c530c0
INC-163 Timeout Fix - Correctly sets the timeout for a HttpAgent (#69)
Mjwillis Feb 4, 2022
59a9b65
⬆️ update dependencies and 💄add no-only-tests linting rule for cypres…
connormaglynn Feb 14, 2022
9651352
SDI-60: 🔨 Add global protect and petty france to allowlists (#71)
petergphillips Feb 14, 2022
10ccbe8
Update dependencies (#72)
psoleckimoj Mar 2, 2022
c450787
DCS-1442 jquery-ui.css coep fix (#73)
louisenorris Mar 8, 2022
7d9565b
Fixing docker caching issue (#74)
andrewrlee Mar 18, 2022
fd85c22
Setup prometheus metrics by default. (#75)
Mar 24, 2022
49c6ad6
Bump minimist from 1.2.5 to 1.2.6 (#76)
dependabot[bot] Mar 24, 2022
0354a09
Update dependencies (#77)
andrewrlee Apr 8, 2022
eefd2aa
Audit fix (#79)
andrewrlee Apr 11, 2022
dc3f727
NN-4060: App Insights only works with bunyan v1 (#80)
sp-watson Apr 20, 2022
e2e93b4
Update orb and dependencies (#82)
andrewrlee Apr 22, 2022
8aa16ee
Stop metrics test from hitting a real service and occasionally timing…
jonnywyatt Apr 22, 2022
752a0ec
SDI-181: 🔧 Add jira notifications for new projects (#83)
petergphillips Apr 28, 2022
05dcc72
Adding better redis error handling (#84)
andrewrlee May 3, 2022
3bd1861
SDI-181: 🔧 Use new cimg redis executor (#85)
petergphillips May 4, 2022
968735d
SLM-245 Restore cache prior to running up the app for the integration…
mikehalmamoj May 11, 2022
6676e3a
SDI-88: 🚨 Fix querystring warning (#87)
petergphillips May 12, 2022
0bd862a
SDI-88: 🐛 Fix cookie session down as a dependency (#88)
petergphillips May 13, 2022
73c1b62
SDI-88: ♻️ Tidy up mocks and switch to multiplatform builds (#89)
petergphillips May 13, 2022
0f2559b
Allow async get to take an array of strings for paths like original g…
psoleckimoj May 16, 2022
5e69d1a
SDI-182: ✨ Switch to using connection string instead (#91)
petergphillips May 16, 2022
5d61681
Update README.md (#92)
andrewrlee May 17, 2022
7a08151
SDI-88: ✅ Add token verification integration tests (#94)
petergphillips May 19, 2022
6de4fe3
Minor "code smell" fixes suggested by Sonar Cloud (#95)
ushkarev May 20, 2022
f4d9846
SDI-211: 🔒️ Bump versions to fix security issues and cope with passpo…
petergphillips May 24, 2022
d5d2fbc
Updating dependencies (#97)
andrewrlee May 26, 2022
d961034
SDI-211: 🎨 Enforce trailing comma on functions too (#98)
petergphillips May 30, 2022
992fff1
SDI-211: 🎨 Enforce arrow parens (#99)
petergphillips May 31, 2022
2fa5e70
Bump dependencies (#100)
psoleckimoj Jun 6, 2022
127b2c7
SDI-218: ⬆ Upgrade cypress to v10 (#101)
petergphillips Jun 8, 2022
5249392
⬆️ Update dependencies (#102)
connormaglynn Jun 20, 2022
3c43ed9
Ignore false positive around nodemon (#103)
andrewrlee Jun 23, 2022
3c5a9ba
Updating dependencies (#104)
andrewrlee Jul 5, 2022
616e7ce
Update dependencies (#105)
andrewrlee Jul 8, 2022
a6ac4cb
Create services container (#106)
andrewrlee Jul 8, 2022
a71978d
SDI-265: ♻️ Minor improvements (#107)
petergphillips Jul 11, 2022
9820452
SDI-265: 🚨 Add lint check for only (#108)
petergphillips Jul 12, 2022
d548f47
Update Jest to v28 and minor dependency updates (#109)
psoleckimoj Jul 21, 2022
1a9e219
Remove duplicate <main> elements (#110)
richpjames Jul 28, 2022
338690a
Bumping dependencies and fixing page width (#111)
andrewrlee Aug 11, 2022
26f0b62
Add a `cspNonce` to the webSecurity setup (#112)
pezholio Aug 15, 2022
e2299e3
Update dependencies 2022-08-22 (#113)
psoleckimoj Aug 22, 2022
3dfd162
Update dependencies to fix check outdated flagging typescript (#114)
neilmendum Aug 31, 2022
737b6f6
Update dependencies 2022-09-09 (#115)
psoleckimoj Sep 9, 2022
25b0208
Speeding up jest tests (#116)
andrewrlee Sep 12, 2022
610a227
Removing colour from logs in production mode (#117)
andrewrlee Sep 15, 2022
767c5d9
Move ingress (#118)
psoleckimoj Sep 20, 2022
9ca506c
SDI-345: ⬆️ Upgrade node and cypress (#119)
petergphillips Sep 21, 2022
0a16804
Fixing logging (#120)
andrewrlee Sep 23, 2022
af854b8
Update dependencies 2022-09-28 (#121)
psoleckimoj Sep 28, 2022
2dcae4f
⬆️Upgrade to latest helm chart versions (#122)
connormaglynn Oct 3, 2022
b2a656c
Adding badges (#123)
andrewrlee Oct 7, 2022
c78f1d5
Updating node to v18 (#124)
andrewrlee Oct 26, 2022
65980b1
Set helm timeout to 5 minutes (#125)
carlov20 Oct 27, 2022
f7aad6e
Use official redis image for docker-compose (#126)
neilmendum Nov 1, 2022
b7152f7
Update Helm config to match Kotlin template (#127)
neilmendum Nov 1, 2022
1d1ddb6
Update dependencies 2022-11-15 (#128)
psoleckimoj Nov 15, 2022
de90fee
Update dependencies 2022-11-16 (#129)
psoleckimoj Nov 16, 2022
317fcb2
Update node images (#130)
psoleckimoj Nov 25, 2022
6964e83
SDI-476: ⬆ Bump versions (#131)
petergphillips Dec 7, 2022
4920b06
Update dependencies 2022-12-08 (#132)
psoleckimoj Dec 8, 2022
8633cb0
Update dependencies 2022-12-19 (#133)
psoleckimoj Dec 19, 2022
2e1e3d5
Bump jsonwebtoken from 8.5.1 to 9.0.0 (#136)
dependabot[bot] Dec 23, 2022
3a127d6
Fix conflicting prettier / eslint rule (#135)
pezholio Dec 28, 2022
5386b50
SDI-523: 🔒️ Fix / ignoresecurity issues (#138)
petergphillips Jan 3, 2023
b636741
HEAT-41: use npm outdated job from HMPPS Orb; update other dependenci…
neilmendum Jan 17, 2023
839c8e1
Update dependencies 2023-01-24 (#140)
psoleckimoj Jan 24, 2023
4c975e6
Update dependencies 2023-01-31 (#141)
psoleckimoj Jan 31, 2023
9fc40b0
Update dependencies 2023-02-01 (#142)
psoleckimoj Feb 1, 2023
1f27375
Configure Renovate (#144)
renovate[bot] Feb 2, 2023
14cdec7
Update Helm release generic-service to v2.4.0 (#146)
renovate[bot] Feb 3, 2023
a99053c
Update peter-evans/create-pull-request action to v4 (#148)
renovate[bot] Feb 3, 2023
97b1fa8
Update actions/checkout action to v3 (#147)
renovate[bot] Feb 3, 2023
92b5a33
Add .nvmrc file, Prettier support for Nunjucks and use SCSS (#143)
davidatmoj Feb 3, 2023
7745886
Revert build_multiplatform_docker because it causes the build to take…
neilmendum Feb 3, 2023
b80efe8
Update dependency cypress to ^12.5.1 (#150)
renovate[bot] Feb 7, 2023
20f2181
HEAT-52: reduce the size of the PR body by specifying prBodyTemplate …
neilmendum Feb 13, 2023
0075fab
Update all non major NPM dependencies (#151)
renovate[bot] Feb 13, 2023
8e5a9d2
Update all non major NPM dependencies (#153)
renovate[bot] Feb 16, 2023
d9c2d14
Update all non major NPM dependencies (#155)
renovate[bot] Feb 24, 2023
941ca4d
Update all non major NPM dependencies (#156)
renovate[bot] Feb 28, 2023
cd997e0
Update all non major NPM dependencies (#159)
renovate[bot] Mar 2, 2023
41a6094
Update Helm release generic-service to v2.5.0 (#161)
renovate[bot] Mar 7, 2023
213008f
Update node image and regenerate package-lock.json (#165)
psoleckimoj Mar 16, 2023
154e107
Update hmpps-orb to v7.2.1 (#166)
garethmdavies Mar 16, 2023
220b506
Upgrade to connect-redis 7 and update other dependencies (#168)
psoleckimoj Mar 20, 2023
2b69d5b
Upgrade to typescript 5 (#169)
psoleckimoj Mar 20, 2023
19be08c
Add HMPPS Auth URL to form-action CSP string (#170)
bryangaledxw Mar 20, 2023
919ecdc
Update TypeScript etc 2023-04-03 (#174)
psoleckimoj Apr 4, 2023
52f8e99
Removing unnecessary build (#172)
andrewrlee Apr 4, 2023
37f8bc0
Update dependencies 2023-04-12 (#177)
psoleckimoj Apr 12, 2023
06ecd8d
SDIT-738: ⚡️ Cache static resources for 1 hour (#178)
petergphillips Apr 13, 2023
b3477b1
Update dependencies 2023-04-21 (#181)
psoleckimoj Apr 21, 2023
757c6ef
Fix security vuln 2023-04-25 (#183)
psoleckimoj Apr 25, 2023
4b75683
Update Helm release generic-service to v2.6.2 (#182)
renovate[bot] Apr 25, 2023
194c154
SDIT-760: 🔧 Upgrade redis to 7 (#186)
petergphillips Apr 27, 2023
c8869d0
Update Helm release generic-service to v2.6.3 (#184)
renovate[bot] May 2, 2023
ea3f137
Tie css cache to version of application (#188)
andrewrlee May 10, 2023
88c301f
Fix version not appearing in application insights (#190)
andrewrlee May 16, 2023
5b7903b
Update Helm release generic-prometheus-alerts to v1.3.2 (#189)
renovate[bot] May 19, 2023
586d966
Add PreProd and Prod helm config (#193)
neilmendum May 19, 2023
f6b3725
Update slack orb to v4.12.5 (#185)
renovate[bot] May 23, 2023
83be369
Update peter-evans/create-pull-request action to v5 (#175)
renovate[bot] May 23, 2023
58512df
Update all non major NPM dependencies (#176)
renovate[bot] Jun 6, 2023
4466ddc
Update Node.js to v18.16 (#191)
renovate[bot] Jun 6, 2023
087bc0e
Update dependencies 2023-06-07 (#196)
psoleckimoj Jun 7, 2023
ded60e6
Do not retry POST requests by default (#197)
andrewrlee Jun 9, 2023
ddf3823
Adding changelog (#198)
andrewrlee Jun 12, 2023
a5dc02d
Have `sanitisedError` always return an Error instance (#199)
ushkarev Jun 12, 2023
eac50e9
Update all non major NPM dependencies (#195)
renovate[bot] Jun 22, 2023
7e907e1
Update all non major NPM dependencies (#200)
renovate[bot] Jul 3, 2023
613628c
Fix semver vuln (#202)
psoleckimoj Jul 4, 2023
2c49560
Update govuk-frontend to 4.7.0 (#205)
psoleckimoj Jul 7, 2023
ee2b55a
Update all non major NPM dependencies (#204)
renovate[bot] Jul 27, 2023
b3e39ed
HEAT-82: Add productId and /info endpoint (#212)
psoleckimoj Aug 3, 2023
71d46bc
Update README with dev portal URL (#213)
psoleckimoj Aug 3, 2023
0ad7d20
Fix info endpoint test description (#214)
psoleckimoj Aug 3, 2023
ce05196
Update CHANGELOG.md (#216)
andrewrlee Aug 10, 2023
8b64d97
Fix linting, update modules, remove override (#219)
psoleckimoj Aug 16, 2023
fc402c2
Move /info to health check block (#220)
psoleckimoj Aug 18, 2023
dd2585c
Update dependencies 2023-09-05 (#226)
psoleckimoj Sep 5, 2023
dda7da0
Fix CircleCI workflows for cypress (#223)
ushkarev Sep 5, 2023
6e9a6f5
Fix cypress config and remove some vestigial code (#228)
ushkarev Sep 5, 2023
a357ce8
Update readme (#229)
psoleckimoj Sep 5, 2023
f2314e1
Update Helm release generic-prometheus-alerts to v1.3.3 (#224)
renovate[bot] Sep 6, 2023
ea81f5b
Update redis Docker tag to v7.2 (#221)
renovate[bot] Sep 6, 2023
8e536a6
Update Node.js to v18.18 (#230)
renovate[bot] Sep 21, 2023
a04c1e7
HEAT-106: Standardise endpoints (#231)
psoleckimoj Sep 22, 2023
57feb88
SDIT-1088: ✨ Get components to always return status even if failed (#…
petergphillips Sep 25, 2023
41227a8
SDIT-1108: 🔧 Don't default build args (#233)
petergphillips Sep 25, 2023
5251e36
SDIT-1108: ♻️ Fix deprecated syntax version of ENV (#234)
petergphillips Sep 25, 2023
9358419
SDIT-1108: ✨ Add in environment name to header (#235)
petergphillips Sep 28, 2023
b1a467a
SDIT-1108: 📝 Add new environment name to changelog (#236)
petergphillips Sep 29, 2023
1d8b294
NON-270: Improve REST client (#238)
ushkarev Oct 4, 2023
dc8cbc6
Update actions/checkout action to v4 (#225)
renovate[bot] Oct 4, 2023
7c9412a
Update all non major NPM dependencies (#210)
renovate[bot] Oct 4, 2023
7345c5a
Update Helm release generic-service to v2.6.5 (#237)
renovate[bot] Oct 4, 2023
9232bdf
Update dependencies 2023-10-17 (#243)
psoleckimoj Oct 17, 2023
7cbaac8
HAAR-1871: update project with all typescript template changes
simon-mitchell Oct 17, 2023
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
20 changes: 9 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1

orbs:
hmpps: ministryofjustice/hmpps@7
slack: circleci/[email protected].1
slack: circleci/[email protected].5

parameters:
alerts-slack-channel:
Expand All @@ -15,7 +15,7 @@ parameters:

node-version:
type: string
default: 18.12-browsers
default: 18.18-browsers

jobs:
build:
Expand All @@ -40,18 +40,13 @@ jobs:
- run:
command: |
npm run build
DATE=$(date '+%Y-%m-%d')
export BUILD_NUMBER=${DATE}.${CIRCLE_BUILD_NUM}
export GIT_REF="$CIRCLE_SHA1"
npm run record-build-info
- run: # Run linter after build because the integration test code depend on compiled typescript...
name: Linter check
command: npm run lint
- persist_to_workspace:
root: .
paths:
- node_modules
- build-info.json
- build
- dist
- .cache/Cypress
Expand All @@ -76,14 +71,16 @@ jobs:
executor:
name: hmpps/node_redis
node_tag: << pipeline.parameters.node-version >>
redis_tag: '6.2'
redis_tag: "7.0"
steps:
- checkout
- attach_workspace:
at: ~/app
- run:
name: Install missing OS dependency
command: sudo apt-get install libxss1
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Get wiremock
command: curl -o wiremock.jar https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-standalone/2.27.1/wiremock-standalone-2.27.1.jar
Expand All @@ -98,8 +95,6 @@ jobs:
- run:
name: Wait for node app to start
command: sleep 5
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: integration tests
command: npm run int-test
Expand Down Expand Up @@ -146,6 +141,7 @@ workflows:
- unit_test
- integration_test
- build_docker
helm_timeout: 5m
- request-preprod-approval:
type: approval
requires:
Expand All @@ -160,6 +156,7 @@ workflows:
- hmpps-audit-poc-ui-preprod
requires:
- request-preprod-approval
helm_timeout: 5m
- request-prod-approval:
type: approval
requires:
Expand All @@ -170,12 +167,13 @@ workflows:
jira_update: true
jira_env_type: production
slack_notification: true
slack_channel_name: << pipeline.parameters.releases-slack-channel >>
context:
- hmpps-common-vars
- hmpps-audit-poc-ui-prod
requires:
- request-prod-approval

helm_timeout: 5m
security:
triggers:
- schedule:
Expand Down
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ helm_deploy*
README.md
node_modules
npm-debug.log
README.md
.*
**/*.test.js
scss-report.txt
eslint-report.html
test-report.html
docker-compose.yml
docker-compose*
11 changes: 6 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"jest": true
},

"plugins": ["import"],
"plugins": ["import", "no-only-tests"],

"settings": {
"import/parsers": {
Expand Down Expand Up @@ -36,7 +36,6 @@
"@typescript-eslint/no-use-before-define": 0,
"class-methods-use-this": 0,
"no-useless-constructor": 0,
"no-promise-executor-return": 0,
"@typescript-eslint/no-unused-vars": [
1,
{
Expand All @@ -49,7 +48,7 @@
"prettier/prettier": [
"error",
{
"trailingComma": "es5",
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"semi": false
Expand Down Expand Up @@ -88,14 +87,16 @@
"error",
{ "devDependencies": ["**/*.test.js", "**/*.test.ts", "**/testutils/**", "cypress.config.ts"] }
],
"no-only-tests/no-only-tests": "error",
"prettier/prettier": [
"error",
{
"trailingComma": "es5",
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"semi": false
}
]
],
"no-empty-function": ["error", { "allow": ["constructors", "arrowFunctions"] }]
}
}
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,9 @@ dist
assets/stylesheets/*.css
.idea
.vscode
build-info.json
dist/
test_results/
integration_tests/videos/
integration_tests/screenshots/
*/*.iml
helm_deploy/*/Chart.lock
helm_deploy/*/charts/
**/Chart.lock
44 changes: 23 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,47 +1,52 @@
# Stage: base image
FROM node:18.12-bullseye-slim as base
FROM node:18.18-bullseye-slim as base

ARG BUILD_NUMBER=1_0_0
ARG GIT_REF=not-available
ARG BUILD_NUMBER
ARG GIT_REF
ARG GIT_BRANCH

LABEL maintainer="HMPPS Digital Studio <[email protected]>"

ENV TZ=Europe/London
RUN ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" > /etc/timezone

RUN addgroup --gid 2000 --system appgroup && \
adduser --uid 2000 --system appuser --gid 2000
adduser --uid 2000 --system appuser --gid 2000

WORKDIR /app

# Cache breaking
ENV BUILD_NUMBER ${BUILD_NUMBER:-1_0_0}
# Cache breaking and ensure required build / git args defined
RUN test -n "$BUILD_NUMBER" || (echo "BUILD_NUMBER not set" && false)
RUN test -n "$GIT_REF" || (echo "GIT_REF not set" && false)
RUN test -n "$GIT_BRANCH" || (echo "GIT_BRANCH not set" && false)

# Define env variables for runtime health / info
ENV BUILD_NUMBER=${BUILD_NUMBER}
ENV GIT_REF=${GIT_REF}
ENV GIT_BRANCH=${GIT_BRANCH}

RUN apt-get update && \
apt-get upgrade -y && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
apt-get upgrade -y && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

# Stage: build assets
FROM base as build

ARG BUILD_NUMBER=1_0_0
ARG GIT_REF=not-available
ARG BUILD_NUMBER
ARG GIT_REF
ARG GIT_BRANCH

RUN apt-get update && \
apt-get install -y make python g++
apt-get install -y make python g++

COPY package*.json ./
RUN CYPRESS_INSTALL_BINARY=0 npm ci --no-audit

COPY . .
RUN npm run build

RUN export BUILD_NUMBER=${BUILD_NUMBER} && \
export GIT_REF=${GIT_REF} && \
npm run record-build-info

RUN npm prune --no-audit --production
RUN npm prune --no-audit --omit=dev

# Stage: copy production assets and dependencies
FROM base
Expand All @@ -51,9 +56,6 @@ COPY --from=build --chown=appuser:appgroup \
/app/package-lock.json \
./

COPY --from=build --chown=appuser:appgroup \
/app/build-info.json ./dist/build-info.json

COPY --from=build --chown=appuser:appgroup \
/app/assets ./assets

Expand All @@ -63,7 +65,7 @@ COPY --from=build --chown=appuser:appgroup \
COPY --from=build --chown=appuser:appgroup \
/app/node_modules ./node_modules

EXPOSE 3000
EXPOSE 3000 3001
ENV NODE_ENV='production'
USER 2000

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2021 Crown Copyright (Ministry of Justice)
Copyright (c) 2020-2023 Crown Copyright (Ministry of Justice)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
71 changes: 49 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,57 @@
[![repo standards badge](https://img.shields.io/badge/dynamic/json?color=blue&style=flat&logo=github&label=MoJ%20Compliant&query=%24.result&url=https%3A%2F%2Foperations-engineering-reports.cloud-platform.service.justice.gov.uk%2Fapi%2Fv1%2Fcompliant_public_repositories%2Fhmpps-audit-poc-ui)](https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/public-github-repositories.html#hmpps-audit-poc-ui "Link to report")
[![CircleCI](https://circleci.com/gh/ministryofjustice/hmpps-audit-poc-ui/tree/main.svg?style=svg)](https://circleci.com/gh/ministryofjustice/hmpps-audit-poc-ui)
[![Known Vulnerabilities](https://snyk.io/test/github/ministryofjustice/hmpps-audit-poc-ui/badge.svg)](https://snyk.io/test/github/ministryofjustice/hmpps-audit-poc-ui)

# hmpps-audit-poc-ui
A POC to investigate how to capture audit information for frontend applications.

## Latest
This is currently a skeleton Typescript UI project and no extra functionality has been added.

### Running the Cypress tests
You need to fire up the wiremock server first:
```
docker-compose -f docker-compose-test.yml up
```

### Starting feature tests node instance
A separate node instance needs to be started for the feature tests. This will run on port 3008 and won't conflict
with any of the api services.
```
npm run start-feature:dev
```

### Running the tests
With the UI:
```
npm run int-test-ui
```
## Running the app
The easiest way to run the app is to use docker compose to create the service and all dependencies.

`docker compose pull`

`docker compose up`

### Dependencies
The app requires:
* hmpps-auth - for authentication
* redis - session store and token caching

### Running the app for development


Install dependencies using `npm install`, ensuring you are using `node v18.x` and `npm v9.x`

Note: Using `nvm` (or [fnm](https://github.com/Schniz/fnm)), run `nvm install --latest-npm` within the repository folder to use the correct version of node, and the latest version of npm. This matches the `engines` config in `package.json` and the CircleCI build config.

And then, to build the assets and start the app with nodemon:

`npm run start:dev`

### Run linter

`npm run lint`

### Run tests

`npm run test`

### Running integration tests

For local running, start a test db, redis, and wiremock instance by:

`docker compose -f docker-compose-test.yml up`

Then run the server in test mode by:

`npm run start-feature` (or `npm run start-feature:dev` to run with nodemon)

And then either, run tests in headless mode with:

`npm run int-test`

Or run tests with the cypress UI:

`npm run int-test-ui`



Expand Down
5 changes: 5 additions & 0 deletions assets/scss/components/_header-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,8 @@
display: none;
}
}

.govuk-phase-banner {
@include govuk-width-container;
border: none;
}
3 changes: 2 additions & 1 deletion audit-ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"low": true,
"package-manager": "auto",
"registry": "https://registry.npmjs.org"
"registry": "https://registry.npmjs.org",
"allowlist": []
}
1 change: 0 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default defineConfig({
reporterOptions: {
configFile: 'reporter-config.json',
},
videoUploadOnPasses: false,
taskTimeout: 60000,
e2e: {
// We've imported your old cypress plugins here.
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.1'
services:

redis:
image: 'redis:6.2'
image: 'redis:7.2'
networks:
- hmpps_int
ports:
Expand All @@ -11,7 +11,7 @@ services:
wiremock:
image: wiremock/wiremock
networks:
- hmpps_int
- hmpps_int
container_name: wiremock
restart: always
ports:
Expand Down
Loading