Skip to content

CORE-4786 make dev and main tags usable by flux#145

Merged
monotek merged 3 commits into
mainfrom
CORE-4786_use_dev_and_main_tags_usable_by_flux
Jun 3, 2026
Merged

CORE-4786 make dev and main tags usable by flux#145
monotek merged 3 commits into
mainfrom
CORE-4786_use_dev_and_main_tags_usable_by_flux

Conversation

@monotek
Copy link
Copy Markdown
Member

@monotek monotek commented Jun 2, 2026

Type of Change

  • Bugfix
  • Enhancement / new feature
  • Refactoring
  • Documentation

Description

Add opt-in timestamp suffix to branch tags for Flux image automation

Why

Flux's image automation needs image tags it can order to pick the newest build. Our current branch tags (dev-36423e42, main-525f80d8) suffix the Git SHA, which isn't sortable — Flux can't tell which build is newer. Prod CalVer tags (2025.50.14) are already orderable via SemVer.

This adds an opt-in timestamp component to dev/main/master branch tags so they become sortable, while keeping the short SHA for traceability.

What

  • New input docker-tag-timestamp (default false). When true, branch tags become <prefix>-<YYYYMMDDHHMMSS-UTC>-<short-sha>, e.g. dev-20260602143055-36423e42.
  • Default is unchanged — existing consumers keep the legacy <prefix>-<short-sha> format. No breaking change.
  • Prod (v*) tags and non-pushed feature-branch tags are untouched regardless of the flag.
Ref Default docker-tag-timestamp: 'true'
dev dev-<sha> dev-<timestamp>-<sha>
main/master main-<sha> main-<timestamp>-<sha>
v* (prod) 2025.50.14 (unchanged)

Flux usage

With the flag enabled, one ImagePolicy per environment:

# dev / stage — numerical sort on the extracted timestamp
filterTags:
  pattern: '^dev-(?P<ts>[0-9]+)-[0-9a-f]+$'
  extract: '$ts'
policy:
  numerical: { order: asc }
---
# prod — CalVer parses as SemVer
policy:
  semver: { range: '>=0.0.0' }

Checklist

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Review the Contributing Guideline and sign CLA
  • Reference relevant issue(s) and close them after merging

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@monotek
Copy link
Copy Markdown
Member Author

monotek commented Jun 2, 2026

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jun 2, 2026
@monotek monotek marked this pull request as ready for review June 2, 2026 14:36
@monotek monotek requested review from a team as code owners June 2, 2026 14:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an opt-in timestamp component to dev/main/master branch image tags so Flux image automation can sort tags and select the newest build, while preserving the legacy <prefix>-<short-sha> format by default.

Changes:

  • Introduces a new docker-tag-timestamp action input (default false) to generate sortable branch tags: <prefix>-<utc-timestamp>-<short-sha>.
  • Refactors tag generation logic in scripts/generate-tags.sh via a branch_tag helper.
  • Extends Bats tests and documents the new tag format and Flux policy guidance in the README.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
scripts/generate-tags.sh Adds branch_tag helper to optionally insert a UTC timestamp into branch tags.
action.yml Adds docker-tag-timestamp input and wires it to INPUT_DOCKER_TAG_TIMESTAMP env var.
tests/generate-tags.bats Adds deterministic tests for timestamped branch tags and ensures prod tags remain unchanged.
README.md Documents the new input and provides guidance for Flux image automation policies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread action.yml
Signed-off-by: André Bauer <andre.bauer@staffbase.com>
@monotek monotek force-pushed the CORE-4786_use_dev_and_main_tags_usable_by_flux branch from 6c940df to 4ee0924 Compare June 2, 2026 14:42
@monotek monotek requested a review from Copilot June 2, 2026 14:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread tests/generate-tags.bats
Co-authored-by: Harika <61228712+harikaduyu@users.noreply.github.com>
@monotek monotek merged commit 82bd347 into main Jun 3, 2026
10 checks passed
@monotek monotek deleted the CORE-4786_use_dev_and_main_tags_usable_by_flux branch June 3, 2026 07:29
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants