Skip to content

Commit 6401482

Browse files
CCM-11942 Removal of jobid callerrunid
1 parent 5327d19 commit 6401482

File tree

4 files changed

+2
-28
lines changed

4 files changed

+2
-28
lines changed

.github/scripts/dispatch_internal_repo_workflow.sh

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
# Usage:
66
# ./dispatch_internal_repo_workflow.sh \
7-
# --jobName <name> \
87
# --infraRepoName <repo> \
98
# --releaseVersion <version> \
109
# --targetWorkflow <workflow.yaml> \
@@ -14,10 +13,9 @@
1413
# --terraformAction <action> \
1514
# --internalRef <ref>
1615
#
17-
# All arguments are required except jobName, terraformAction, and internalRef.
16+
# All arguments are required except terraformAction, and internalRef.
1817
# Example:
1918
# ./dispatch_internal_repo_workflow.sh \
20-
# --jobName "Deploy" \
2119
# --infraRepoName "nhs-notify-web-template-management" \
2220
# --releaseVersion "v1.2.3" \
2321
# --targetWorkflow "deploy.yaml" \
@@ -31,10 +29,6 @@ set -e
3129

3230
while [[ $# -gt 0 ]]; do
3331
case $1 in
34-
--jobName) # Name of the job triggering the remote workflow (optional)
35-
jobName="$2"
36-
shift 2
37-
;;
3832
--infraRepoName) # Name of the infrastructure repo in NHSDigital org (required)
3933
infraRepoName="$2"
4034
shift 2
@@ -84,10 +78,6 @@ if [[ -z "$PR_TRIGGER_PAT" ]]; then
8478
exit 1
8579
fi
8680

87-
if [[ -z "$jobName" ]]; then
88-
jobName="${infraRepoName}-${targetComponent}-${terraformAction}"
89-
fi
90-
9181
if [[ -z "$overrides" ]]; then
9282
overrides=""
9383
fi
@@ -97,7 +87,6 @@ if [[ -z "$internalRef" ]]; then
9787
fi
9888

9989
echo "==================== Workflow Dispatch Parameters ===================="
100-
echo " jobName: $jobName"
10190
echo " infraRepoName: $infraRepoName"
10291
echo " releaseVersion: $releaseVersion"
10392
echo " targetWorkflow: $targetWorkflow"
@@ -108,16 +97,13 @@ echo " terraformAction: $terraformAction"
10897
echo " internalRef: $internalRef"
10998
echo " overrides: $overrides"
11099

111-
callerRunId="${GITHUB_RUN_ID}-${jobName}-${GITHUB_RUN_ATTEMPT}"
112-
113100
DISPATCH_EVENT=$(jq -ncM \
114101
--arg infraRepoName "$infraRepoName" \
115102
--arg releaseVersion "$releaseVersion" \
116103
--arg targetEnvironment "$targetEnvironment" \
117104
--arg targetAccountGroup "$targetAccountGroup" \
118105
--arg targetComponent "$targetComponent" \
119106
--arg terraformAction "$terraformAction" \
120-
--arg callerRunId "$callerRunId" \
121107
--arg targetWorkflow "$targetWorkflow" \
122108
--arg overrides "$overrides" \
123109
'{
@@ -131,9 +117,7 @@ DISPATCH_EVENT=$(jq -ncM \
131117
"targetAccountGroup": $targetAccountGroup,
132118
"targetComponent": $targetComponent,
133119
"overrides": $overrides,
134-
} +
135-
(if ($targetWorkflow | test("dispatch-(acceptance|contextual|product|security)-tests-.*\\.yaml"))
136-
then { "callerRunId": $callerRunId } else {} end)
120+
}
137121
)
138122
}')
139123

@@ -175,7 +159,6 @@ for _ in {1..18}; do
175159
fi
176160

177161
workflow_run_url=$(echo "$response" | jq -r \
178-
--arg callerRunId "$callerRunId" \
179162
--arg targetWorkflow "$targetWorkflow" \
180163
--arg targetEnvironment "$targetEnvironment" \
181164
--arg targetAccountGroup "$targetAccountGroup" \
@@ -189,10 +172,6 @@ for _ in {1..18}; do
189172
and contains($targetComponent)
190173
and contains($terraformAction)
191174
)
192-
| if ($targetWorkflow | test("dispatch-(acceptance|contextual|product|security)-tests-.*\\.yaml"))
193-
then select(.name | contains("caller:" + $callerRunId))
194-
else .
195-
end
196175
| .url')
197176

198177
if [[ -n "$workflow_run_url" && "$workflow_run_url" != null ]]; then

.github/workflows/pr_create_dynamic_env.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
shell: bash
2525
run: |
2626
.github/scripts/dispatch_internal_repo_workflow.sh \
27-
--jobName "Create PR Dynamic Environment" \
2827
--infraRepoName "$(echo ${{ github.repository }} | cut -d'/' -f2)" \
2928
--releaseVersion "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" \
3029
--targetWorkflow "dispatch-deploy-dynamic-env.yaml" \

.github/workflows/pr_destroy_dynamic_env.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
shell: bash
2626
run: |
2727
.github/scripts/dispatch_internal_repo_workflow.sh \
28-
--jobName "Destroy PR Dynamic Environment" \
2928
--infraRepoName "$(echo ${{ github.repository }} | cut -d'/' -f2)" \
3029
--releaseVersion "main" \
3130
--targetWorkflow "dispatch-deploy-dynamic-env.yaml" \
@@ -46,7 +45,6 @@ jobs:
4645
PR_TRIGGER_PAT: ${{ secrets.PR_TRIGGER_PAT }}
4746
run: |
4847
.github/scripts/dispatch_internal_repo_workflow.sh \
49-
--jobName "Sandbox tear down" \
5048
--infraRepoName "nhs-notify-web-template-management" \
5149
--releaseVersion "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" \
5250
--targetWorkflow "dispatch-deploy-dynamic-env.yaml" \

.github/workflows/stage-4-acceptance.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
PR_TRIGGER_PAT: ${{ secrets.PR_TRIGGER_PAT }}
2626
run: |
2727
.github/scripts/dispatch_internal_repo_workflow.sh \
28-
--jobName "Create PR Sandbox " \
2928
--infraRepoName "nhs-notify-web-template-management" \
3029
--releaseVersion "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" \
3130
--targetWorkflow "dispatch-deploy-dynamic-env.yaml" \
@@ -40,7 +39,6 @@ jobs:
4039
PR_TRIGGER_PAT: ${{ secrets.PR_TRIGGER_PAT }}
4140
run: |
4241
.github/scripts/dispatch_internal_repo_workflow.sh \
43-
--jobName "Acceptance tests" \
4442
--infraRepoName "nhs-notify-web-template-management" \
4543
--releaseVersion "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" \
4644
--targetWorkflow "dispatch-contextual-tests-dynamic-env.yaml" \

0 commit comments

Comments
 (0)