fix(doozer): collect skips from all FBC channel entries, not just the first#3128
Conversation
|
Hi @eemurphy. Thanks for your PR. I'm waiting for a openshift-eng member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Walkthrough
ChangesKonflux FBC channel graph rebasing
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
c96ae38 to
e70f9e0
Compare
|
/ok-to-test |
The skips migration logic in _update_channel used next() to find a single entry with skips, which only works for linear upgrade chains. For operators with branching upgrade graphs (e.g. ACM's deprecation-style channels where multiple entries independently define skips), only the first entry's skips were collected. Remaining entries had their skip relationships ignored, producing stranded bundles that fail opm validate. After processing the first entry (existing behavior, unchanged), also collect skips from any remaining entries that have them. Fixes FBC build failures for ACM on OCP 4.21 and 4.22. rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
e70f9e0 to
1b5c29c
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
doozer/doozerlib/backend/konflux_fbc.py (1)
1204-1232: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winOptional: extract skip-aggregation into a small helper for testability.
The nested branch inside
_update_channel(find first entry with skips, aggregate, then loop remaining entries) is flagged as medium complexity. Extracting this into a standalone helper (e.g._aggregate_channel_skips(channel, olm_bundle_name)) would let it be unit-tested independently of the full_rebase_dirflow, reducing the amount of mocking needed for future edge-case tests.🤖 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/doozerlib/backend/konflux_fbc.py` around lines 1204 - 1232, The skip aggregation logic inside _update_channel is too nested and hard to test directly. Extract the block that finds the first entry with skips, merges skips from the remaining channel['entries'], and removes olm_bundle_name into a small helper such as _aggregate_channel_skips(channel, olm_bundle_name). Keep the behavior unchanged, but have _update_channel call the helper so the aggregation can be unit-tested independently.
🤖 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/doozerlib/backend/konflux_fbc.py`:
- Around line 1204-1232: The skip aggregation logic inside _update_channel is
too nested and hard to test directly. Extract the block that finds the first
entry with skips, merges skips from the remaining channel['entries'], and
removes olm_bundle_name into a small helper such as
_aggregate_channel_skips(channel, olm_bundle_name). Keep the behavior unchanged,
but have _update_channel call the helper so the aggregation can be unit-tested
independently.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift-eng/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c55b24de-ced8-408d-8334-cb75cdb40031
📒 Files selected for processing (2)
doozer/doozerlib/backend/konflux_fbc.pydoozer/tests/backend/test_konflux_fbc.py
|
/retest |
The _update_channel function in konflux_fbc.py unconditionally ran skip migration on all channel entries, which destroyed deliberately managed update graphs used by operators like ACM. Two bugs combined to produce incorrect OLM channel output: 1. Skip migration popped skips from existing entries and accumulated them onto the new head entry, even when entries used replaces fields to define a deliberate upgrade graph. For ACM's graph, this removed the carefully placed skips:[v2.16.1] from v2.16.2 and gave the new v2.16.3 entry skips it should not have. 2. Head detection only considered replaces fields, not skips, when finding the current channel head. In ACM's branching graph where v2.16.2 skips v2.16.1, both v2.16.1 and v2.16.2 appeared as "unreplaced" entries, causing v2.16.1 to be incorrectly selected as the head instead of v2.16.2. Fix: detect replaces-based graphs (any existing entry has a replaces field) and skip the skip-migration block entirely, preserving all existing entries. Also fix head detection to consider both replaces and skips when finding the superseded set, so the true head is found correctly in branching graphs. Backward compatibility: entries without replaces (openshift-* style skipRange+skips chains) continue to use skip migration as before. Signed-off-by: Rayford Johnson <rayfordj@users.noreply.github.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
|
/hold for layered-product tests (ACM, Logging, MTC, & OADP) |
|
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)
doozer/doozerlib/backend/konflux_fbc.py (1)
1231-1237: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winCompute the channel head before migrating
skips.The migration removes the edges needed by head detection, while the regression test only checks that some
replacesvalue exists.
doozer/doozerlib/backend/konflux_fbc.py#L1231-L1237: snapshot superseded names before popping existingskips.doozer/tests/backend/test_konflux_fbc.py#L2310-L2310: assert that the new entry replacesadvanced-cluster-management.v2.16.0.🤖 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/doozerlib/backend/konflux_fbc.py` around lines 1231 - 1237, The channel head must be determined before migrating and removing existing skips. In doozer/doozerlib/backend/konflux_fbc.py lines 1231-1237, snapshot the superseded entry names and compute the head before popping skips, then perform the migration using that snapshot. In doozer/tests/backend/test_konflux_fbc.py line 2310, strengthen the regression assertion so the new entry explicitly replaces advanced-cluster-management.v2.16.0.
🤖 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 `@doozer/tests/backend/test_konflux_fbc.py`:
- Line 2310: Update the assertion for new_entry to verify that its replacement
value exactly matches the unsuperseded v2.16.0 entry, rather than only checking
that the "replaces" field exists. Preserve the surrounding test setup and use an
equality assertion against the expected replacement head.
---
Outside diff comments:
In `@doozer/doozerlib/backend/konflux_fbc.py`:
- Around line 1231-1237: The channel head must be determined before migrating
and removing existing skips. In doozer/doozerlib/backend/konflux_fbc.py lines
1231-1237, snapshot the superseded entry names and compute the head before
popping skips, then perform the migration using that snapshot. In
doozer/tests/backend/test_konflux_fbc.py line 2310, strengthen the regression
assertion so the new entry explicitly replaces
advanced-cluster-management.v2.16.0.
🪄 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: Repository: openshift-eng/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 9ab5ad0d-6edf-44fe-b379-0977f2af8cbf
📒 Files selected for processing (2)
doozer/doozerlib/backend/konflux_fbc.pydoozer/tests/backend/test_konflux_fbc.py
|
/hold for @eemurphy review against |
Signed-off-by: Rayford Johnson <rayfordj@users.noreply.github.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
|
/unhold |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rayfordj 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
doozer/doozerlib/backend/konflux_fbc.py (1)
1293-1299: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winSafeguard against explicit
nullvalues in YAML.If the parsed catalog YAML explicitly contains
skips: null,it.get('skips', [])will returnNonerather than the default[], leading to aTypeErrorwhen passed toupdate(). Usingit.get('skips') or []ensures that a falsyNoneis safely evaluated as an empty list.♻️ Proposed refactor
- for it in all_entries: - superseded_names.update(it.get('skips', [])) + for it in all_entries: + superseded_names.update(it.get('skips') or [])🤖 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/doozerlib/backend/konflux_fbc.py` around lines 1293 - 1299, Update the superseded-name collection in the current-head computation to normalize an explicit null skips value to an empty list before passing it to superseded_names.update(). Modify the it.get('skips', []) expression within the loop over all_entries, preserving existing behavior for populated skip lists.
🤖 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/doozerlib/backend/konflux_fbc.py`:
- Around line 1293-1299: Update the superseded-name collection in the
current-head computation to normalize an explicit null skips value to an empty
list before passing it to superseded_names.update(). Modify the it.get('skips',
[]) expression within the loop over all_entries, preserving existing behavior
for populated skip lists.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift-eng/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: ef2abed4-bbbb-4d05-907e-a6d6fd34ea88
📒 Files selected for processing (2)
doozer/doozerlib/backend/konflux_fbc.pydoozer/tests/backend/test_konflux_fbc.py
🚧 Files skipped from review as they are similar to previous changes (1)
- doozer/tests/backend/test_konflux_fbc.py
|
@eemurphy: 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. |
9296b2d
into
openshift-eng:main
Summary
Fix FBC build failures for operators with branching upgrade graphs (e.g. ACM on OCP 4.21/4.22) caused by the skips migration logic in
_update_channelonly collecting skips from the first entry with askipsfield.The existing
next()+ pop + union logic is unchanged. A small loop is added after it to collect skips from any remaining entries that also have them — this is a no-op for linear chains (every team today) and only activates for branching graphs (ACM).skipRangedoes not count for reachability inopm validate— only explicitskipsandreplaces. So all entries with skip relationships must be collected to prevent stranded bundles.Test plan
test_rebase_dir_branching_skips_graph— verifies ACM-style branching graph with 3 entries having independent skipstest_konflux_fbc.pypass (backward compatible — linear chains produce identical results)build-fbcJenkins job formulticlusterhub-operatoron OCP 4.21/4.22 to verify end-to-endSummary by CodeRabbit