Skip to content

OCPBUGS-105510: images: add BUILD_VERSION arg - #10771

Closed
patrickdillon wants to merge 1 commit into
openshift:mainfrom
patrickdillon:build_version
Closed

patrickdillon wants to merge 1 commit into
openshift:mainfrom
patrickdillon:build_version

Conversation

@patrickdillon

@patrickdillon patrickdillon commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Add a BUILD_VERSION arg to our CI images, which will be set in the CI environment and then set that as an environment variable to pass to the build scripts. This is similar to the pattern of ART/OSBS.

Currently, with BUILD_VERSION unset in CI, we fall back to the git tags. But with 5.0 & 4.23 having identical commits, we need a way to distinguish between the two different builds, in which case we can just adopt the same pattern used by ART/OSBS.

Summary by CodeRabbit

  • Chores
    • Build processes now accept and expose a consistent build version across supported CI, installer, bare-metal, libvirt, and OpenStack images.
    • Installer artifact builds for macOS and Linux architectures now receive the same version information.
    • This improves version tracking and consistency for generated images and installation artifacts.

Add a BUILD_VERSION arg to our CI images, which will be set in
the CI environment and then set that as an environment variable
to pass to the build scripts. This is similar to the pattern of
ART/OSBS.

Currently, with BUILD_VERSION unset in CI, we fall back to the git
tags. But with 5.0 & 4.23 having identical commits, we need a way
to distinguish between the two different builds, in which case
we can just adopt the same pattern used by ART/OSBS.
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 18, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@patrickdillon: This pull request references Jira Issue OCPBUGS-105510, which is invalid:

  • expected the bug to target either version "5.1.0." or "openshift-5.1.0.", but it targets "5.0.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Add a BUILD_VERSION arg to our CI images, which will be set in the CI environment and then set that as an environment variable to pass to the build scripts. This is similar to the pattern of ART/OSBS.

Currently, with BUILD_VERSION unset in CI, we fall back to the git tags. But with 5.0 & 4.23 having identical commits, we need a way to distinguish between the two different builds, in which case we can just adopt the same pattern used by ART/OSBS.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 3a0d0e8f-5c71-4528-bd9c-70608aa674f7

📥 Commits

Reviewing files that changed from the base of the PR and between 80c9699 and 10165b8.

📒 Files selected for processing (6)
  • images/baremetal/Dockerfile.ci
  • images/installer-artifacts/Dockerfile.rhel
  • images/installer/Dockerfile.ci
  • images/installer/Dockerfile.upi.ci
  • images/libvirt/Dockerfile.ci
  • images/openstack/Dockerfile.ci

Included review availability: Your plan includes up to 12 reviews per rolling hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The Docker builder stages now accept a BUILD_VERSION build argument and expose it as an environment variable across CI images and RHEL installer-artifact builders.

Changes

Build version propagation

Layer / File(s) Summary
CI builder image version propagation
images/baremetal/Dockerfile.ci, images/installer/Dockerfile.ci, images/installer/Dockerfile.upi.ci, images/libvirt/Dockerfile.ci, images/openstack/Dockerfile.ci
The CI builder stages accept BUILD_VERSION and export it in the build environment.
RHEL artifact builder version propagation
images/installer-artifacts/Dockerfile.rhel
The macOS amd64, macOS arm64, Linux amd64, and Linux arm64 builder stages accept and export BUILD_VERSION.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: 🔵 Low · up to 10165

CI image builds may continue deriving their version from Git when external build definitions do not pass BUILD_VERSION, leaving builds from different release branches indistinguishable. The PR is mergeable with explicit owner awareness and follow-up to update or verify those build definitions.

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding the BUILD_VERSION argument to CI images.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The pull-request diff changes only six Dockerfiles by adding BUILD_VERSION ARG/ENV lines; it introduces no Ginkgo tests or dynamic test titles.
Test Structure And Quality ✅ Passed The exact PR diff changes only six Dockerfiles and adds BUILD_VERSION ARG/ENV lines; it introduces no Ginkgo tests or test behavior covered by this check.
Microshift Test Compatibility ✅ Passed The PR changes only six Dockerfiles and adds no Ginkgo e2e tests, so MicroShift test compatibility requirements do not apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The pull request changes only six Dockerfiles and adds no Ginkgo e2e tests, so the SNO compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The diff only adds BUILD_VERSION ARG/ENV declarations to six Dockerfiles; it does not modify deployment manifests, operators, controllers, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The pull request changes only six Dockerfiles, adding BUILD_VERSION to builder stages; no OTE code or process-level stdout writes changed.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR diff contains only six Dockerfile changes adding BUILD_VERSION ARG/ENV lines; it adds no Ginkgo e2e tests or IPv4/external-connectivity test behavior.
No-Weak-Crypto ✅ Passed The diff adds only BUILD_VERSION ARG/ENV declarations. No MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons were introduced.
Container-Privileges ✅ Passed The HEAD diff adds only BUILD_VERSION ARG/ENV lines. It adds no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation settings; final images retain USER 1000:1000.
No-Sensitive-Data-In-Logs ✅ Passed The commit only adds a version ARG/ENV to builder stages; BUILD_VERSION is used as a release version, and no password, token, key, PII, or customer-data logging is introduced.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from elfosardo and rwsu August 18, 2026 15:21
@openshift-ci

openshift-ci Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign stephenfin for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@patrickdillon

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Aug 18, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@patrickdillon: This pull request references Jira Issue OCPBUGS-105510, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.1.0) matches configured target version for branch (5.1.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Aug 18, 2026
@openshift-ci

openshift-ci Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

@patrickdillon: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@pskrbasu

pskrbasu commented Aug 19, 2026

Copy link
Copy Markdown

Hi, this PR would help unblock the OKD SCOS 5.0 promoted release stream (5-scos-next), which has had its upgrade job failing consistently since ec.4 (June 29).

The version detection issue this PR fixes is one of two blockers causing release-openshift-okd-scos-installer-e2e-aws-upgrade-from-scos-next to fail on every promoted release. The git describe returning v1.5.0-alpha causes RHCOS 10 stream selection, and the [sig-ci] prow job name should match os version early test then fails with an osimagestreams CR 404 on OKD SCOS clusters (where the CR intentionally doesn't exist).

Full investigation and context in OKD-424.

Would appreciate a review when you get a chance, this has been blocking promoted releases for almost two months now. Thanks!

Comment on lines +11 to +12
ARG BUILD_VERSION
ENV BUILD_VERSION=${BUILD_VERSION}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a bit worried that it will shadow the ART-injected ENV in ART builds:

ART's build tooling (doozer) modifies the Dockerfile during a "rebase" step before the image is built. In doozer/doozerlib/backend/rebaser.py, it builds a set of environment variables that include BUILD_VERSION:python

build_update_env_vars = {
    'OS_GIT_MAJOR': major_version,
    'OS_GIT_MINOR': minor_version,
    ...
    'BUILD_VERSION': version,
    'BUILD_RELEASE': release if release else '',
}

These get injected as an ENV instruction (flagged with __doozer=update) into each build stage of the Dockerfile — right after the FROM line. A real ART build log shows this in action:

ENV __doozer=update BUILD_RELEASE=202508131058.p2.gc736eb7.assembly.test.el9 \
    BUILD_VERSION=v4.20.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=20 ..

Maybe we need a differently named build arg / envvar and have something like this somewhere?

BUILD_VERSION=${BUILD_VERSION:-BUILD_$VERSION_BUILD_ARG}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@petr-muller I see. I will be on PTO for a few days, so I've let the rest of my team know and given them access so they can update this PR (or of course start a new one in place of this one, which is just as well).

@tthvo

tthvo commented Aug 22, 2026

Copy link
Copy Markdown
Member

/close

Superseded by #10781

@openshift-ci openshift-ci Bot closed this Aug 22, 2026
@openshift-ci

openshift-ci Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

@tthvo: Closed this PR.

Details

In response to this:

/close

Superseded by #10781

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@patrickdillon: This pull request references Jira Issue OCPBUGS-105510. The bug has been updated to no longer refer to the pull request using the external bug tracker.

Details

In response to this:

Add a BUILD_VERSION arg to our CI images, which will be set in the CI environment and then set that as an environment variable to pass to the build scripts. This is similar to the pattern of ART/OSBS.

Currently, with BUILD_VERSION unset in CI, we fall back to the git tags. But with 5.0 & 4.23 having identical commits, we need a way to distinguish between the two different builds, in which case we can just adopt the same pattern used by ART/OSBS.

Summary by CodeRabbit

  • Chores
  • Build processes now accept and expose a consistent build version across supported CI, installer, bare-metal, libvirt, and OpenStack images.
  • Installer artifact builds for macOS and Linux architectures now receive the same version information.
  • This improves version tracking and consistency for generated images and installation artifacts.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@tthvo
tthvo deleted the build_version branch August 22, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants