feat: Universal OCI Tagging Engine for Flexible Image Naming (#746)#747
feat: Universal OCI Tagging Engine for Flexible Image Naming (#746)#747nklowns wants to merge 1 commit intoblue-build:mainfrom
Conversation
- Decentralize tagging expansion from driver-specific logic.
- Implement TaggingPolicy and TagMetadata in blue-build-utils.
- Support placeholder resolution ({tag}, {os_version}, {timestamp}, {short_sha}).
- Add tagging field to Recipe schema for data-driven configuration.
- Maintain legacy fallback for backward compatibility.
- Ensure cross-driver consistency (GitHub, GitLab, Local).
- Optimized regex evaluation with pre-compiled policy engine.
- Enhanced error handling with miette for senior-level robustness.
Closes blue-build#746
Assisted-by: Antigravity via Claude-3.5-Sonnet
c4e2750 to
5a3544a
Compare
|
Before I even start to review this, I see you used an AI agent to make the changes. I need to see in your own words what this change is doing and that you have gone through the changes yourself and tested it locally. I'm not going to waste my time going back and forth with a bot on fixing up this PR. |
|
@gmpinder Hello, first of all, thank you for your response. As a hobby, I’m exploring how to use Blue-Build to generate the Bazzite DX image as a declarative mechanism to simplify the maintenance process. Even though I used AI to help me get started, I’ll still test this PR locally. |
I think the idea for this feature is really good, but let's try to discuss how to implement it in the issue first. Because the current implementation, I already see several changes that break existing functionality. |
feat: Universal OCI Tagging Engine for Flexible Image Naming
Summary of Technical Impact
This PR introduces a Universal OCI Tagging Engine, a centralized policy-driven system that decouples image tagging logic from individual CI/CD drivers (GitHub, GitLab, Local). It enables non-opinionated, data-driven OCI reference generation directly from the
recipe.yml.Motivation
Currently, BlueBuild drivers implement fixed, opinionated tagging patterns (e.g., automatically appending branch names or OS versions to
alt-tags). While convenient for many, this creates significant friction for projects requiring strict OCI naming standards—such as Bazzite or standardized Linux distributions.Previously, users had to resort to external
yqpatching or complex shell scripting in their CI pipelines to achieve specific tag formats likestable-41.20241021. This engine eliminates that need by making tagging a first-class feature of the recipe.Technical Implementation
blue-build-utilsthat uses regex-based matching to apply custom expansion rules toalt-tags.{tag}: The original tag being expanded.{os_version}: Extracted from the base image or build metadata.{timestamp}: The build's ISO-style timestamp.{short_sha}: The Git commit hash (where available).tags(verbatim tags) andtagging(policy-based expansion) to theRecipestruct.mietteerror reporting to provide actionable feedback for invalid patterns.Examples
1. Bazzite-style Versioned Tagging
Expand the
stabletag to include the OS version and timestamp:2. Static Tagging
Sometimes you just want an exact list of tags without any logic:
Verification Results
utils/src/tagging.rsfor placeholder resolution and regex matching.Closes #746
Assisted-by: Antigravity via Claude-3.5-Sonnet