Skip to content

Commit fc179f7

Browse files
committed
Rename ddb -> eventbridge
1 parent 66ed93a commit fc179f7

44 files changed

Lines changed: 1050 additions & 1863 deletions

Some content is hidden

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

.github/actions/bundle-ddb-publish/action.yml renamed to .github/actions/bundle-eventbridge-publish/action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: "Bundle ddb-publish"
2-
description: "Build and package the ddb-publish release bundle (ddb-publish-bundle.tgz) from the workspace sources."
1+
name: "Bundle eventbridge-publish"
2+
description: "Build and package the eventbridge-publish release bundle (eventbridge-publish-bundle.tgz) from the workspace sources."
33

44
inputs:
55
node-version:
@@ -43,23 +43,23 @@ runs:
4343
set -euo pipefail
4444
npm run typecheck --workspaces --if-present
4545
46-
- name: Build ddb-publish bundle
46+
- name: Build eventbridge-publish bundle
4747
shell: bash
4848
run: |
4949
set -euo pipefail
50-
npm run bundle:release --workspace @supplier-config/ddb-publisher
50+
npm run bundle:release --workspace @supplier-config/eventbridge-publisher
5151
5252
- name: Smoke-test bundle
5353
shell: bash
5454
run: |
5555
set -euo pipefail
56-
node packages/ddb-publisher/artifacts/ddb-publish/index.cjs --help > /dev/null
56+
node packages/eventbridge-publisher/artifacts/eventbridge-publish/index.cjs --help > /dev/null
5757
5858
- name: Package tarball
5959
id: bundle
6060
shell: bash
6161
run: |
6262
set -euo pipefail
63-
tarball="ddb-publish-bundle.tgz"
64-
tar -czf "$tarball" -C packages/ddb-publisher/artifacts/ddb-publish .
63+
tarball="eventbridge-publish-bundle.tgz"
64+
tar -czf "$tarball" -C packages/eventbridge-publisher/artifacts/eventbridge-publish .
6565
echo "tarball_path=$tarball" >> "$GITHUB_OUTPUT"

.github/workflows/release-ddb-publish.yml renamed to .github/workflows/release-eventbridge-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release ddb-publish bundle
1+
name: Release eventbridge-publish bundle
22

33
on:
44
release:
@@ -22,9 +22,9 @@ jobs:
2222
set -euo pipefail
2323
echo "node=$(grep '^nodejs\s' .tool-versions | awk '{print $2}')" >> "$GITHUB_OUTPUT"
2424
25-
- name: Bundle ddb-publish
25+
- name: Bundle eventbridge-publish
2626
id: bundle
27-
uses: ./.github/actions/bundle-ddb-publish
27+
uses: ./.github/actions/bundle-eventbridge-publish
2828
with:
2929
node-version: "${{ steps.versions.outputs.node }}"
3030
run-typecheck: "true"
@@ -42,5 +42,5 @@ jobs:
4242
if: github.event_name != 'release'
4343
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
4444
with:
45-
name: ddb-publish-bundle
45+
name: eventbridge-publish-bundle
4646
path: "${{ steps.bundle.outputs.tarball-path }}"

.github/workflows/stage-3-build.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,25 @@ jobs:
4545
with:
4646
version: "${{ inputs.version }}"
4747

48-
ddb-publish-bundle:
49-
name: "Bundle ddb-publish CLI"
48+
eventbridge-publish-bundle:
49+
name: "Bundle eventbridge-publish CLI"
5050
runs-on: ubuntu-latest
5151
timeout-minutes: 3
5252
steps:
5353
- name: "Checkout code"
5454
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5555

56-
- name: "Bundle ddb-publish"
56+
- name: "Bundle eventbridge-publish"
5757
id: bundle
58-
uses: ./.github/actions/bundle-ddb-publish
58+
uses: ./.github/actions/bundle-eventbridge-publish
5959
with:
6060
node-version: "${{ inputs.nodejs_version }}"
6161
run-typecheck: "false"
6262

6363
- name: "Upload bundle as workflow artifact"
6464
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v5
6565
with:
66-
name: ddb-publish-bundle
66+
name: eventbridge-publish-bundle
6767
path: "${{ steps.bundle.outputs.tarball-path }}"
6868

6969
artefact-1:
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: "Publish supplier config to DynamoDB"
2-
description: "Reads config from a file store and publishes records to a DynamoDB table."
1+
name: "Publish supplier config to EventBridge"
2+
description: "Reads config from a file store and publishes records to an event bus."
33
author: "NHS Notify"
44

55
inputs:
@@ -9,11 +9,8 @@ inputs:
99
target-env:
1010
description: "Target environment label (e.g. draft/int/prod)"
1111
required: true
12-
table-name:
13-
description: "DynamoDB table name"
14-
required: true
15-
topic-arn:
16-
description: "ARN of SNS topic to publish events to"
12+
event-bus-name:
13+
description: "Name of event bus to publish to"
1714
required: true
1815
force:
1916
description: "Bypass audit safety checks"
@@ -27,26 +24,26 @@ inputs:
2724
runs:
2825
using: "composite"
2926
steps:
30-
- name: Resolve and download ddb-publish bundle
27+
- name: Resolve and download eventbridge-publish bundle
3128
shell: bash
3229
env:
3330
GH_TOKEN: ${{ github.token }}
3431
CALLER_REPO: ${{ github.repository }}
3532
ACTION_REPO: ${{ github.action_repository }}
3633
ACTION_REF: ${{ github.action_ref }}
37-
RELEASE_ASSET_NAME: ddb-publish-bundle.tgz
38-
WORKFLOW_ARTIFACT_NAME: ddb-publish-bundle
34+
RELEASE_ASSET_NAME: eventbridge-publish-bundle.tgz
35+
WORKFLOW_ARTIFACT_NAME: eventbridge-publish-bundle
3936
run: |
4037
set -euo pipefail
4138
42-
download_dir="${RUNNER_TEMP}/ddb-publish"
39+
download_dir="${RUNNER_TEMP}/eventbridge-publish"
4340
unpack_dir="${download_dir}/unpacked"
4441
4542
mkdir -p "${download_dir}" "${unpack_dir}"
4643
47-
echo "[ddb-publish] caller_repo=${CALLER_REPO}"
48-
echo "[ddb-publish] action_repo=${ACTION_REPO}"
49-
echo "[ddb-publish] action_ref=${ACTION_REF:-<empty>}"
44+
echo "[eventbridge-publish] caller_repo=${CALLER_REPO}"
45+
echo "[eventbridge-publish] action_repo=${ACTION_REPO}"
46+
echo "[eventbridge-publish] action_ref=${ACTION_REF:-<empty>}"
5047
5148
if [[ -z "${ACTION_REF}" ]]; then
5249
echo "ERROR: github.action_ref is empty; unable to locate release asset or branch artifact." >&2
@@ -60,22 +57,22 @@ runs:
6057
6158
# Prefer release assets when the action ref is a tag with a matching release in the action repo.
6259
if gh release view "${ACTION_REF}" --repo "${ACTION_REPO}" >/dev/null 2>&1; then
63-
echo "[ddb-publish] Found release for ref '${ACTION_REF}' in '${ACTION_REPO}'. Downloading '${RELEASE_ASSET_NAME}'."
60+
echo "[eventbridge-publish] Found release for ref '${ACTION_REF}' in '${ACTION_REPO}'. Downloading '${RELEASE_ASSET_NAME}'."
6461
gh release download "${ACTION_REF}" --repo "${ACTION_REPO}" --pattern "${RELEASE_ASSET_NAME}" --dir "${download_dir}"
6562
tar -xzf "${download_dir}/${RELEASE_ASSET_NAME}" -C "${unpack_dir}"
66-
echo "[ddb-publish] Bundle extracted from release asset."
63+
echo "[eventbridge-publish] Bundle extracted from release asset."
6764
exit 0
6865
fi
6966
7067
# Otherwise treat the ref as a branch-like ref and fetch the latest successful CI artifact from the action repo.
7168
branch="${ACTION_REF#refs/heads/}"
72-
echo "[ddb-publish] No release found for ref '${ACTION_REF}'. Falling back to latest workflow artifact on branch '${branch}' from '${ACTION_REPO}'."
69+
echo "[eventbridge-publish] No release found for ref '${ACTION_REF}'. Falling back to latest workflow artifact on branch '${branch}' from '${ACTION_REPO}'."
7370
7471
run_id=""
7572
workflow_used=""
7673
7774
for workflow_file in "stage-3-build.yaml" "cicd-1-pull-request.yaml"; do
78-
echo "[ddb-publish] Looking for successful runs in workflow '${workflow_file}'."
75+
echo "[eventbridge-publish] Looking for successful runs in workflow '${workflow_file}'."
7976
8077
set +e
8178
run_id_candidate="$(gh run list \
@@ -84,18 +81,18 @@ runs:
8481
--branch "${branch}" \
8582
--status success \
8683
--json databaseId \
87-
--jq '.[0].databaseId' 2>/tmp/ddb_publish_run_list_err.log)"
84+
--jq '.[0].databaseId' 2>/tmp/eventbridge_publish_run_list_err.log)"
8885
rc=$?
8986
set -e
9087
9188
if [[ $rc -ne 0 ]]; then
92-
if grep -q "HTTP 404" /tmp/ddb_publish_run_list_err.log; then
93-
echo "[ddb-publish] Workflow '${workflow_file}' not found on default branch; trying next workflow candidate."
89+
if grep -q "HTTP 404" /tmp/eventbridge_publish_run_list_err.log; then
90+
echo "[eventbridge-publish] Workflow '${workflow_file}' not found on default branch; trying next workflow candidate."
9491
continue
9592
fi
9693
9794
echo "ERROR: Failed to query workflow runs from '${ACTION_REPO}' for workflow '${workflow_file}'." >&2
98-
cat /tmp/ddb_publish_run_list_err.log >&2 || true
95+
cat /tmp/eventbridge_publish_run_list_err.log >&2 || true
9996
echo "HINT: ensure the token has read access to '${ACTION_REPO}' and workflow permissions allow actions read." >&2
10097
exit 1
10198
fi
@@ -112,7 +109,7 @@ runs:
112109
exit 1
113110
fi
114111
115-
echo "[ddb-publish] Downloading artifact '${WORKFLOW_ARTIFACT_NAME}' from workflow run ${run_id} (${workflow_used}) in '${ACTION_REPO}'."
112+
echo "[eventbridge-publish] Downloading artifact '${WORKFLOW_ARTIFACT_NAME}' from workflow run ${run_id} (${workflow_used}) in '${ACTION_REPO}'."
116113
gh run download "${run_id}" --repo "${ACTION_REPO}" --name "${WORKFLOW_ARTIFACT_NAME}" --dir "${download_dir}"
117114
118115
tarball_path="${download_dir}/${RELEASE_ASSET_NAME}"
@@ -123,22 +120,22 @@ runs:
123120
fi
124121
125122
tar -xzf "${tarball_path}" -C "${unpack_dir}"
126-
echo "[ddb-publish] Bundle extracted from workflow artifact."
123+
echo "[eventbridge-publish] Bundle extracted from workflow artifact."
127124
128125
- name: Run publisher
129126
shell: bash
130127
run: |
131128
set -euo pipefail
132129
133-
echo "[ddb-publish] Starting publish run"
134-
echo "[ddb-publish] source='${{ inputs.source-path }}' env='${{ inputs.target-env }}' table='${{ inputs.table-name }}' force='${{ inputs.force }}' dry-run='${{ inputs.dry-run }}'"
130+
echo "[eventbridge-publish] Starting publish run"
131+
echo "[eventbridge-publish] source='${{ inputs.source-path }}' env='${{ inputs.target-env }}' table='${{ inputs.table-name }}' force='${{ inputs.force }}' dry-run='${{ inputs.dry-run }}'"
135132
136-
node "${RUNNER_TEMP}/ddb-publish/unpacked/index.cjs" \
133+
node "${RUNNER_TEMP}/eventbridge-publish/unpacked/index.cjs" \
137134
--source "${{ inputs.source-path }}" \
138135
--env "${{ inputs.target-env }}" \
139136
--table "${{ inputs.table-name }}" \
140137
--topic-arn ${{ inputs.topic-arn }} \
141138
$([[ "${{ inputs.force }}" == "true" ]] && echo "--force") \
142139
$([[ "${{ inputs.dry-run }}" == "true" ]] && echo "--dry-run")
143140
144-
echo "[ddb-publish] Publish run completed"
141+
echo "[eventbridge-publish] Publish run completed"

0 commit comments

Comments
 (0)