Skip to content

Commit ef28478

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/CCM-11164-rc-api-post
2 parents 1c1b87f + 92e5bc6 commit ef28478

File tree

87 files changed

+3527
-342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+3527
-342
lines changed

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ concurrency:
1111
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
1212
cancel-in-progress: false
1313

14+
permissions:
15+
id-token: write
16+
contents: write
17+
packages: read
1418

1519
jobs:
1620
metadata:
@@ -77,9 +81,23 @@ jobs:
7781
export DOES_PULL_REQUEST_EXIST="${{ steps.pr_exists.outputs.does_pull_request_exist }}"
7882
export IS_VERSION_PRERELEASE="${{ steps.variables.outputs.is_version_prerelease }}"
7983
make list-variables
84+
85+
dependencies:
86+
name: Install / cache dependencies
87+
needs: [metadata]
88+
runs-on: ubuntu-latest
89+
steps:
90+
- name: "Checkout code"
91+
uses: actions/[email protected]
92+
- name: "Install / cache node_modules"
93+
uses: ./.github/actions/node-modules-cache
94+
with:
95+
node_version: "${{ inputs.nodejs_version }}"
96+
skip_restore: true
97+
8098
commit-stage: # Recommended maximum execution time is 2 minutes
8199
name: "Commit stage"
82-
needs: [metadata]
100+
needs: [metadata, dependencies]
83101
uses: ./.github/workflows/stage-1-commit.yaml
84102
with:
85103
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
@@ -92,7 +110,7 @@ jobs:
92110
secrets: inherit
93111
test-stage: # Recommended maximum execution time is 5 minutes
94112
name: "Test stage"
95-
needs: [metadata, commit-stage]
113+
needs: [metadata, dependencies, commit-stage]
96114
uses: ./.github/workflows/stage-2-test.yaml
97115
with:
98116
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
@@ -105,7 +123,7 @@ jobs:
105123
secrets: inherit
106124
acceptance-stage: # Recommended maximum execution time is 10 minutes
107125
name: "Acceptance stage"
108-
needs: [metadata, test-stage]
126+
needs: [metadata, dependencies, test-stage]
109127
uses: ./.github/workflows/stage-4-acceptance.yaml
110128
if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened')) || (github.event_name == 'push' && github.ref == 'refs/heads/main')
111129
secrets: inherit

.github/workflows/pr_closed.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,29 @@ jobs:
9999
echo "version_changed=true" >> $GITHUB_OUTPUT
100100
fi
101101
102+
test-contract-provider:
103+
name: "Test contracts (provider)"
104+
needs: check-event-schemas-version-change
105+
if: needs.check-event-schemas-version-change.outputs.version_changed == 'true'
106+
runs-on: ubuntu-latest
107+
permissions:
108+
contents: read
109+
packages: read
110+
steps:
111+
- name: "Checkout code"
112+
uses: actions/[email protected]
113+
- name: "Install dependencies"
114+
run: npm ci
115+
- name: "Run provider contract tests"
116+
run: make test-contract-provider
117+
env:
118+
GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119+
102120
publish-event-schemas:
103121
name: Publish event schemas package to GitHub package registry
104-
needs: check-event-schemas-version-change
122+
needs:
123+
- check-event-schemas-version-change
124+
- test-contract-provider
105125
if: needs.check-event-schemas-version-change.outputs.version_changed == 'true'
106126
runs-on: ubuntu-latest
107127
permissions:

.github/workflows/stage-1-commit.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
needs: detect-terraform-changes
7373
if: needs.detect-terraform-changes.outputs.terraform_changed == 'true'
7474
permissions:
75-
contents: write
75+
contents: write
7676
steps:
7777
- name: "Checkout code"
7878
uses: actions/[email protected]
@@ -149,7 +149,7 @@ jobs:
149149
trivy:
150150
name: "Trivy Scan"
151151
runs-on: ubuntu-latest
152-
timeout-minutes: 5
152+
timeout-minutes: 10
153153
needs: detect-terraform-changes
154154
if: needs.detect-terraform-changes.outputs.terraform_changed == 'true'
155155
steps:
@@ -248,8 +248,10 @@ jobs:
248248
- name: "Checkout code"
249249
uses: actions/checkout@v4
250250

251-
- name: Install dependencies
252-
run: npm ci
251+
- name: "Restore node_modules from cache"
252+
uses: ./.github/actions/node-modules-cache
253+
with:
254+
node_version: "${{ inputs.nodejs_version }}"
253255

254256
- name: Re-generate schemas
255257
run: npm --workspace packages/event-schemas run generate-json-schemas

.github/workflows/stage-2-test.yaml

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,6 @@ permissions:
4141
contents: read # This is required for actions/checkout
4242

4343
jobs:
44-
install-dependencies:
45-
name: "Install dependencies"
46-
runs-on: ubuntu-latest
47-
timeout-minutes: 5
48-
steps:
49-
- name: "Checkout code"
50-
uses: actions/[email protected]
51-
- name: "Restore node_modules from cache"
52-
uses: ./.github/actions/node-modules-cache
53-
with:
54-
node_version: "${{ inputs.nodejs_version }}"
55-
skip_restore: true
56-
5744
discover-workspaces:
5845
runs-on: ubuntu-latest
5946
outputs:
@@ -70,7 +57,6 @@ jobs:
7057
name: "Check generated dependencies"
7158
runs-on: ubuntu-latest
7259
timeout-minutes: 5
73-
needs: [install-dependencies]
7460
steps:
7561
- name: "Checkout code"
7662
uses: actions/[email protected]
@@ -87,7 +73,7 @@ jobs:
8773
name: "Unit tests"
8874
runs-on: ubuntu-latest
8975
timeout-minutes: 5
90-
needs: [install-dependencies, discover-workspaces]
76+
needs: [discover-workspaces]
9177
strategy:
9278
fail-fast: false
9379
matrix:
@@ -130,7 +116,6 @@ jobs:
130116
name: "Linting"
131117
runs-on: ubuntu-latest
132118
timeout-minutes: 5
133-
needs: [install-dependencies]
134119
steps:
135120
- name: "Checkout code"
136121
uses: actions/[email protected]
@@ -149,7 +134,6 @@ jobs:
149134
name: "Typecheck"
150135
runs-on: ubuntu-latest
151136
timeout-minutes: 5
152-
needs: [install-dependencies]
153137
steps:
154138
- name: "Checkout code"
155139
uses: actions/[email protected]
@@ -164,6 +148,25 @@ jobs:
164148
run: |
165149
make test-typecheck
166150
151+
test-contract-provider:
152+
name: "Test contracts (provider)"
153+
runs-on: ubuntu-latest
154+
permissions:
155+
contents: read
156+
packages: read
157+
steps:
158+
- name: "Checkout code"
159+
uses: actions/[email protected]
160+
- name: "Restore node_modules from cache"
161+
uses: ./.github/actions/node-modules-cache
162+
with:
163+
node_version: "${{ inputs.nodejs_version }}"
164+
- name: "Run provider contract tests"
165+
run: make test-contract-provider
166+
env:
167+
GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
168+
169+
167170
merge-coverage:
168171
name: "Merge coverage"
169172
runs-on: ubuntu-latest
@@ -195,26 +198,26 @@ jobs:
195198
name: code-coverage-report
196199
path: .reports/lcov.info
197200

198-
perform-static-analysis:
199-
name: "Perform static analysis"
200-
needs: [test-unit, merge-coverage]
201-
runs-on: ubuntu-latest
202-
permissions:
203-
id-token: write
204-
contents: read
205-
timeout-minutes: 5
206-
steps:
207-
- name: "Checkout code"
208-
uses: actions/[email protected]
209-
with:
210-
fetch-depth: 0 # Full history is needed to improving relevancy of reporting
211-
- name: "Download coverage report for SONAR"
212-
uses: actions/download-artifact@v5
213-
with:
214-
name: code-coverage-report
215-
- name: "Perform static analysis"
216-
uses: ./.github/actions/perform-static-analysis
217-
with:
218-
sonar_organisation_key: "${{ vars.SONAR_ORGANISATION_KEY }}"
219-
sonar_project_key: "${{ vars.SONAR_PROJECT_KEY }}"
220-
sonar_token: "${{ secrets.SONAR_TOKEN }}"
201+
# perform-static-analysis:
202+
# name: "Perform static analysis"
203+
# needs: [test-unit, merge-coverage]
204+
# runs-on: ubuntu-latest
205+
# permissions:
206+
# id-token: write
207+
# contents: read
208+
# timeout-minutes: 5
209+
# steps:
210+
# - name: "Checkout code"
211+
# uses: actions/[email protected]
212+
# with:
213+
# fetch-depth: 0 # Full history is needed to improving relevancy of reporting
214+
# - name: "Download coverage report for SONAR"
215+
# uses: actions/download-artifact@v5
216+
# with:
217+
# name: code-coverage-report
218+
# - name: "Perform static analysis"
219+
# uses: ./.github/actions/perform-static-analysis
220+
# with:
221+
# sonar_organisation_key: "${{ vars.SONAR_ORGANISATION_KEY }}"
222+
# sonar_project_key: "${{ vars.SONAR_PROJECT_KEY }}"
223+
# sonar_token: "${{ secrets.SONAR_TOKEN }}"

.gitleaksignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ b19d88d1d92b0530f065feefcf25d8cdd82a876a:tests/test-team/auth/user.json:jwt:15
77
b19d88d1d92b0530f065feefcf25d8cdd82a876a:tests/test-team/auth/user.json:jwt:25
88
bc79df4f82052918ae6bf69d36279e5dd391d61e:tests/test-team/auth/user.json:jwt:15
99
bc79df4f82052918ae6bf69d36279e5dd391d61e:tests/test-team/auth/user.json:jwt:25
10+
306d9ec55d3498b86d5506da9a90ac486fc66563:frontend/src/components/molecules/MessagePlanFallbackConditions/MessagePlanFallbackConditions.tsx:ipv4:92

frontend/src/__tests__/app/upload-letter-template/__snapshots__/page.test.tsx.snap

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,35 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`UploadLetterTemplatePage should render UploadLetterTemplatePage 1`] = `
3+
exports[`UploadLetterTemplatePage should render UploadLetterTemplatePage with campaignId field when campaignIds is not available 1`] = `
44
<LetterTemplateForm
5+
campaignIds={
6+
[
7+
"campaign-id",
8+
]
9+
}
10+
initialState={
11+
{
12+
"campaignId": "campaign-id",
13+
"language": "en",
14+
"letterType": "x0",
15+
"name": "",
16+
"templateType": "LETTER",
17+
}
18+
}
19+
/>
20+
`;
21+
22+
exports[`UploadLetterTemplatePage should render UploadLetterTemplatePage with campaignIds field when available 1`] = `
23+
<LetterTemplateForm
24+
campaignIds={
25+
[
26+
"campaign-id",
27+
"other-campaign-id",
28+
]
29+
}
530
initialState={
631
{
32+
"campaignId": "",
733
"language": "en",
834
"letterType": "x0",
935
"name": "",

0 commit comments

Comments
 (0)