Skip to content

Commit

Permalink
Merge branch 'develop' into ids-catalogue-properties-#515
Browse files Browse the repository at this point in the history
* develop:
  Update dependency eslint-plugin-cypress to v3
  Update tanstack-query monorepo to v5.31.0
  Update actions/setup-python action to v5.1.0
  Update actions/checkout digest
  Fix connection after changing backend docker compose to host networking #499
  Use develop branch for dev cli script
  Update dependency material-react-table to v2.13.0
  Use dev_cli script from api to setup the database for e2e api tests #499
  • Loading branch information
joshuadkitenge committed Apr 29, 2024
2 parents 7137063 + 0d68846 commit ec0de9e
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 93 deletions.
98 changes: 59 additions & 39 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Setup Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Setup Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
Expand All @@ -72,39 +72,57 @@ jobs:
name: End-to-End (with api) Tests
runs-on: ubuntu-latest

services:
mongodb:
image: mongo:7.0-jammy
ports:
- 27017:27017
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example

ims-api:
image: harbor.stfc.ac.uk/inventory-management-system/ims-api:pr-240
ports:
- 8000:8000
env:
AUTHENTICATION__ENABLED: false
API__TITLE: Inventory Management System API
API__DESCRIPTION: This is the API for the Inventory Management System
API__ROOT_PATH: /inventory-management-system-api
DATABASE__PROTOCOL: mongodb
DATABASE__USERNAME: root
DATABASE__PASSWORD: example
DATABASE__HOSTNAME: mongodb
DATABASE__PORT: 27017
DATABASE__NAME: ims
API__ALLOWED_CORS_HEADERS: '["*"]'
API__ALLOWED_CORS_ORIGINS: '["*"]'
API__ALLOWED_CORS_METHODS: '["*"]'

options: --name inventory-management-system-api

steps:
- name: Clone api repo
uses: actions/checkout@8459bc0c7e3759cdf591f513d9f141a95fef0a8f
with:
repository: ral-facilities/inventory-management-system-api
ref: develop

- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.12'

# This is required as need to setup api in a different directory as checkout will attempt delete
# all existing files which in this case will include a data directory created by docker causing
# a permission error (checkout action also can't specify a different directory to clone into)
- name: Move api repo
run: |
cd ..
mkdir inventory-management-system-api
mv -v inventory-management-system/* inventory-management-system-api/
cd inventory-management-system-api/
- name: Setup MongoDB
working-directory: ../inventory-management-system-api
run: |
python ./scripts/dev_cli.py --ci db-init --replicaSetMemberHost localhost
python ./scripts/dev_cli.py --ci db-import
# Use docker run here to test the actual built image
# Use same network as the MongoDB instance (which is generated by docker compose based on the folder
# name)
- name: Start inventory-management-system-api
run: |
docker run -d --network=host \
--name inventory_management_system_api_container \
--env AUTHENTICATION__ENABLED=false \
--env API__TITLE="Inventory Management System API" \
--env API__DESCRIPTION="This is the API for the Inventory Management System" \
--env DATABASE__PROTOCOL="mongodb" \
--env DATABASE__USERNAME="root" \
--env DATABASE__PASSWORD="example" \
--env DATABASE__HOSTNAME="localhost" \
--env DATABASE__PORT=27017 \
--env DATABASE__NAME="ims" \
--env API__ALLOWED_CORS_HEADERS='["*"]' \
--env API__ALLOWED_CORS_ORIGINS='["*"]' \
--env API__ALLOWED_CORS_METHODS='["*"]' \
harbor.stfc.ac.uk/inventory-management-system/ims-api:develop
- name: Checkout repo
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Setup Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
Expand All @@ -117,15 +135,17 @@ jobs:
sudo apt-get install libgconf-2-4
yarn --immutable
- name: Download unit data
run: wget https://raw.githubusercontent.com/ral-facilities/inventory-management-system-api/develop/data/units.json

- name: Import unit data to ims api
run: docker exec -i $(docker ps | grep mongo | awk '{ print $1 }') mongoimport --username 'root' --password 'example' --authenticationDatabase=admin --db ims --collection units --type=json --jsonArray --drop < units.json

- name: Run e2e tests
run: yarn e2e:api

- name: Output docker logs (mongodb)
if: failure()
run: docker logs mongodb_container

- name: Output docker logs (api)
if: failure()
run: docker logs inventory_management_system_api

- name: Upload Cypress screenshots
if: failure()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"cypress": "^13.0.0",
"eslint": "^8.41.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-cypress": "^2.13.3",
"eslint-plugin-cypress": "^3.0.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.34.0",
"eslint-plugin-react-hooks": "^4.6.0",
Expand Down
106 changes: 53 additions & 53 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1464,19 +1464,19 @@ __metadata:
languageName: node
linkType: hard

"@tanstack/match-sorter-utils@npm:8.11.8":
version: 8.11.8
resolution: "@tanstack/match-sorter-utils@npm:8.11.8"
"@tanstack/match-sorter-utils@npm:8.15.1":
version: 8.15.1
resolution: "@tanstack/match-sorter-utils@npm:8.15.1"
dependencies:
remove-accents: "npm:0.4.2"
checksum: 10c0/b8d6353feebbb2f640e1c9f88942feec71db643b8a00b8cbf50ee54868c42c3f6a90aaa6e47a641b214c053f3afbfbec118c9aa4b57fa1bd50bbb079716b66fc
remove-accents: "npm:0.5.0"
checksum: 10c0/a947c280093ed0214c3b1c6d9219b1a98cd000815891cb313f2a3e8cc01505a6d3bf358ba8273556804e0580a51e110a43ececabf0eec7386450662d827b0fa9
languageName: node
linkType: hard

"@tanstack/query-core@npm:5.29.0":
version: 5.29.0
resolution: "@tanstack/query-core@npm:5.29.0"
checksum: 10c0/ec90801c7234a551e347656b02c6e4dcc448722c466cc42eaf03bb69ac535c2e26a74f7189c21cf836cacf41851f30d17beae0f9478017b6220b612e1803eddb
"@tanstack/query-core@npm:5.32.0":
version: 5.32.0
resolution: "@tanstack/query-core@npm:5.32.0"
checksum: 10c0/58e7b053579a23dba36189a1fd87261819b31b344648f693fd613c722260066e11ad8c82dc07f5e5af2e276bde1b9f6a1dd6da3bf93cdd3583d128a2b373fce0
languageName: node
linkType: hard

Expand All @@ -1488,63 +1488,63 @@ __metadata:
linkType: hard

"@tanstack/react-query-devtools@npm:^5.0.0":
version: 5.29.0
resolution: "@tanstack/react-query-devtools@npm:5.29.0"
version: 5.32.0
resolution: "@tanstack/react-query-devtools@npm:5.32.0"
dependencies:
"@tanstack/query-devtools": "npm:5.28.10"
peerDependencies:
"@tanstack/react-query": ^5.29.0
"@tanstack/react-query": ^5.32.0
react: ^18.0.0
checksum: 10c0/b2af91dfd8cb83a51dc6438d19ae623082a22b76f982086eb61721833d6ba80a81daf72c323a02fe3af06751a1389249d76939b2ee040b701a649d135d7e9c57
checksum: 10c0/79bd124c834eb367b4bf89e7960c504c71b02dbe3db959f8fc4a4479e7b65614f6ec669c0a5a97db3fdb0f2995db00ebf7fff041ee620c9bd18c0e7aa2d9ae38
languageName: node
linkType: hard

"@tanstack/react-query@npm:^5.0.0":
version: 5.29.0
resolution: "@tanstack/react-query@npm:5.29.0"
version: 5.32.0
resolution: "@tanstack/react-query@npm:5.32.0"
dependencies:
"@tanstack/query-core": "npm:5.29.0"
"@tanstack/query-core": "npm:5.32.0"
peerDependencies:
react: ^18.0.0
checksum: 10c0/0c9041912330b4da6dc3b3f6d54e5f11edbb47ebbf8736db708e71e799b68bae9dfcdcaba6af431f3c9c79830225b289d2b6c0dd2304ac38f52a9e6f25c452bd
checksum: 10c0/0b55b4f9d91e0f72cf12298c1659ee6520723eed16b7d523bc69269331544af8b62699b72d89840dc8ae75076144ac121ed1373d4f8e7d4cd48f5e0eb1d73d80
languageName: node
linkType: hard

"@tanstack/react-table@npm:8.13.2":
version: 8.13.2
resolution: "@tanstack/react-table@npm:8.13.2"
"@tanstack/react-table@npm:8.16.0":
version: 8.16.0
resolution: "@tanstack/react-table@npm:8.16.0"
dependencies:
"@tanstack/table-core": "npm:8.13.2"
"@tanstack/table-core": "npm:8.16.0"
peerDependencies:
react: ">=16"
react-dom: ">=16"
checksum: 10c0/780f206c29bcd4386638cb935d27df2db002026c8a3c06eacbf4fcedaeefd20b212ccc4eea2f00feee66840c8d401b478b21d83ab69902341402cb2d3aa5cb60
react: ">=16.8"
react-dom: ">=16.8"
checksum: 10c0/e6b05af777592fdd56055e753f4c626b14ed9ba4818c84411adc4e552d2b05474bfac4ca8f505ce9b2ffa36023a489b41297f25216124a4b6150852ac83708d8
languageName: node
linkType: hard

"@tanstack/react-virtual@npm:3.1.3":
version: 3.1.3
resolution: "@tanstack/react-virtual@npm:3.1.3"
"@tanstack/react-virtual@npm:3.3.0":
version: 3.3.0
resolution: "@tanstack/react-virtual@npm:3.3.0"
dependencies:
"@tanstack/virtual-core": "npm:3.1.3"
"@tanstack/virtual-core": "npm:3.3.0"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
checksum: 10c0/66d06f8c152e975cce861f459e811c0aaa4fd478d626d3792c31c55d3d931214ace3512430aeb0448b654cfb8a145be82caf62916a91d42cd44ef2558e259520
checksum: 10c0/52b30c87cbf2518cfe19812b290c60dd576587545bc910adf5a17ff16b241c4cf28690163db2063afd9e3adc0259086263071e63c8c8380ac56c0f6a54bde820
languageName: node
linkType: hard

"@tanstack/table-core@npm:8.13.2":
version: 8.13.2
resolution: "@tanstack/table-core@npm:8.13.2"
checksum: 10c0/e81934be7792ee24d66e22471849659abfb926f0e9fda22eea3a94060f4c6d9197b1d5a901700adafe84263950acb97816b7b4736e14353ef58f49a10f8400aa
"@tanstack/table-core@npm:8.16.0":
version: 8.16.0
resolution: "@tanstack/table-core@npm:8.16.0"
checksum: 10c0/fda4d47d40f61d1c226ecb47051afdcd49faa0b2c6ea2bd5ce138822794b8e0c4ca118aa03a15e1e2bc3882c57c901d5e90067a0c49e3e42a61267b004527434
languageName: node
linkType: hard

"@tanstack/virtual-core@npm:3.1.3":
version: 3.1.3
resolution: "@tanstack/virtual-core@npm:3.1.3"
checksum: 10c0/4c825b47f7d0badc9ca206227d8fbc2546011a8a3b228618907229c0c0efe1cc8c4854a98c312b01d4f8b7aa41c87550f0863546998edc6d76c05a07ca8ba15b
"@tanstack/virtual-core@npm:3.3.0":
version: 3.3.0
resolution: "@tanstack/virtual-core@npm:3.3.0"
checksum: 10c0/d31125fde6a3ef3aefd3754b37f4724772c8a567f4e8212cf02a64fba6fde9ab8f80a8c9f99d28b046f84a938aea390adbd591eb4858d849a05326b0cebdfc25
languageName: node
linkType: hard

Expand Down Expand Up @@ -3899,14 +3899,14 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-cypress@npm:^2.13.3":
version: 2.15.1
resolution: "eslint-plugin-cypress@npm:2.15.1"
"eslint-plugin-cypress@npm:^3.0.0":
version: 3.0.1
resolution: "eslint-plugin-cypress@npm:3.0.1"
dependencies:
globals: "npm:^13.20.0"
peerDependencies:
eslint: ">= 3.2.1"
checksum: 10c0/f404adf415ef6b986d3480397a26eb73976a9156bbf786f2d22b8df28bbf0e50d4b3c699caefd230f0de9d6e8850596ab1bcc471b173aede05373d2a5ae3c624
eslint: ">=7 <9"
checksum: 10c0/c82c55b4f10f2505f3c82599a705d1d0765fe60c20476972390aab71ab2ef1b6ec296434fa9ff753aa90fc8367d65d16b019d75ef69e2350ac1e391ecee69002
languageName: node
linkType: hard

Expand Down Expand Up @@ -5131,7 +5131,7 @@ __metadata:
date-fns: "npm:3.6.0"
eslint: "npm:^8.41.0"
eslint-config-prettier: "npm:^9.0.0"
eslint-plugin-cypress: "npm:^2.13.3"
eslint-plugin-cypress: "npm:^3.0.0"
eslint-plugin-prettier: "npm:^5.0.0"
eslint-plugin-react: "npm:^7.34.0"
eslint-plugin-react-hooks: "npm:^4.6.0"
Expand Down Expand Up @@ -6040,12 +6040,12 @@ __metadata:
linkType: hard

"material-react-table@npm:^2.0.4":
version: 2.12.1
resolution: "material-react-table@npm:2.12.1"
version: 2.13.0
resolution: "material-react-table@npm:2.13.0"
dependencies:
"@tanstack/match-sorter-utils": "npm:8.11.8"
"@tanstack/react-table": "npm:8.13.2"
"@tanstack/react-virtual": "npm:3.1.3"
"@tanstack/match-sorter-utils": "npm:8.15.1"
"@tanstack/react-table": "npm:8.16.0"
"@tanstack/react-virtual": "npm:3.3.0"
highlight-words: "npm:1.2.2"
peerDependencies:
"@emotion/react": ">=11.11"
Expand All @@ -6055,7 +6055,7 @@ __metadata:
"@mui/x-date-pickers": ">=6.15.0"
react: ">=17.0"
react-dom: ">=17.0"
checksum: 10c0/97e30acb8078276a6da4bbe9765c4283a0a698fc25626ac3d4a219a3fa75ff92f07524f3c6f26cd50514d6a1526aa547917e1557ea9cb7d157442c594d621de2
checksum: 10c0/1de9c9b30987710fac954dc4a9ed64fe28db5e7bf14b6193bb6d79705327b81add35af4597662564719f8dcf25226be515ba6ec25f2611a7f6da0ece9c3c4990
languageName: node
linkType: hard

Expand Down Expand Up @@ -7264,10 +7264,10 @@ __metadata:
languageName: node
linkType: hard

"remove-accents@npm:0.4.2":
version: 0.4.2
resolution: "remove-accents@npm:0.4.2"
checksum: 10c0/5cbc00efa52df29ce947a0c572ff975b011f5f197ebe7b4f6e527de26aba534cba12d502e3040b72e46ad01de3d4f2d5ef57a6593c964965e43ddb60438da0f8
"remove-accents@npm:0.5.0":
version: 0.5.0
resolution: "remove-accents@npm:0.5.0"
checksum: 10c0/a75321aa1b53d9abe82637115a492770bfe42bb38ed258be748bf6795871202bc8b4badff22013494a7029f5a241057ad8d3f72adf67884dbe15a9e37e87adc4
languageName: node
linkType: hard

Expand Down

0 comments on commit ec0de9e

Please sign in to comment.