IONOS(ci): trigger artifactory/ghcr.io/remote-trigger jobs on per-major dev/stable branches - #322
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the HiDrive Next workflow to support per-major IONOS branches for artifact publishing and controlled remote triggers.
Changes:
- Enables artifact uploads for
ionos-dev-v*andionos-stable-v*. - Adds configurable NC-version and RC-branch trigger gates.
- Updates stable mappings and diagnostic checks.
Suppressed comments (3)
.github/workflows/hidrive-next-build.yml:994
- The suffix check is applied to every non-
*/dev/*branch, includingrc/*. WithREMOTE_TRIGGER_NC_VERSION=v33, an RC branch such asrc/web-v33passes this condition even when it differs fromREMOTE_TRIGGER_RC_BRANCH, defeating the documented exact-RC whitelist. Restrict the suffix alternative toionos-dev-v*/ionos-stable-v*(or compare those branch names exactly), leaving RC branches to the exact whitelist check.
endsWith(github.ref_name, vars.REMOTE_TRIGGER_NC_VERSION) ||
github.ref_name == vars.REMOTE_TRIGGER_RC_BRANCH)
.github/workflows/hidrive-next-build.yml:817
workflow_dispatchis allowed independently of the branch name, so a manual run from a branch such asionos-stable-hotfixreaches this mapping. The broadionos-stable*match then publishes that branch under thestableArtifactory prefix, although the accepted stable lanes elsewhere are onlyionos-stableandionos-stable-v*; this can contaminate the stable artifact namespace. Match the bare lane and the-v*lanes explicitly.
elif [[ "${{ github.ref_name }}" == ionos-stable* ]]; then
.github/workflows/hidrive-next-build.yml:725
- The upload job's header comment immediately above still lists only the bare
ionos-dev/ionos-stablelanes,rc/*, and*/dev/*, but this new condition also runs forionos-dev-v*andionos-stable-v*. Update the comment so the documented upload behavior matches the condition.
startsWith(github.ref_name, 'ionos-dev-') || startsWith(github.ref_name, 'ionos-stable-') ||
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.github/workflows/hidrive-next-build.yml:215
- The configuration diagnostic has the same ordering problem: an empty NC variable exits this gate before
REMOTE_TRIGGER_RC_BRANCHis checked, so it reports that every RC branch will trigger even when an RC whitelist is configured. Keep the diagnostic split by branch class and mirror the job-level NC/RC checks.
elif [ -z "$NC_VERSION" ]; then
echo "- ✅ Version gate: not set — all versions allowed" >> $GITHUB_STEP_SUMMARY
echo " ✅ Version gate: not set — all versions allowed"
elif [[ "$BRANCH" == ionos-dev-v* || "$BRANCH" == ionos-stable-v* ]] && [[ "$BRANCH" == *"$NC_VERSION" ]]; then
.github/workflows/hidrive-next-build.yml:999
- When
REMOTE_TRIGGER_NC_VERSIONis empty butREMOTE_TRIGGER_RC_BRANCHis set, this disjunct is true for every branch, soREMOTE_TRIGGER_RC_BRANCHcannot whitelist a singlerc/*branch. Evaluate the NC variable only forionos-*-v*branches and giverc/*its own empty-or-exact RC whitelist check.
vars.REMOTE_TRIGGER_NC_VERSION == '' ||
((startsWith(github.ref_name, 'ionos-dev-v') || startsWith(github.ref_name, 'ionos-stable-v')) &&
endsWith(github.ref_name, vars.REMOTE_TRIGGER_NC_VERSION)) ||
github.ref_name == vars.REMOTE_TRIGGER_RC_BRANCH)
…or dev/stable branches The 'upload-to-artifactory', 'hidirve-next-artifact-to-ghcr_io', and 'trigger-remote-dev-workflow' jobs were being silently skipped on ionos-dev-v33/ionos-stable-v33 pushes: on.push.branches already covers these branches (HDNEXT-2144), so the build itself runs, but the downstream jobs' if: conditions were never updated to match — they only checked for the bare 'ionos-dev'/'ionos-stable' names, 'rc/*', and '*/dev/*'. Port the mature whitelist-gate pattern from ionos-dev-v31: broad startsWith branch matching for the artifact jobs, plus an opt-in REMOTE_TRIGGER_NC_VERSION/REMOTE_TRIGGER_RC_BRANCH gate on the GitLab-trigger job so QA deployment can later be restricted to one NC major/RC at a time (both variables are currently unset repo-wide, so this gate is a no-op today). Scope the NC-version suffix check to ionos-dev-v*/ionos-stable-v* branches only: it was otherwise evaluated for any branch reaching that point, including rc/*, so an rc/* branch whose name happened to end with the whitelisted NC version string would incorrectly pass the gate and bypass the intended exact REMOTE_TRIGGER_RC_BRANCH whitelist match. Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
e789c25 to
bd3db78
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
.github/workflows/hidrive-next-build.yml:215
[[ ... == *"$NC_VERSION" ]]tests only a suffix, so a whitelist ofv33also accepts a valid-looking branch such asionos-dev-v133orionos-stable-v133. This defeats the one-major gate; compare the branch to the exactionos-{dev,stable}-$NC_VERSIONforms (or otherwise enforce a delimiter).
elif [[ "$BRANCH" == ionos-dev-v* || "$BRANCH" == ionos-stable-v* ]] && [[ "$BRANCH" == *"$NC_VERSION" ]]; then
| if [ "$BRANCH" == "ionos-dev" ] || [ "$BRANCH" == "ionos-stable" ]; then | ||
| echo "- ✅ Version gate: '$BRANCH' is always exempt" >> $GITHUB_STEP_SUMMARY | ||
| echo " ✅ Version gate: '$BRANCH' is always exempt" | ||
| elif [ -z "$NC_VERSION" ]; then |
Summary
ionos-dev-v33(and allionos-dev-v*/ionos-stable-v*per-major branches) already trigger the workflow viaon.push.branches, but three downstream job-levelif:conditions still only matched the bareionos-dev/ionos-stablenames — soupload-to-artifactory,hidirve-next-artifact-to-ghcr_io, andtrigger-remote-dev-workflowwere silently skipped (confirmed on run 32494139570).ionos-dev-v30/ionos-dev-v31(lost whenv32/v33were rewritten with the matrix-cache pipeline), adapted to this file's generic glob style:startsWith(ref_name, 'ionos-dev-'/'ionos-stable-').ARTIFACTORY_STAGE_PREFIX/BUILD_TYPEshell mappings now glob-matchionos-stable*instead of the exact string.trigger-remote-dev-workflownow also matchesionos-dev-v*/ionos-stable-v*, gated by an opt-inREMOTE_TRIGGER_NC_VERSION/REMOTE_TRIGGER_RC_BRANCHwhitelist (mirroring v31) so QA deployment can later be restricted to one NC major/RC at a time. Both vars are currently unset repo-wide, so this gate is a no-op today. Bareionos-dev/ionos-stableare always exempt.ionos-dev,ionos-stable,ionos-dev-v30,ionos-dev-v31behavior.ionos-dev-v32.Test plan
python3 -c "import yaml; yaml.safe_load(...)".ionos-dev-v33and confirmPush to artifactory,Push artifact to ghcr.io, andTrigger remote workflowall run (or skip only for pre-existing reasons, never a branch-name mismatch).ionos-dev/ionos-stable/rc/*/*/dev/*behavior is unchanged.