Skip to content

Commit d843030

Browse files
spboltonclaude
andauthored
fix(ci): [DEFECT] Manual deploy workflow cicd_8manualdeploy (#34689) (#34699)
## Description Fix the `cicd_8-manual-deploy.yml` workflow that was failing with invalid input parameters, and improve CI/CD infrastructure consistency across all workflows: run-name visibility, Docker image tag architecture, nightly build repeatability and tag ordering, and CLI artifact deployment control. ## Changes ### Bug Fixes (cicd_8 manual deploy) - **Fix invalid inputs**: use `change-detection='disabled'` instead of the invalid `validation-level='none'` - **Make `ref` input optional**: defaults to the dispatch branch, preserving legacy behavior and fixing the concurrency group fallback when `ref` is empty ### Run-Name Improvements (all workflows) - **Add `run-name` to all CI/CD workflows** (`cicd_1` through `cicd_8`) so every run is identifiable in the GitHub Actions UI without opening it - **Fix expression syntax**: switch run-name YAML strings from single-quoted to double-quoted so that GitHub Actions expression parser receives properly single-quoted string literals inside `${{ }}` — fixes `Unexpected symbol: '"' in expression` validation error (cicd_3, cicd_4, cicd_6, cicd_7, cicd_8) - **Always show ref in manual deploy run-name**: fall back to `github.ref_name` when the `ref` input is empty, so the run name is always `Manual [branch-name]` rather than just `Manual` ### Nightly Build Repeatability (cicd_4) - **New `setup` job** that determines the commit to build from before any other jobs run - **Default behavior (scheduled and manual dispatch)**: finds the last commit on `main` at or before midnight UTC. This ensures repeatability — re-running a nightly later in the day to investigate a failure produces the exact same build as the scheduled run. The date tag (`nightly_YYYYMMDD`) labels the day covered (yesterday), not the day the workflow runs. - **New `use-latest-commit` dispatch input**: set to `true` to build from the current `HEAD` of `main` instead, useful when you need to pick up commits made after midnight - **All downstream jobs** (`build`, `deployment`, `finalize`) now depend on `setup` and pass through its `build-ref` and `tag-date` outputs ### Docker Image Tag Architecture (nightly + all builds) - **Redesign tag inputs on `deploy-docker` action**: replace raw `type=raw,value=...,enable=` format strings with semantic `identifier-tag` / `custom-tag` inputs — callers express intent, not bake-meta syntax - **Centralize tag computation**: `Compute Docker Tags` step consolidates all tag logic in clear bash `if/else`, replacing the previous `Compute Docker Base Tag` + scattered `enable=` expressions - **Fix tag ordering**: identifier appears before suffix (`nightly_20250218_java25`, not `nightly_java25_20250218`), consistent with the release pattern - **Retain `extra-tags`** as an escape hatch for advanced cases ### CLI Artifact Deployment Control - **Add `deploy-cli` boolean input** to the deployment phase composite workflow (default: `false`); replaces the previous hardcoded `environment != 'manual'` name check - **Explicit opt-in pattern**: trunk, nightly, and release callers set `deploy-cli: true`; manual deploys omit it and default to `false`, preventing accidental JFrog publishes from feature-branch builds — mirrors the same pattern used by `publish-npm-cli` and `publish-npm-sdk-libs` - **Restore `publish-npm-sdk-libs`** condition to input-only guard (environment hardcoding removed) ### Miscellaneous - **Remove dead code**: `reuse-previous-build` removed from all deployment-phase calls (only meaningful in the initialize phase) - **Remove stale `java_version` default** from `cicd_7-release-java-variant` dispatch input (`'25.0.1-open'` was outdated); update description to reference the `RELEASE_JAVA_VARIANT_VERSION` repository variable used by push-triggered builds ## Files Changed | File | What changed | |------|-------------| | `.github/actions/core-cicd/deployment/deploy-docker/action.yml` | New `identifier-tag`/`custom-tag` inputs; centralized tag computation | | `.github/workflows/cicd_1-pr.yml` | Add `run-name` | | `.github/workflows/cicd_2-merge-queue.yml` | Add `run-name` | | `.github/workflows/cicd_3-trunk.yml` | Add `run-name` (fixed quotes); add `deploy-cli: true` | | `.github/workflows/cicd_4-nightly.yml` | Add `setup` job for commit pinning; add `use-latest-commit` input; add `run-name` (fixed quotes); fix tag ordering; add `deploy-cli: true` | | `.github/workflows/cicd_6-release.yml` | Fix `run-name` quotes; add `deploy-cli: true` | | `.github/workflows/cicd_7-release-java-variant.yml` | Fix `run-name` quotes; remove stale `java_version` default | | `.github/workflows/cicd_8-manual-deploy.yml` | Fix invalid inputs; make `ref` optional; fix `run-name` always shows ref | | `.github/workflows/cicd_comp_deployment-phase.yml` | Add `deploy-cli` input; replace env-name guard with input guard | | `.github/workflows/cicd_comp_initialize-phase.yml` | Minor cleanup | ## Testing - Workflow YAML validates on push (GitHub Actions schema validation) - Manual deploy workflow (`cicd_8`) can be triggered successfully end-to-end - Docker tags produced with correct naming pattern and ordering - `run-name` displays correctly in GitHub Actions UI for all workflow types - CLI artifacts are not published when running manual/feature-branch builds - Nightly default behavior pins to the midnight UTC commit, not current HEAD Closes #34689 **Issue:** [DEFECT] Manual deploy workflow cicd_8manualdeploy --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 651a052 commit d843030

9 files changed

Lines changed: 429 additions & 128 deletions

File tree

.github/actions/core-cicd/deployment/deploy-docker/action.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ inputs:
2222
description: 'The commit id that triggered the build'
2323
required: true
2424
ref:
25-
description: 'The branch or type of build to tag the image with'
26-
required: true
25+
description: 'The branch or type of build to tag the image with. Only used when docker-use-ref is true; when docker-use-ref is false the version input drives all tags and this is ignored.'
26+
required: false
27+
default: ''
2728
docker-use-ref:
2829
description: 'The branch or type of build to tag the image with'
2930
required: false
@@ -65,6 +66,18 @@ inputs:
6566
description: 'Pull image before building'
6667
required: false
6768
default: 'false'
69+
identifier-tag:
70+
description: 'Optional mutable alias tag managed by the deployment phase (e.g., nightly_20250218_java25, manual_issue-123_java25). Applied when non-empty.'
71+
required: false
72+
default: ''
73+
custom-tag:
74+
description: 'Optional custom alias tag chosen by the developer (e.g., modernization, java25-testing). Applied when non-empty.'
75+
required: false
76+
default: ''
77+
extra-tags:
78+
description: 'Escape hatch: additional tags in docker/metadata-action format (type=raw,value=...), one per line. Use for cases not covered by identifier-tag or custom-tag.'
79+
required: false
80+
default: ''
6881
outputs:
6982
tags:
7083
description: "The tags that were used to build the image"
@@ -104,6 +117,9 @@ runs:
104117
REF: ${{ inputs.ref }}
105118
USE_REF: ${{ inputs.docker-use-ref }}
106119
VERSION: ${{ inputs.version }}
120+
IDENTIFIER_TAG: ${{ inputs.identifier-tag }}
121+
CUSTOM_TAG: ${{ inputs.custom-tag }}
122+
EXTRA_TAGS: ${{ inputs.extra-tags }}
107123
run: |
108124
109125
# Set defaults for flags
@@ -137,6 +153,13 @@ runs:
137153
echo "type=raw,value=${RESULT}_{{sha}},enable=true" >> $GITHUB_ENV
138154
echo "type=raw,value=${RESULT},enable=true" >> $GITHUB_ENV
139155
echo "type=raw,value=latest,enable=${enable_latest}" >> $GITHUB_ENV
156+
[[ -n "${IDENTIFIER_TAG}" ]] && echo "type=raw,value=${IDENTIFIER_TAG},enable=true" >> $GITHUB_ENV
157+
[[ -n "${CUSTOM_TAG}" ]] && echo "type=raw,value=${CUSTOM_TAG},enable=true" >> $GITHUB_ENV
158+
if [[ -n "${EXTRA_TAGS}" ]]; then
159+
while IFS= read -r tag_line; do
160+
[[ -n "${tag_line}" ]] && echo "${tag_line}" >> $GITHUB_ENV
161+
done <<< "${EXTRA_TAGS}"
162+
fi
140163
echo "EOF" >> $GITHUB_ENV
141164
- name: Docker.io login
142165
uses: docker/login-action@v3.0.0

.github/workflows/cicd_1-pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121

2222
name: '-1 PR Check'
23+
run-name: 'PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }} (@${{ github.event.pull_request.user.login }})'
2324

2425
on:
2526
pull_request:

.github/workflows/cicd_2-merge-queue.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: '-2 Merge Group Check'
2+
run-name: 'MQ: ${{ github.event.merge_group.head_commit.message }}'
23
on:
34
merge_group:
45
types: [ checks_requested ]

.github/workflows/cicd_3-trunk.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# - Final reporting of the workflow status
1212

1313
name: '-3 Trunk Workflow'
14+
run-name: "Trunk${{ inputs.java-version && format(' [{0}]', inputs.java-version) || '' }}"
1415

1516
on:
1617
push:
@@ -129,8 +130,10 @@ jobs:
129130
uses: ./.github/workflows/cicd_comp_deployment-phase.yml
130131
with:
131132
artifact-run-id: ${{ needs.initialize.outputs.artifact-run-id }}
133+
deploy-cli: true
132134
publish-npm-sdk-libs: ${{ fromJSON(needs.initialize.outputs.filters).sdk_libs == 'true' && github.event_name != 'workflow_dispatch' }}
133135
environment: trunk
136+
# tag-identifier intentionally omitted: trunk uses only the environment name as its tag
134137
java-version: ${{ github.event.inputs.java-version || '' }}
135138
artifact-suffix: ${{ github.event.inputs.artifact-suffix || '' }}
136139
secrets:

.github/workflows/cicd_4-nightly.yml

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@
1010
# - Optional NPM package publishing
1111
# - Deployment to the nightly environment
1212
# - Final reporting of the workflow status
13+
#
14+
# Commit pinning:
15+
# - Default (both scheduled and manual dispatch): builds from the last commit on main
16+
# at or before midnight UTC. This ensures repeatability — manually re-running the
17+
# nightly later in the day to investigate a failure produces the same build.
18+
# The date tag (nightly_YYYYMMDD) correctly labels the day covered, not the run day.
19+
# - Manual dispatch with use-latest-commit=true: builds from current HEAD of main,
20+
# useful when you want to pick up commits made after midnight.
1321

1422
name: '-4 Nightly Workflow'
23+
run-name: "Nightly${{ inputs.use-latest-commit && ' (HEAD)' || '' }}${{ inputs.java-version && format(' [{0}]', inputs.java-version) || '' }}"
1524

1625
on:
1726
schedule:
@@ -49,8 +58,57 @@ on:
4958
type: string
5059
required: false
5160
default: ''
61+
use-latest-commit:
62+
description: 'Use current HEAD of main instead of the midnight UTC commit. Set to true when you want to pick up commits made after midnight rather than reproduce the scheduled run.'
63+
type: boolean
64+
default: false
5265

5366
jobs:
67+
# Setup job - determines the commit to build from.
68+
# Default (scheduled and manual): last commit on main at or before midnight UTC for repeatability.
69+
# Manual with use-latest-commit=true: current HEAD of main.
70+
setup:
71+
name: Setup
72+
runs-on: ubuntu-${{ vars.UBUNTU_RUNNER_VERSION || '24.04' }}
73+
outputs:
74+
build-ref: ${{ steps.find-commit.outputs.build-ref }}
75+
tag-date: ${{ steps.find-commit.outputs.tag-date }}
76+
steps:
77+
- uses: actions/checkout@v4
78+
with:
79+
fetch-depth: 0
80+
ref: main
81+
82+
- name: Find Build Commit
83+
id: find-commit
84+
run: |
85+
if [[ "${{ inputs.use-latest-commit }}" == "true" ]]; then
86+
# Explicit override: use current HEAD of main.
87+
# Useful when you want to pick up commits made after midnight.
88+
BUILD_REF=$(git rev-parse HEAD)
89+
TAG_DATE=$(date -u +%Y%m%d)
90+
echo "use-latest-commit=true: building from current HEAD of main: ${BUILD_REF}"
91+
else
92+
# Default for both scheduled and manual dispatch: use the last commit
93+
# at or before midnight UTC. This ensures repeatability — manually
94+
# re-running later in the day to investigate a failure gives the same build.
95+
MIDNIGHT=$(date -u +"%Y-%m-%dT00:00:00")
96+
BUILD_REF=$(git log --before="${MIDNIGHT}" --format="%H" -1)
97+
if [[ -z "${BUILD_REF}" ]]; then
98+
# No commits before today's midnight — use the absolute last commit.
99+
# This handles edge cases (e.g., very new repos) without falling back to
100+
# current HEAD which might include post-midnight commits.
101+
BUILD_REF=$(git log --format="%H" -1)
102+
echo "⚠️ No commit found before ${MIDNIGHT}, using last available commit: ${BUILD_REF}"
103+
else
104+
echo "Building from commit at midnight UTC (${MIDNIGHT}): ${BUILD_REF}"
105+
fi
106+
# Tag with yesterday's date: the nightly covers the previous calendar day
107+
TAG_DATE=$(date -u -d "yesterday" +%Y%m%d)
108+
fi
109+
echo "build-ref=${BUILD_REF}" >> "$GITHUB_OUTPUT"
110+
echo "tag-date=${TAG_DATE}" >> "$GITHUB_OUTPUT"
111+
54112
# Initialize the nightly build process
55113
initialize:
56114
name: Initialize
@@ -64,10 +122,11 @@ jobs:
64122
# Build job - only runs if no artifacts were found during initialization
65123
build:
66124
name: Nightly Build
67-
needs: [ initialize ]
125+
needs: [ setup, initialize ]
68126
if: needs.initialize.outputs.found_artifacts == 'false'
69127
uses: ./.github/workflows/cicd_comp_build-phase.yml
70128
with:
129+
ref: ${{ needs.setup.outputs.build-ref }}
71130
java-version: ${{ github.event.inputs.java-version || '' }}
72131
maven-compiler-release: ${{ github.event.inputs.maven-compiler-release || '' }}
73132
artifact-suffix: ${{ github.event.inputs.artifact-suffix || '' }}
@@ -108,15 +167,16 @@ jobs:
108167

109168
# Deployment job - deploys to the nightly environment
110169
deployment:
111-
needs: [ initialize,build-cli,test ]
170+
needs: [ setup, initialize,build-cli,test ]
112171
if: always() && !failure() && !cancelled()
113172
uses: ./.github/workflows/cicd_comp_deployment-phase.yml
114173
with:
115174
artifact-run-id: ${{ needs.initialize.outputs.artifact-run-id }}
116175
environment: nightly
176+
tag-identifier: ${{ needs.setup.outputs.tag-date }}
177+
deploy-cli: true
117178
deploy-dev-image: true
118179
publish-npm-cli: ${{ ( github.event_name == 'workflow_dispatch' && inputs.publish-npm-cli == true ) || github.event_name == 'schedule' }}
119-
reuse-previous-build: ${{ inputs.reuse-previous-build || false }}
120180
java-version: ${{ github.event.inputs.java-version || '' }}
121181
artifact-suffix: ${{ github.event.inputs.artifact-suffix || '' }}
122182
secrets:
@@ -132,7 +192,7 @@ jobs:
132192
finalize:
133193
name: Finalize
134194
if: always()
135-
needs: [ initialize, build, build-cli, test, deployment ]
195+
needs: [ setup, initialize, build, build-cli, test, deployment ]
136196
uses: ./.github/workflows/cicd_comp_finalize-phase.yml
137197
with:
138198
artifact-run-id: ${{ needs.initialize.outputs.artifact-run-id }}

.github/workflows/cicd_6-release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#
1919

2020
name: '-6 Release Process'
21+
run-name: "Release ${{ inputs.release_version }}${{ inputs.java-version && format(' [{0}]', inputs.java-version) || '' }}"
2122

2223
on:
2324
workflow_dispatch:
@@ -116,11 +117,13 @@ jobs:
116117
if: always() && !failure() && !cancelled()
117118
uses: ./.github/workflows/cicd_comp_deployment-phase.yml
118119
with:
119-
environment: ${{ needs.release-prepare.outputs.release_version }}
120+
environment: 'release'
121+
tag-identifier: ${{ needs.release-prepare.outputs.release_version }}
122+
omit-environment-prefix: true
120123
artifact-run-id: ${{ github.run_id }}
121124
latest: ${{ needs.release-prepare.outputs.is_latest == 'true' }}
125+
deploy-cli: true
122126
deploy-dev-image: true
123-
reuse-previous-build: false
124127
publish-npm-cli: false
125128
publish-npm-sdk-libs: false
126129
java-version: ${{ github.event.inputs.java-version }}

.github/workflows/cicd_7-release-java-variant.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#
2929

3030
name: '-7 Release Java Variant'
31+
run-name: "Release Java Variant - ${{ github.event_name == 'workflow_dispatch' && inputs.release_branch || github.ref_name }}${{ inputs.java_version && format(' [{0}]', inputs.java_version) || '' }}"
3132

3233
on:
3334
push:
@@ -40,10 +41,10 @@ on:
4041
required: true
4142
type: string
4243
java_version:
43-
description: 'Java version to build (SDKMAN format, e.g., 25.0.1-open)'
44-
required: true
44+
description: 'Java version to build (SDKMAN format, e.g., 25.0.2-ms). Leave empty to use the RELEASE_JAVA_VARIANT_VERSION repository variable (same as push-triggered builds).'
45+
required: false
4546
type: string
46-
default: '25.0.1-open'
47+
default: ''
4748
artifact_suffix:
4849
description: 'Artifact suffix without leading separator (e.g., java25, java25-ms). Separators added automatically: dash (-) for Maven artifacts, underscore (_) for Docker tags. If not set, derived from java-version major (e.g., java25).'
4950
required: false
@@ -100,7 +101,7 @@ jobs:
100101
needs: [ extract-version ]
101102
uses: ./.github/workflows/cicd_comp_initialize-phase.yml
102103
with:
103-
validation-level: 'none'
104+
change-detection: 'disabled' # Release builds everything - no change detection needed
104105

105106
# Build - standard build phase with Java version override
106107
build:
@@ -127,7 +128,9 @@ jobs:
127128
if: always() && !failure() && !cancelled()
128129
uses: ./.github/workflows/cicd_comp_deployment-phase.yml
129130
with:
130-
environment: ${{ needs.extract-version.outputs.version }}
131+
environment: 'release'
132+
tag-identifier: ${{ needs.extract-version.outputs.version }}
133+
omit-environment-prefix: true
131134
artifact-run-id: ${{ github.run_id }}
132135
deploy-dev-image: true
133136
java-version: ${{ github.event_name == 'workflow_dispatch' && inputs.java_version || vars.RELEASE_JAVA_VARIANT_VERSION }}

0 commit comments

Comments
 (0)