Skip to content

Comments

Refactor workflow concurrency group and consolidate branch validation#207

Draft
Copilot wants to merge 12 commits intomk/dev/change_trigger_branchfrom
copilot/sub-pr-201
Draft

Refactor workflow concurrency group and consolidate branch validation#207
Copilot wants to merge 12 commits intomk/dev/change_trigger_branchfrom
copilot/sub-pr-201

Conversation

Copy link

Copilot AI commented Jan 27, 2026

Summary

Improves GitHub Actions workflow maintainability by refactoring complex branch matching logic into more readable formats and consolidating duplicated validation patterns.

Concurrency group refactoring:

  • Reformatted single-line expression into multi-line structure with clear logical grouping
  • Used contains(fromJson()) for exact branch matching, startsWith() for pattern matching

Branch validation consolidation:

  • Replaced three separate branch conditions with single regex pattern: '^(ionos-dev|ionos-stable)$|^rc/.*$'
  • Reduces duplication across lines 54, 147-149, 686, 929 (bash validation only)

Before:

if [ "${{ github.ref_name }}" != "ionos-dev" ] && \
   [ "${{ github.ref_name }}" != "ionos-stable" ] && \
   [[ ! "${{ github.ref_name }}" =~ ^rc/ ]]; then

After:

VALID_BRANCH_PATTERN='^(ionos-dev|ionos-stable)$|^rc/.*$'
if [[ ! "${{ github.ref_name }}" =~ $VALID_BRANCH_PATTERN ]]; then

TODO

  • Refactor concurrency group for readability
  • Consolidate branch validation logic
  • Validate workflow syntax

Checklist


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

printminion-co and others added 8 commits January 27, 2026 11:06
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
in order to extend it later

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Update trigger-remote-dev-workflow to target the main branch
in GitLab for branch types (ionos-dev, ionos-stable).

This aligns with the GitLab repository structure where main
is the target branch for container image builds.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Add full CI/CD pipeline support for release candidate (rc/*) branches
across all workflow stages:

Workflow Triggers:
- Add 'rc/**' pattern to push trigger branches
- Update concurrency group to prevent rc/* builds from interfering

Branch Validation:
- Extend configuration check to recognize rc/* as valid trigger branch
- Update validation messages to include rc/* in expected patterns

Artifactory Integration:
- Enable artifact upload for rc/* branches
- Create separate 'rc/' directory for rc/* build artifacts
- Set ARTIFACTORY_STAGE_PREFIX='rc' for proper organization

GitLab Pipeline Integration:
- Set BUILD_TYPE='rc' for rc/* branch builds
- Update trigger conditions to include rc/* branches
- Add rc/* to branch-to-GitLab mapping documentation table

This provides complete parity with ionos-dev and ionos-stable branches,
enabling proper release candidate workflow with isolated artifacts.
- Pull requests now properly cancel previous runs using explicit PR number
- ionos-dev, ionos-stable, and rc/* branches use unique run IDs (no cancellation)
- Each production branch build completes independently without cancellation
- Other branches continue to use ref-based grouping with cancellation

This ensures PR builds are cancelled on new pushes, while production
branch builds always complete to avoid losing build artifacts.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
- Add build-artifact to needs array to ensure NC_VERSION output is available
- Update if condition to verify both build-artifact and upload-to-artifactory succeeded
- Add comprehensive validation step that checks all required variables before triggering remote workflow
- Validates secrets (GITLAB_TOKEN, GITLAB_TRIGGER_URL)
- Validates job outputs (NC_VERSION, ARTIFACTORY_LAST_BUILD_PATH)
- Validates GitHub context variables (sha, run_id, ref_name)
- Abort with error if any required variable is missing

This prevents the remote workflow from being triggered with missing critical
variables like NC_VERSION, which was previously not available because
build-artifact was not in the needs array.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
- Change path from flat structure to versioned hierarchy with SHA
- For branches: use <stage>/ncw-<ncVersion>/<shortSha>/nextcloud-workspace-<ncVersion>.zip
- For PRs: keep simple dev/pr/nextcloud-workspace-pr-<number>.zip
- Extract short SHA (first 7 characters) from commit SHA

This ensures each build gets a unique path based on both NC version and commit,
preventing accidental reuse of artifacts built from different commits with
the same version number. Makes it easier to identify and trace artifacts
back to their source commit.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Copilot AI and others added 4 commits January 27, 2026 13:56
…ch validation

Co-authored-by: printminion-co <145785698+printminion-co@users.noreply.github.com>
Co-authored-by: printminion-co <145785698+printminion-co@users.noreply.github.com>
…horing

Co-authored-by: printminion-co <145785698+printminion-co@users.noreply.github.com>
…vior

Co-authored-by: printminion-co <145785698+printminion-co@users.noreply.github.com>
Copilot AI changed the title [WIP] Extend GitHub Actions to support RC branches Refactor workflow concurrency group and consolidate branch validation Jan 27, 2026
Copilot AI requested a review from printminion-co January 27, 2026 14:02
@printminion-co printminion-co force-pushed the mk/dev/change_trigger_branch branch 6 times, most recently from d3079aa to d00793e Compare January 27, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants