Skip to content

Commit 23a12da

Browse files
authored
Merge pull request #2945 from bcgov/feature/vulnerability-updates-25
React Shared Components
2 parents 18f1593 + bd56295 commit 23a12da

File tree

6 files changed

+27
-276
lines changed

6 files changed

+27
-276
lines changed

.github/workflows/code-climate-coverage-aggregation.yml

Lines changed: 17 additions & 257 deletions
Original file line numberDiff line numberDiff line change
@@ -10,71 +10,19 @@ jobs:
1010
yarn:
1111
env:
1212
FILE_COUNTER: 0
13-
CC_TEST_REPORTER_ID: 9ada3133fe9babf91a222009998b3545b7eae897a05900930bfa8a27fd82f385
1413
ACTION_DEBUG: true
1514

16-
name: Create, format and upload Javascript coverage artifact
15+
name: Build and Test React Apps
1716
runs-on: ubuntu-latest
1817
steps:
19-
- uses: actions/checkout@v2
20-
21-
# Get Code Climate binary
22-
- name: Download Code Climate Binary
23-
run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
24-
25-
# Permissions applied to the Code Climate Executable
26-
- name: Apply executable perms to Code Climate Binary
27-
run: chmod +x ./cc-test-reporter
28-
29-
# Before build
30-
- name: Before build
31-
run: ./cc-test-reporter before-build
32-
33-
# Set required Git env vars for either pull request
34-
- name: Set ENV for codeclimate (pull_request)
35-
run: |
36-
echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
37-
echo "GIT_COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
38-
#echo "::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }}"
39-
#echo "::set-env name=GIT_COMMIT_SHA::${{ github.event.pull_request.head.sha }}"
40-
if: github.event_name == 'pull_request'
41-
42-
# Set required Git env vars for a push to master
43-
- name: Set ENV for codeclimate (push)
44-
run: |
45-
echo "GIT_BRANCH=$GITHUB_REF" >> GITHUB_ENV
46-
echo "GIT_COMMIT_SHA=$GITHUB_SHA" >> GITHUB_ENV
47-
#echo "::set-env name=GIT_BRANCH::$GITHUB_REF"
48-
#echo "::set-env name=GIT_COMMIT_SHA::$GITHUB_SHA"
49-
if: github.event_name == 'push'
50-
51-
# Trimming the ref to master in order to publish correct report (paambaati)
52-
- name: Set ref/head/master to master
53-
run: |
54-
echo "GIT_BRANCH=master" >> $GITHUB_ENV
55-
#echo "::set-env name=GIT_BRANCH::master"
56-
if: env.GIT_BRANCH == 'refs/heads/master'
18+
- uses: actions/checkout@v4
5719

5820
- name: Printing node and yarn versions
5921
run: node --version && yarn --version
6022
# Figure out where yarn is caching things
6123
- name: Yarn Cache
6224
run: yarn cache dir
6325

64-
# Implement Caching Action for Yarn Project
65-
- name: Cache node modules
66-
uses: actions/cache@v4
67-
env:
68-
cache-name: cache-node-modules
69-
with:
70-
# YARN cache files are stored in `/home/runner/.cache/yarn/v6` on git actions
71-
path: /home/runner/.cache/yarn/v6
72-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
73-
restore-keys: |
74-
${{ runner.os }}-build-${{ env.cache-name }}-
75-
${{ runner.os }}-build-
76-
${{ runner.os }}-
77-
7826
# Run Yarn Install - eFiling Frontend
7927
- name: Run Yarn Install - eFiling Frontend
8028
run: yarn --cwd src/frontend/efiling-frontend install
@@ -110,49 +58,33 @@ jobs:
11058
# cd ${{github.workspace}}/src/frontend/efiling-demo/
11159
# ${{github.workspace}}/cc-test-reporter format-coverage -t lcov -o ${{github.workspace}}/coverage/frontend-demo-codeclimate.json coverage/lcov.info
11260
# popd
61+
# Implement Caching Action for Yarn Project
62+
- name: Cache node modules
63+
uses: actions/cache@v4
64+
env:
65+
cache-name: cache-node-modules
66+
with:
67+
# YARN cache files are stored in `/home/runner/.cache/yarn/v6` on git actions
68+
path: /home/runner/.cache/yarn/v6
69+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
70+
restore-keys: |
71+
${{ runner.os }}-build-${{ env.cache-name }}-
72+
${{ runner.os }}-build-
73+
${{ runner.os }}-
11374
114-
# Formatting the FRONTEND coverage report
115-
- name: Format the FRONTEND coverage report
116-
run: |
117-
pushd .
118-
cd ${{github.workspace}}/src/frontend/efiling-frontend/
119-
${{github.workspace}}/cc-test-reporter format-coverage -t lcov -o ${{github.workspace}}/coverage/frontend-codeclimate.json coverage/lcov.info
120-
popd
121-
122-
# List all formatted files in coverage directory
123-
- name: WHERE AM I - FORMATTED?
124-
run: |
125-
ls ${{ github.workspace }}/coverage
126-
if: ${{ env.ACTION_DEBUG }}
127-
128-
# Count of all total coverage files available
129-
- name: Count files present
130-
run: |
131-
echo "FILE_COUNTER=$(ls -1q ./coverage | wc -l )" >> $GITHUB_ENV
132-
#echo "::set-env name=FILE_COUNTER::$(ls -1q ./coverage | wc -l )"
13375
134-
# Sum the coverage reports
135-
- name: Summing the coverage reports generated
136-
run: ./cc-test-reporter sum-coverage coverage/*-codeclimate.json -p ${{ env.FILE_COUNTER }} -o coverage/total-codeclimate.json
13776
138-
# Upload JSON for debugging purposes
139-
- name: Upload JSON for debugging purposes
140-
uses: actions/upload-artifact@v4
141-
with:
142-
name: summed-yarn-coverage-report
143-
path: coverage/total-codeclimate.json
14477
14578
spring-boot:
146-
name: Create, format and upload Java coverage artifact
79+
name: Build and Test Java
14780
runs-on: ubuntu-latest
14881
env:
14982
FILE_COUNTER: 0
150-
CC_TEST_REPORTER_ID: 9ada3133fe9babf91a222009998b3545b7eae897a05900930bfa8a27fd82f385
15183
ACTION_DEBUG: true
15284

15385
steps:
15486
- name: Checkout Spring Starters Repository
155-
uses: actions/checkout@v2
87+
uses: actions/checkout@v4
15688
with:
15789
repository: bcgov/spring-boot-starters
15890
path: spring-boot-starters
@@ -171,35 +103,6 @@ jobs:
171103
- name: Checkout File Submission Repository
172104
uses: actions/checkout@v2
173105

174-
# Get Code Climate binary
175-
- name: Download Code Climate Binary
176-
run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
177-
178-
# Permissions applied to the Code Climate Executable
179-
- name: Apply executable perms to Code Climate Binary
180-
run: chmod +x ./cc-test-reporter
181-
182-
# Before build
183-
- name: Before build
184-
run: ./cc-test-reporter before-build
185-
186-
# Set required Git env vars for either pull request
187-
- name: Set ENV for codeclimate (pull_request)
188-
run: |
189-
echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
190-
echo "GIT_COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
191-
#echo "::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }}"
192-
#echo "::set-env name=GIT_COMMIT_SHA::${{ github.event.pull_request.head.sha }}"
193-
if: github.event_name == 'pull_request'
194-
195-
# Set required Git env vars for a push to master
196-
- name: Set ENV for codeclimate (push)
197-
run: |
198-
echo "GIT_BRANCH=$GITHUB_REF" >> $GITHUB_ENV
199-
echo "GIT_COMMIT_SHA=$GITHUB_SHA" >> $GITHUB_ENV
200-
#echo "::set-env name=GIT_BRANCH::$GITHUB_REF"
201-
#echo "::set-env name=GIT_COMMIT_SHA::$GITHUB_SHA"
202-
if: github.event_name == 'push'
203106

204107
# Trimming the ref to master in order to publish correct report (paambaati)
205108
- name: Set ref/head/master to master
@@ -224,146 +127,3 @@ jobs:
224127
# Run Maven Verify to generate all jacoco reports
225128
- name: Build with Maven
226129
run: mvn -B verify -P all --file src/backend/pom.xml
227-
228-
# Formatting the BACKEND coverage reports generated (dynamically)
229-
- name: Format BACKEND coverage reports
230-
run: |
231-
projectRelRegex="^\.\/src\/backend\/(.*)\/target\/site\/jacoco\/jacoco\.xml$"
232-
for file in $(find . -name "jacoco.xml")
233-
do
234-
echo $file
235-
echo $projectRelRegex
236-
if [[ $file =~ $projectRelRegex ]]
237-
then
238-
projectRel="${BASH_REMATCH[1]}"
239-
echo "analyzing project: " $projectRel
240-
projectName="${projectRel//\//-}"
241-
JACOCO_SOURCE_PATH=${{ github.workspace }}/src/backend/$projectRel/src/main/java ./cc-test-reporter format-coverage ${{github.workspace}}/src/backend/$projectRel/target/site/jacoco/jacoco.xml --input-type jacoco --output coverage/$projectName-codeclimate.json;
242-
echo "coverage generated: coverage/$projectName-codeclimate.json;"
243-
else
244-
echo $file does not match
245-
fi
246-
done
247-
248-
# List all formatted files in coverage directory
249-
- name: WHERE AM I - FORMATTED?
250-
run: |
251-
ls ${{ github.workspace }}/coverage
252-
if: ${{ env.ACTION_DEBUG }}
253-
254-
# Count of all total coverage files available
255-
- name: Count files present
256-
run: |
257-
echo "FILE_COUNTER=$(ls -1q ./coverage | wc -l )" >> $GITHUB_ENV
258-
#echo "::set-env name=FILE_COUNTER::$(ls -1q ./coverage | wc -l )"
259-
260-
# Sum the coverage reports
261-
- name: Summing the coverage reports generated
262-
run: ./cc-test-reporter sum-coverage coverage/*-codeclimate.json -p ${{ env.FILE_COUNTER }} -o coverage/total-codeclimate.json
263-
264-
# Upload JSON for debugging purposes
265-
- name: Upload JSON for debugging purposes
266-
uses: actions/upload-artifact@v4
267-
with:
268-
name: summed-java-coverage-report
269-
path: coverage/total-codeclimate.json
270-
271-
aggregation:
272-
name: Aggregate Spring Boot and Javascript reports
273-
needs: [yarn, spring-boot]
274-
env:
275-
CC_TEST_REPORTER_ID: 9ada3133fe9babf91a222009998b3545b7eae897a05900930bfa8a27fd82f385
276-
runs-on: ubuntu-latest
277-
steps:
278-
# Get Code Climate binary
279-
- name: Download Code Climate Binary
280-
run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
281-
282-
# Permissions applied to the Code Climate Executable
283-
- name: Apply executable perms to Code Climate Binary
284-
run: chmod +x ./cc-test-reporter
285-
286-
# Before build
287-
- name: Before build
288-
run: ./cc-test-reporter before-build
289-
290-
# Set required Git env vars for either pull request
291-
- name: Set ENV for codeclimate (pull_request)
292-
run: |
293-
echo "GIT_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
294-
echo "GIT_COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
295-
#echo "::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }}"
296-
#echo "::set-env name=GIT_COMMIT_SHA::${{ github.event.pull_request.head.sha }}"
297-
if: github.event_name == 'pull_request'
298-
299-
# Set required Git env vars for a push to master
300-
- name: Set ENV for codeclimate (push)
301-
run: |
302-
echo "GIT_BRANCH=$GITHUB_REF" >> $GITHUB_ENV
303-
echo "GIT_COMMIT_SHA=$GITHUB_SHA" >> $GITHUB_ENV
304-
#echo "::set-env name=GIT_BRANCH::$GITHUB_REF"
305-
#echo "::set-env name=GIT_COMMIT_SHA::$GITHUB_SHA"
306-
if: github.event_name == 'push'
307-
308-
# Trimming the ref to master in order to publish correct report (paambaati)
309-
- name: Set ref/head/master to master
310-
run: |
311-
echo "GIT_BRANCH=master" >> $GITHUB_ENV
312-
#echo "::set-env name=GIT_BRANCH::master"
313-
if: env.GIT_BRANCH == 'refs/heads/master'
314-
315-
# Make Directory for downloaded files
316-
- name: Make directory
317-
run: mkdir coverage-reports
318-
319-
# Download Spring-boot coverage report
320-
- name: Download spring-boot coverage report
321-
uses: actions/download-artifact@v4
322-
with:
323-
name: summed-java-coverage-report
324-
325-
# See what is inside
326-
- name: List items inside java coverage report object
327-
run: |
328-
ls
329-
330-
# Copy total java to outside directory
331-
- name: Copy Java Coverage to directory
332-
run: |
333-
cp total-codeclimate.json coverage-reports/total-java-codeclimate.json
334-
335-
# Download Yarn coverage report
336-
- name: Download javascript coverage report
337-
uses: actions/download-artifact@v4
338-
with:
339-
name: summed-yarn-coverage-report
340-
341-
# See what is inside
342-
- name: List items inside javascript coverage report object
343-
run: |
344-
ls
345-
346-
# Copy total Yarn to outside directory
347-
- name: Copy Yarn Coverage to directory
348-
run: |
349-
cp total-codeclimate.json coverage-reports/total-yarn-codeclimate.json
350-
351-
# See what is inside coverage
352-
- name: List items inside java coverage report object
353-
run: |
354-
ls coverage-reports
355-
356-
# Sum the coverage reports
357-
- name: Summing the coverage reports generated
358-
run: ./cc-test-reporter sum-coverage coverage-reports/*-codeclimate.json -p 2 -o coverage-reports/total-codeclimate.json
359-
360-
# Upload JSON for debugging purposes
361-
- name: Upload JSON for debugging purposes
362-
uses: actions/upload-artifact@v4
363-
with:
364-
name: summed-total-coverage-report
365-
path: coverage-reports/total-codeclimate.json
366-
367-
# Upload total coverage report to Code Climate
368-
- name: Upload coverage report to Code Climate
369-
run: ./cc-test-reporter upload-coverage -d -i coverage-reports/total-codeclimate.json

.github/workflows/dev-efiling-api-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Build Image
2828
env:
2929
MVN_PROFILE: efiling-api,splunk
30-
STARTERS_V: v1.0.4
30+
STARTERS_V: v1.0.5
3131
run: |
3232
docker compose build efiling-api
3333
docker tag jag-file-submission-efiling-api artifacts.developer.gov.bc.ca/efc7-efiling-api/efiling-api:dev

src/frontend/efiling-demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"react-router-dom": "^6.1.1",
3030
"react-scripts": "^5.0.1",
3131
"regenerator-runtime": "^0.13.5",
32-
"shared-components": "https://github.com/bcgov/react-shared-components/releases/download/v1.3.0/shared-components-1.3.0.tgz",
32+
"shared-components": "https://github.com/bcgov/react-shared-components/releases/download/v1.3.1/shared-components-1.3.1.tgz",
3333
"uuid": "^8.3.1"
3434
},
3535
"scripts": {

src/frontend/efiling-demo/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13269,9 +13269,9 @@ shallowequal@^1.1.0:
1326913269
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"
1327013270
integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==
1327113271

13272-
"shared-components@https://github.com/bcgov/react-shared-components/releases/download/v1.3.0/shared-components-1.3.0.tgz":
13273-
version "1.3.0"
13274-
resolved "https://github.com/bcgov/react-shared-components/releases/download/v1.3.0/shared-components-1.3.0.tgz#80dca3934084b709fbfc478c76aafd58dcf9b262"
13272+
"shared-components@https://github.com/bcgov/react-shared-components/releases/download/v1.3.1/shared-components-1.3.1.tgz":
13273+
version "1.3.1"
13274+
resolved "https://github.com/bcgov/react-shared-components/releases/download/v1.3.1/shared-components-1.3.1.tgz#76966d87e163a1d792a6cea4ccbf7e9eaf54212d"
1327513275
dependencies:
1327613276
"@bcgov/bootstrap-theme" "github:bcgov/bootstrap-theme"
1327713277
bootstrap "^4.6.0"

src/frontend/efiling-frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"react-scripts": "^5.0.1",
4444
"reactstrap": "^8.9.0",
4545
"regenerator-runtime": "^0.13.7",
46-
"shared-components": "https://github.com/bcgov/react-shared-components/releases/download/v1.3.0/shared-components-1.3.0.tgz",
46+
"shared-components": "https://github.com/bcgov/react-shared-components/releases/download/v1.3.1/shared-components-1.3.1.tgz",
4747
"stream": "^0.0.2",
4848
"stream-browserify": "^3.0.0",
4949
"stream-http": "^3.2.0",

src/frontend/efiling-frontend/yarn.lock

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13409,16 +13409,7 @@ setprototypeof@1.2.0:
1340913409
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
1341013410
integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==
1341113411

13412-
sha.js@^2.4.0, sha.js@^2.4.8:
13413-
version "2.4.12"
13414-
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.12.tgz#eb8b568bf383dfd1867a32c3f2b74eb52bdbf23f"
13415-
integrity sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==
13416-
dependencies:
13417-
inherits "^2.0.4"
13418-
safe-buffer "^5.2.1"
13419-
to-buffer "^1.2.0"
13420-
13421-
sha.js@^2.4.11:
13412+
sha.js@^2.4.0, sha.js@^2.4.11, sha.js@^2.4.8:
1342213413
version "2.4.12"
1342313414
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.12.tgz#eb8b568bf383dfd1867a32c3f2b74eb52bdbf23f"
1342413415
integrity sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==
@@ -13439,9 +13430,9 @@ shallowequal@^1.1.0:
1343913430
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"
1344013431
integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==
1344113432

13442-
"shared-components@https://github.com/bcgov/react-shared-components/releases/download/v1.3.0/shared-components-1.3.0.tgz":
13443-
version "1.3.0"
13444-
resolved "https://github.com/bcgov/react-shared-components/releases/download/v1.3.0/shared-components-1.3.0.tgz#80dca3934084b709fbfc478c76aafd58dcf9b262"
13433+
"shared-components@https://github.com/bcgov/react-shared-components/releases/download/v1.3.1/shared-components-1.3.1.tgz":
13434+
version "1.3.1"
13435+
resolved "https://github.com/bcgov/react-shared-components/releases/download/v1.3.1/shared-components-1.3.1.tgz#76966d87e163a1d792a6cea4ccbf7e9eaf54212d"
1344513436
dependencies:
1344613437
"@bcgov/bootstrap-theme" "github:bcgov/bootstrap-theme"
1344713438
bootstrap "^4.6.0"

0 commit comments

Comments
 (0)