Deprecate imagestreamtag acceptance#785
Conversation
rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughRelease phase lookup now comes from ChangesRelease phase migration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cmd/release-controller-api/http.go (1)
2232-2244: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winHandle
maxUnready == 0before counting phases.When
maxUnreadyis0, this loop is skipped and the function returnstrue, so Line 2195 marks the stream as failing even though Line 2187 treats0as “no unready limit”. That makes dashboard status wrong for configs that leaveMaxUnreadyReleasesunset.Suggested fix
func isReleaseFailing(phases []string, maxUnready int) bool { + if maxUnready <= 0 { + return false + } unreadyCount := 0 for i := 0; unreadyCount < maxUnready && i < len(phases); i++ { switch phases[i] {🤖 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 `@cmd/release-controller-api/http.go` around lines 2232 - 2244, The isReleaseFailing function treats maxUnready == 0 as failing because the loop is skipped and it returns true, which conflicts with the intended “no unready limit” behavior. Update isReleaseFailing to explicitly handle maxUnready == 0 as non-failing before the phase counting logic, and keep the existing ReleasePhaseReady and ReleasePhaseAccepted handling intact so the dashboard status remains correct when MaxUnreadyReleases is unset.
🤖 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.
Inline comments:
In `@hack/release-tool.py`:
- Line 586: The approval flow is missing admin impersonation, so `approval()`
still runs as the normal user even when `--admin` is enabled. Update the
`approval` function to accept the same `options` dict used elsewhere and wrap
its operations in `oc.options(options)` before any accept/reject/delete actions.
Also update the caller that invokes `approval()` to pass through the parsed
`--admin` options so the releasepayload label writes and approval actions run
with the intended impersonation.
---
Outside diff comments:
In `@cmd/release-controller-api/http.go`:
- Around line 2232-2244: The isReleaseFailing function treats maxUnready == 0 as
failing because the loop is skipped and it returns true, which conflicts with
the intended “no unready limit” behavior. Update isReleaseFailing to explicitly
handle maxUnready == 0 as non-failing before the phase counting logic, and keep
the existing ReleasePhaseReady and ReleasePhaseAccepted handling intact so the
dashboard status remains correct when MaxUnreadyReleases is unset.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 1b0b76a6-772a-416a-85f0-83c952c8f2c2
📒 Files selected for processing (10)
cmd/release-controller-api/http.gocmd/release-controller-api/http_candidate.gocmd/release-controller-api/http_helper.gohack/release-tool.pypkg/cmd/release-payload-controller/payload_accepted_controller_test.gopkg/cmd/release-payload-controller/payload_rejected_controller_test.gopkg/release-controller/release_payload.gopkg/release-controller/release_payload_test.gopkg/releasepayload/jobstatus/helpers.gopkg/releasepayload/jobstatus/helpers_test.go
|
/label tide/merge-method-squash |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
hack/release-tool.py (1)
591-594: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate the stale missing-payload diagnostic.
Line 593 now looks up
releasepayload/{release}, but the error still saysimagestreamtag, which will mislead operators on lookup failures.Proposed fix
- logger.error(f'Unable to locate imagestreamtag: releasepayload/{release}') + logger.error(f'Unable to locate releasepayload: {namespace}/releasepayload/{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 `@hack/release-tool.py` around lines 591 - 594, The missing-payload diagnostic in the release lookup path is stale and refers to imagestreamtag even though releasepayload/{release} is being queried. Update the logger.error message in the payload lookup block of the release-tool flow to mention releasepayload/{release} and keep the wording aligned with the selector used in that branch.
🤖 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.
Inline comments:
In `@hack/release-tool.py`:
- Line 863: The call to approval() is still passing the obsolete
release_image_stream argument, which no longer matches the function signature
and causes a positional argument mismatch. Update the invocation in the
release-tool flow to match approval(ctx, options, namespace, release, team,
accept, reject, delete, check, execute) by removing the stale imagestream
argument while keeping the remaining arguments in the correct order.
---
Outside diff comments:
In `@hack/release-tool.py`:
- Around line 591-594: The missing-payload diagnostic in the release lookup path
is stale and refers to imagestreamtag even though releasepayload/{release} is
being queried. Update the logger.error message in the payload lookup block of
the release-tool flow to mention releasepayload/{release} and keep the wording
aligned with the selector used in that branch.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: f8d0d8fd-4b54-4ea4-a0f3-ee0b4e15349a
📒 Files selected for processing (1)
hack/release-tool.py
7929e5a to
33bd6bb
Compare
rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
33bd6bb to
3853d63
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AlexNPavel, bradmwilliams The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@bradmwilliams: all tests passed! 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. |
This PR contains the following changes:
release-controller-apiReleasePayloadconditions instead of annotations on the releaseimagestreamtagrelease.openshift.io/messageannotation reads withPayloadOverride.Reasonfrom theReleasePayloadspecrelease-tool.py:imagestreamtagpatching path from — accept/reject now exclusively patches theReleasePayloadrelease-payload-controller:ComputeJobState()that could prematurely reject a release while blocking jobs still had retries outstandingSummary by CodeRabbit