Skip to content

Add --enabled-override for manual base image release runs#3050

Open
thegreyd wants to merge 2 commits into
openshift-eng:mainfrom
thegreyd:base-image-release-force-flag
Open

Add --enabled-override for manual base image release runs#3050
thegreyd wants to merge 2 commits into
openshift-eng:mainfrom
thegreyd:base-image-release-force-flag

Conversation

@thegreyd

Copy link
Copy Markdown
Contributor

Summary

  • Add --enabled-override to doozer images:release-to-base-repo so operators can manually run snapshot→release when base_image_release.enabled is false in image or group config
  • Pre-flight qualification checks with actionable error messages (test assembly, OKD, non-qualifying images, and Konflux failures are distinguished)
  • Override applies only to qualifying base_only/golang images on non-test assemblies; does not replace metadata base_image_release.force

Test plan

  • make test (all packages pass on Python 3.11 venv)
  • Unit tests for should_trigger_base_image_release(enabled_override=...)
  • Handler and CLI tests for flag passthrough and error paths

Made with Cursor

Allow operators to bypass base_image_release.enabled: false when invoking
images:release-to-base-repo, with clear qualification errors when the image
still does not qualify.

Co-authored-by: Cursor <cursoragent@cursor.com>

rh-pre-commit.version: 2.4.0
rh-pre-commit.check-secrets: ENABLED
@openshift-ci

openshift-ci Bot commented Jun 10, 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 rayfordj 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

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 4deddcda-50b0-433b-b573-5bf41274abae

📥 Commits

Reviewing files that changed from the base of the PR and between 375ae2a and 45fbb38.

📒 Files selected for processing (6)
  • doozer/doozerlib/backend/base_image_handler.py
  • doozer/doozerlib/cli/images.py
  • doozer/doozerlib/image.py
  • doozer/tests/backend/test_base_image_handler.py
  • doozer/tests/cli/test_images.py
  • doozer/tests/test_image.py
👮 Files not reviewed due to content moderation or server errors (6)
  • doozer/doozerlib/image.py
  • doozer/tests/test_image.py
  • doozer/doozerlib/backend/base_image_handler.py
  • doozer/tests/backend/test_base_image_handler.py
  • doozer/doozerlib/cli/images.py
  • doozer/tests/cli/test_images.py

Walkthrough

This PR adds an enabled_override parameter to the base-image release workflow, allowing operators to trigger releases via CLI even when base_image_release.enabled is configured as disabled. The change introduces a qualification type to track both trigger eligibility and failure reasons, refactors the core metadata decision logic, and cascades the parameter through the handler and CLI layers with validation.

Changes

Base Image Release Enabled Override

Layer / File(s) Summary
Qualification type and base-image release logic
doozer/doozerlib/image.py, doozer/tests/test_image.py
BaseImageReleaseQualification NamedTuple replaces bool returns, capturing trigger decision and failure reason. should_trigger_base_image_release refactored to accept enabled_override, enforce image-type and assembly restrictions, apply override bypass logic, and return structured qualification with explanatory reasons for non-trigger cases.
Handler snapshot_release integration
doozer/doozerlib/backend/base_image_handler.py, doozer/tests/backend/test_base_image_handler.py
BaseImageHandler.snapshot_release accepts enabled_override parameter and passes it to qualification check. Test verifies override bypasses disabled configuration and produces expected release result.
CLI command with override flag and validation
doozer/doozerlib/cli/images.py, doozer/tests/cli/test_images.py
--enabled-override CLI option added to images:release-to-base-repo, wired to function parameter. Adds metadata validation, evaluates qualification with explicit error messaging for non-qualifying images, passes override to handler, improves failure messages. Tests verify flag propagation, override behavior, and error paths including disabled configuration, excluded assemblies, and missing snapshot results.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Replace the separate failure-reason helper with BaseImageReleaseQualification
so the decision and message come from a single code path.

Co-authored-by: Cursor <cursoragent@cursor.com>

rh-pre-commit.version: 2.4.0
rh-pre-commit.check-secrets: ENABLED
@openshift-ci

openshift-ci Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

@thegreyd: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/security 45fbb38 link false /test security

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.

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 18, 2026
@openshift-ci

openshift-ci Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

PR needs rebase.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant