fix: add --base-image-release CLI override for open network mode#3044
fix: add --base-image-release CLI override for open network mode#3044thegreyd wants to merge 1 commit into
Conversation
…twork mode Base image release requires hermetic builds, so when update_golang runs with --network-mode open, the build would fail at the base image release step. This adds a --base-image-release/--no-base-image-release flag to doozer's beta:images:konflux:build command and wires update_golang to pass --no-base-image-release when network_mode is open. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
WalkthroughThis PR adds a CLI-driven override mechanism for base image release triggering. A new ChangesBase image release override feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@thegreyd: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
doozer/tests/test_image.py (1)
1946-1966: ⚡ Quick winAdd an OKD + override=True regression test.
You now verify OCP override on/off, but not that OKD still hard-disables base image release when
base_image_release_override=True. Adding this case will lock the intended precedence contract in tests.Suggested test addition
+ # OKD guard must still win even when CLI override is explicitly True + okd_override_runtime = MagicMock() + okd_override_runtime.logger = logging.getLogger('test_runtime') + okd_override_runtime.variant = BuildVariant.OKD + okd_override_runtime.assembly = 'stream' + okd_override_runtime.product = 'ocp' + okd_override_runtime.group_config = Model({}) + okd_override_runtime.base_image_release_override = True + self.assertFalse(ImageMetadata(okd_override_runtime, base_data).should_trigger_base_image_release())🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@doozer/tests/test_image.py` around lines 1946 - 1966, Add a regression test that asserts OKD still blocks base image release even when the CLI override is True: create a MagicMock runtime similar to override_on_runtime but set variant = BuildVariant.OKD, set group_config = Model({'base_image_release': Model({'enabled': False})}) and base_image_release_override = True, then assert ImageMetadata(<that runtime>, base_data).should_trigger_base_image_release() is False; this targets the ImageMetadata.should_trigger_base_image_release() behavior and ensures the override does not take precedence for OKD.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@doozer/tests/test_image.py`:
- Around line 1946-1966: Add a regression test that asserts OKD still blocks
base image release even when the CLI override is True: create a MagicMock
runtime similar to override_on_runtime but set variant = BuildVariant.OKD, set
group_config = Model({'base_image_release': Model({'enabled': False})}) and
base_image_release_override = True, then assert ImageMetadata(<that runtime>,
base_data).should_trigger_base_image_release() is False; this targets the
ImageMetadata.should_trigger_base_image_release() behavior and ensures the
override does not take precedence for OKD.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: cad1af52-88a6-450b-9535-93696985ddc2
📒 Files selected for processing (5)
doozer/doozerlib/cli/images_konflux.pydoozer/doozerlib/image.pydoozer/doozerlib/runtime.pydoozer/tests/test_image.pypyartcd/pyartcd/pipelines/update_golang.py
|
PR needs rebase. DetailsInstructions 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. |
Summary
--base-image-release/--no-base-image-releaseCLI flag to doozer'sbeta:images:konflux:buildcommand, following the same pattern as--network-modebase_image_release_overrideto Runtime, checked inshould_trigger_base_image_release()with highest precedence (after OKD check)update_golangpipeline to pass--no-base-image-releasewhen--network-mode openis set, since base image release currently requires hermetic buildsTest plan
test_should_trigger_base_image_releasetests pass🤖 Generated with Claude Code