From 01e65b0e7f5af044b9f469817ec047fe6df9c2b7 Mon Sep 17 00:00:00 2001 From: lapenna-bjss Date: Wed, 6 May 2026 17:33:45 +0100 Subject: [PATCH 1/2] CCM-17605: add optional shard count input --- .../scripts/dispatch_internal_repo_workflow.sh | 16 +++++++++++++--- .../components/examplecomponent/pre.sh.disabled | 6 ++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/scripts/dispatch_internal_repo_workflow.sh b/.github/scripts/dispatch_internal_repo_workflow.sh index 6edddf9a..771804ab 100755 --- a/.github/scripts/dispatch_internal_repo_workflow.sh +++ b/.github/scripts/dispatch_internal_repo_workflow.sh @@ -14,7 +14,8 @@ # --internalRef \ # --overrides \ # --overrideProjectName \ -# --overrideRoleName +# --overrideRoleName \ +# --shardCount # # All arguments are required except terraformAction, and internalRef. @@ -30,7 +31,8 @@ # --internalRef "main" \ # --overrides "tf_var=someString" \ # --overrideProjectName nhs \ -# --overrideRoleName nhs-service-iam-role +# --overrideRoleName nhs-service-iam-role \ +# --shardCount "6" set -e @@ -48,7 +50,8 @@ Usage: [--internalRef ] \ [--overrides ] \ [--overrideProjectName ] \ - [--overrideRoleName ] + [--overrideRoleName ] \ + [--shardCount ] EOF return 0 } @@ -112,6 +115,10 @@ while [[ $# -gt 0 ]]; do overrideRoleName="$2" shift 2 ;; + --shardCount) # Number of parallel shards to split tests across (optional) + shardCount="$2" + shift 2 + ;; *) echo "[ERROR] Unknown argument: $1" >&2 exit 1 @@ -208,6 +215,7 @@ echo " internalRef: $internalRef" echo " overrides: $overrides" echo " overrideProjectName: $overrideProjectName" echo " overrideRoleName: $overrideRoleName" +echo " shardCount: ${shardCount:-}" DISPATCH_EVENT=$(jq -ncM \ --arg internalRef "$internalRef" \ @@ -221,6 +229,7 @@ DISPATCH_EVENT=$(jq -ncM \ --arg overrides "$overrides" \ --arg overrideProjectName "$overrideProjectName" \ --arg overrideRoleName "$overrideRoleName" \ + --arg shardCount "${shardCount:-}" \ '{ "ref": $internalRef, "inputs": ( @@ -228,6 +237,7 @@ DISPATCH_EVENT=$(jq -ncM \ (if $terraformAction != "" then { "terraformAction": $terraformAction } else {} end) + (if $overrideProjectName != "" then { "overrideProjectName": $overrideProjectName } else {} end) + (if $overrideRoleName != "" then { "overrideRoleName": $overrideRoleName } else {} end) + + (if $shardCount != "" then { "shardCount": $shardCount } else {} end) + { "releaseVersion": $releaseVersion, "targetEnvironment": $targetEnvironment, diff --git a/infrastructure/terraform/components/examplecomponent/pre.sh.disabled b/infrastructure/terraform/components/examplecomponent/pre.sh.disabled index f34040cf..22cb8a6c 100755 --- a/infrastructure/terraform/components/examplecomponent/pre.sh.disabled +++ b/infrastructure/terraform/components/examplecomponent/pre.sh.disabled @@ -28,6 +28,12 @@ echo "COMPONENT=$COMPONENT" echo "AWS_REGION=$REGION" echo "AWS_ACCOUNT_ID=$AWS_ACCOUNT_ID" +# No build steps required for output action +if [ "${ACTION}" = "output" ]; then + echo "ACTION=output: skipping build and dependency steps." + return 0 +fi + # Calculate container image prefix from PROJECT, ENVIRONMENT, COMPONENT CONTAINER_IMAGE_PREFIX="${PROJECT}-${ENVIRONMENT}-${COMPONENT}" echo "CONTAINER_IMAGE_PREFIX: ${CONTAINER_IMAGE_PREFIX}" From f285fa959bfef1c08ee955d72be93fc5f0a1abd7 Mon Sep 17 00:00:00 2001 From: lapenna-bjss Date: Thu, 7 May 2026 09:18:56 +0100 Subject: [PATCH 2/2] CCM-17605: change the shard count example to 4 --- .github/scripts/dispatch_internal_repo_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/dispatch_internal_repo_workflow.sh b/.github/scripts/dispatch_internal_repo_workflow.sh index 771804ab..c898894f 100755 --- a/.github/scripts/dispatch_internal_repo_workflow.sh +++ b/.github/scripts/dispatch_internal_repo_workflow.sh @@ -32,7 +32,7 @@ # --overrides "tf_var=someString" \ # --overrideProjectName nhs \ # --overrideRoleName nhs-service-iam-role \ -# --shardCount "6" +# --shardCount "4" set -e