Skip to content

Conversation

grokspawn
Copy link
Contributor

@grokspawn grokspawn commented Oct 13, 2025

Description of the change:
revert app code to before refactoring, but enhance testing to address the changes since then

Motivation for the change:
in #1169 I was attempting to address a semver catalog template expansion error which ignored an X/arch/kind transition on the last edge. In discussion at the time, we had consensus that it only made sense to generate replaces links from minor version bundles to previous minor version head (meaning the previous minor version, maximum patch version, hereafter referred to as "prev-Z-max") in the context of generating major-version channels from the semver template.
The thinking had been that we felt that folks would want to exert controls on generated minor channels and wouldn't want generated prev-Z-max linkage.
That enabled some code refactoring for simplicity, which did not include the prev-Z-max linkage for generated minor version channels.

It turns out in retrospect that we like prev-Z-max for generated minor channels, and folks have asked for it to be re-added. Unfortunately (for me), we have addressed several issues in the same area so we couldn't merely revert to the old commit.

This PR includes the older implementation with tests that validate/enforce the prev-Z-max for generated minor version channels.

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

@grokspawn
Copy link
Contributor Author

Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.37%. Comparing base (8d4a5f9) to head (79b0f5f).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1813      +/-   ##
==========================================
+ Coverage   55.27%   55.37%   +0.10%     
==========================================
  Files         136      136              
  Lines       15976    16003      +27     
==========================================
+ Hits         8830     8861      +31     
+ Misses       5991     5987       -4     
  Partials     1155     1155              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

// - we only need to watch for arch/kind/x change
// - we don't need to accumulate skips/replaces, since we're not writing edges for subsequent entries
lastTuple := entries[len(entries)-1]
penultimateTuple := entries[len(entries)-2]
Copy link
Contributor

Choose a reason for hiding this comment

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

I couldn't quite tell on my own; is len(entries) guaranteed to be >=1? Just noticing the if entryCount > 1 check is now gone. I see the for would be skipped, but I don't see an early return or other safety check.

Copy link
Contributor Author

@grokspawn grokspawn Oct 16, 2025

Choose a reason for hiding this comment

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

REALLY nice catch @dtfranz. The minimum viable channel will have at least one edge, but it's not guaranteed to have more than one.
And that was the challenge with this PR, really. Because while we needed to revert the refactored approach, we also needed to ensure we retained the functionality in the subsequent commits... and I missed this one, although it looks like it was also missing in an earlier commit
I added a new test for the boundary condition.
Thanks!

Signed-off-by: grokspawn <[email protected]>
@dtfranz
Copy link
Contributor

dtfranz commented Oct 17, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2025
Copy link
Contributor

openshift-ci bot commented Oct 17, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: perdasilva

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

The pull request process is described here

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 17, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 24737fb into operator-framework:master Oct 17, 2025
13 checks passed
@grokspawn grokspawn deleted the semver-edge-based-retcon branch October 17, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants