Skip to content

Fix tags naming convention#1128

Merged
stafot merged 1 commit intomasterfrom
CLD-9476-Fix-Latest-Tag-for-provisioner-auto-update-automation
Aug 7, 2025
Merged

Fix tags naming convention#1128
stafot merged 1 commit intomasterfrom
CLD-9476-Fix-Latest-Tag-for-provisioner-auto-update-automation

Conversation

@stafot
Copy link
Copy Markdown
Contributor

@stafot stafot commented Aug 7, 2025

Fix Docker image tagging for GitOps platform automation compatibility

Problem 🐛

When ARM support was added to the CI pipeline, the Docker image tagging convention was inadvertently changed, breaking the GitOps platform automation:

  • Before ARM support: Master merges created timestamp-based tags like test-20250708.141927
  • After ARM support: Master merges created a simple latest tag
  • Impact: GitOps automation scripts in gitops-platform repository could no longer find the latest provisioner images because they search for the pattern ^test-[0-9]{8}\.[0-9]{6}$

Root Cause Analysis 🔍

The issue was in .github/workflows/ci.yml where the create-manifest job was hardcoded to create latest tags for master merges:

elif [ "${{ github.ref }}" = "refs/heads/master" ]; then
  CLEAN_TAG="latest"  # ❌ This broke GitOps automation

The E2E images also used a static test tag instead of timestamp-based tags.

Solution ✅

Restored timestamp-based tagging for master merges while preserving ARM multi-arch support:

Main Provisioner Image (mattermost/mattermost-cloud)

  • Pull Requests: pr-{PR_NUMBER} (e.g., pr-1127)
  • Master Merges: test-YYYYMMDD.HHMMSS (e.g., test-20250106.164500)
  • Other branches: {branch_name}

E2E Image (mattermost/mattermost-cloud-e2e)

  • Pull Requests: test (static tag for testing)
  • Master Merges: test-YYYYMMDD.HHMMSS (same timestamp as main image)
  • Other branches: test (static tag)

Changes Made 🔧

  1. Modified main image tagging logic (lines 159-163):

    elif [ "${{ github.ref }}" = "refs/heads/master" ]; then
      # Create timestamp-based tag for master merges (format: test-YYYYMMDD.HHMMSS)
      TIMESTAMP=$(date -u +"%Y%m%d.%H%M%S")
      CLEAN_TAG="test-${TIMESTAMP}"
  2. Added conditional E2E image tagging (lines 272-281):

    if [ "${{ github.event_name }}" = "pull_request" ]; then
      E2E_TAG="test"
    elif [ "${{ github.ref }}" = "refs/heads/master" ]; then
      TIMESTAMP=$(date -u +"%Y%m%d.%H%M%S")
      E2E_TAG="test-${TIMESTAMP}"
    else
      E2E_TAG="test"
    fi

Benefits 🎯

  • Restores GitOps compatibility: Automation scripts work again without changes
  • Maintains date traceability: Can see exactly when each image was built
  • Preserves ARM support: Multi-arch images still work with timestamp tags
  • Consistent tagging: Both main and E2E images use the same timestamp format
  • Follows deployment best practices: Production builds only on master merges

Testing 🧪

  • Verify PR builds create pr-{number} tags
  • Verify master merge creates test-YYYYMMDD.HHMMSS tags for both images
  • Confirm GitOps automation can find and use the new timestamp tags
  • Validate multi-arch support still works correctly

Related Issues 📋

Fixes the GitOps platform automation failure where dev/test environment provisioner updates stopped working after ARM support was introduced.

Ticket Link

Release Note

NONE

Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
@mm-cloud-bot mm-cloud-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Aug 7, 2025
Copy link
Copy Markdown
Contributor

@gabrieljackson gabrieljackson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@stafot stafot merged commit bbc07c3 into master Aug 7, 2025
12 checks passed
@stafot stafot deleted the CLD-9476-Fix-Latest-Tag-for-provisioner-auto-update-automation branch August 7, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note-none Denotes a PR that doesn't merit a release note.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants