Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 10 additions & 6 deletions .github/scripts/dispatch_internal_repo_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ if [[ -z "$extraSecretNames" ]]; then
extraSecretNames=""
fi

if [{ -z "$tableName" }]; then
if [[ -z "$tableName" ]]; then
tableName=""
fi

Expand Down Expand Up @@ -306,17 +306,21 @@ echo "[INFO] Triggering workflow '$targetWorkflow' in nhs-notify-internal..."

echo "[DEBUG] Dispatch event payload: $DISPATCH_EVENT"

trigger_response=$(curl -s -L \
--fail \
trigger_http_code=$(curl -s -L \
-o /tmp/dispatch_response.json \
-w "%{http_code}" \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${PR_TRIGGER_PAT}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/NHSDigital/nhs-notify-internal/actions/workflows/$targetWorkflow/dispatches" \
-d "$DISPATCH_EVENT" 2>&1)
-d "$DISPATCH_EVENT")

if [[ $? -ne 0 ]]; then
echo "[ERROR] Failed to trigger workflow. Response: $trigger_response"
trigger_response=$(cat /tmp/dispatch_response.json)

if [[ "$trigger_http_code" -lt 200 || "$trigger_http_code" -ge 300 ]]; then
echo "[ERROR] Failed to trigger workflow. HTTP status: $trigger_http_code"
echo "[ERROR] Response body: $trigger_response"
exit 1
fi

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/stage-3-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ jobs:
.github/scripts/dispatch_internal_repo_workflow.sh \
--infraRepoName "$(echo ${{ github.repository }} | cut -d'/' -f2)" \
--releaseVersion ${{ github.head_ref || github.ref_name }} \
--targetWorkflow "publish-supplier-config.yaml" \
--targetWorkflow "publish-supplier-config-to-ddb.yaml" \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

‎.github/workflows/publish-supplier-config-to-event-bridge.yaml‎ ?

Or is this just pinning it to the DDB action until there are equivalent listeners?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've concluded that the build job should continue to use the publish-to-ddb action. The main reason behind that decision is that the event bus in the NHS Notify Shared Infra account is only aware of static environments - there are no routing rules allowing delivery of events to the dynamic environments that are spun up for each PR.

--targetEnvironment "${{ steps.set-environment.outputs.environment_name }}" \
--internalRef "feature/CCM-17337-Publish-Supplier-Configuration-Event" \
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporary, to be removed before checking in

--targetComponent "config" \
--targetAccountGroup "nhs-notify-suppliers-dev" \
--tableName "supplier-config" \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"allocationPercentage": 30,
"id": "supplier1-volumeGroup-test1",
"id": "supplier1-volume-group-test1",
"status": "PROD",
"supplier": "supplier1",
"volumeGroup": "volumeGroup-test1"
"volumeGroup": "volume-group-test1"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"allocationPercentage": 100,
"id": "supplier1-volumeGroup-test2",
"id": "supplier1-volume-group-test2",
"status": "PROD",
"supplier": "supplier1",
"volumeGroup": "volumeGroup-test2"
"volumeGroup": "volume-group-test2"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"allocationPercentage": 100,
"id": "supplier1-volumeGroup-test3",
"id": "supplier1-volume-group-test3",
"status": "PROD",
"supplier": "supplier1",
"volumeGroup": "volumeGroup-test3"
"volumeGroup": "volume-group-test3"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"allocationPercentage": 70,
"id": "supplier2-volumeGroup-test1",
"id": "supplier2-volume-group-test1",
"status": "PROD",
"supplier": "supplier2",
"volumeGroup": "volumeGroup-test1"
"volumeGroup": "volume-group-test1"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "Dev Test Volume Group 1",
"id": "volumeGroup-test1",
"id": "volume-group-test1",
"name": "Dev Test Volume Group 1",
"startDate": "2026-01-01",
"status": "PROD"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "Dev Test Volume Group 2",
"id": "volumeGroup-test2",
"id": "volume-group-test2",
"name": "Dev Test Volume Group 2",
"startDate": "2026-01-01",
"status": "PROD"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "Dev Test Volume Group 3",
"id": "volumeGroup-test3",
"id": "volume-group-test3",
"name": "Dev Test Volume Group 3",
"startDate": "2026-01-01",
"status": "PROD"
Expand Down
Loading