-
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
π― Problem Statement
The current latest-{sha} flow naming is semantically confusing in modern CI/CD pipelines. When code is pushed to the main branch, it generates images tagged as latest-{sha}, but these are not production-ready "latest" releasesβthey're pre-production staging images awaiting validation before a manual release.
This naming creates confusion about which images are production-ready versus pre-production staging.
π‘ Proposed Solution
Rename the latest flow type to staging so that any push to the main branch produces staging-{sha} tagged images instead of latest-{sha}.
Current Behavior
| Scenario | Flow Type | Tag Pattern | Semantic Issue |
|---|---|---|---|
| PR (any branch β dev) | pr |
pr-{sha} |
β Clear |
| Push to dev | dev |
dev-{sha} |
β Clear |
| PR (dev β main) | dev |
dev-{sha} |
β Clear |
| PR (any other branch β main) | patch |
patch-{sha} |
β Clear |
| Push to main (merge) | latest |
latest-{sha} |
|
| Manual release | N/A | Handled by separate workflow | latest, v1.0.0 |
Proposed Behavior
| Scenario | Flow Type | Tag Pattern | Benefit |
|---|---|---|---|
| PR (any branch β dev) | pr |
pr-{sha} |
Feature testing |
| Push to dev | dev |
dev-{sha} |
Development images |
| PR (dev β main) | dev |
dev-{sha} |
Preview staging |
| PR (any other branch β main) | patch |
patch-{sha} |
Emergency patch preview |
| Push to main (any merge) | staging |
staging-{sha} |
Pre-production validation |
| Manual release | N/A | Handled by separate workflow | True latest production tag |
π Workflow Clarity
Feature Branch --> PR --> dev branch
|
| (pr-{sha}, dev-{sha})
|
v
PR to main (Preview: dev-{sha})
|
Hotfix Branch --> PR to main (Preview: patch-{sha})
|
v
main branch
|
Auto Build
|
v
staging-{sha} (Pre-production)
|
Manual Release
|
v
latest + v1.0.x (Production)
π Implementation Changes Needed
1. Update scripts/detect-build-flow.sh (Lines 188-191)
Current:
# Push to main branch -> Use 'latest' or semantic version
elif [ "$branch" = "$MAIN_BRANCH" ]; then
flow_type="latest"
log_success "Flow: Push to main branch (latest)"Proposed:
# Push to main branch -> staging for pre-production validation
elif [ "$branch" = "$MAIN_BRANCH" ]; then
flow_type="staging"
log_success "Flow: Push to main branch (staging)"2. Update scripts/pr-comment.js Flow Metadata
Add staging flow metadata:
staging: {
emoji: 'π',
title: 'Staging Build',
description: 'Pre-production validation',
color: '#ffd700'
}3. Update Documentation
README.md- Update flow types table- Examples section - Add staging flow example
- Flowchart/diagram - Update to show staging flow
β Benefits
- Semantic Clarity:
staging-{sha}clearly indicates pre-production status - Pipeline Transparency: Developers know these images need validation before release
- True
latestTag: Reserved for production releases via manual release workflow - Universal Application: Whether merged from
devor emergencypatch, main branch = staging - Industry Standard: Aligns with common CI/CD terminology (dev β staging β production)
π Use Cases
Use Case 1: Normal Development Flow
feature/api β dev (pr-{sha}, dev-{sha})
β
PR: dev β main (dev-{sha})
β
Merge to main (staging-{sha}) β Pre-production testing
β
Manual Release (latest, v1.0.4) β Production
Use Case 2: Emergency Hotfix
fix/security β main (patch-{sha})
β
Merge to main (staging-{sha}) β Quick validation
β
Manual Release (latest, v1.0.5) β Production
π― Expected Outcome
After this change:
- Development images:
pr-{sha},dev-{sha},wip-{sha} - Pre-production/Staging:
staging-{sha}(on main branch) - Production:
latest,v1.0.x(manual release only)
Clear separation of concerns and no confusion about which images are production-ready.
π Notes
- This is a breaking change that will affect users relying on
latest-{sha}tags - Consider releasing as a new major version (v2.0.0)
- Update changelog and migration guide
- The
patchflow should continue to work for any branch (except dev) targeting main, not just branches named "hotfix"
Priority: Enhancement
Impact: Improves clarity and aligns with industry-standard CI/CD semantics