Skip to content

Conversation

grokspawn
Copy link
Contributor

@grokspawn grokspawn commented Aug 15, 2025

Description of the change:

This is a first pass in making OLMv0 upgrade graph mechanics visible in rendered graphs, adding to existing olm.deprecations indication rendering.

Bundle versions which are skipped in a graph are outlined in red and have all their contributory edges changed to red, dashed arrows to indicate that they are ignored when calculating upgrades, for e.g.
Screenshot 2025-08-18 at 9 58 21 AM

in this graph, cert-manager-operator.v1.15.1 is skipped, so any graph updates by this version are similarly ignored. This means that users cannot upgrade from v1.15.0 to v1.15.1.

These features are controlled by a new draw-v0-semantics flag (defaults off).
By default, render-graph displays simple upgrade graph mechanics, which aligns to OLMv1 functionality.

Motivation for the change:

Answering user questions recently, it became apparent that OLMv0 interpretation of an upgrade graph includes some interpretation mechanics which aren't well-communicated. These mechanics can result in some user stranding on operator versions because of ignored graph contributions.

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

Copy link
Contributor

openshift-ci bot commented Aug 15, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 15, 2025
@grokspawn grokspawn marked this pull request as ready for review August 18, 2025 16:29
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 18, 2025
@openshift-ci openshift-ci bot requested review from anik120 and kevinrizza August 18, 2025 16:30
@grokspawn grokspawn force-pushed the v0-graph-mechanics branch 2 times, most recently from 0e8cfc1 to 7d3cf25 Compare August 18, 2025 17:37
Copy link

codecov bot commented Aug 18, 2025

Codecov Report

❌ Patch coverage is 78.26087% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.24%. Comparing base (3212635) to head (f1c21be).
⚠️ Report is 22 commits behind head on master.

Files with missing lines Patch % Lines
alpha/declcfg/write.go 78.26% 17 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1744      +/-   ##
==========================================
+ Coverage   55.17%   55.24%   +0.06%     
==========================================
  Files         136      136              
  Lines       15918    15971      +53     
==========================================
+ Hits         8783     8823      +40     
- Misses       5982     5993      +11     
- Partials     1153     1155       +2     

☔ 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.

pkgBuilder.WriteString(fmt.Sprintf(" %%%% channel %q\n", filteredChannel.Name))
pkgBuilder.WriteString(fmt.Sprintf(" subgraph %s[%q]\n", channelID, filteredChannel.Name))
fmt.Fprintf(pkgBuilder, " %%%% channel %q\n", filteredChannel.Name)
fmt.Fprintf(pkgBuilder, " subgraph %s[%q]\n", channelID, filteredChannel.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@bentito
Copy link
Contributor

bentito commented Aug 19, 2025

When I run this, even if I try to send 2 to /dev/null, I can't get the warnings out of my way to send the graph output to, for instance, mermaid:

bin/opm alpha render-graph quay.io/operatorhubio/catalog:latest|head 2>/dev/null

edit: the above command is wrong, stderr is correctly used, but maybe we should give an example in comments of redirecting as needed:

bin/opm alpha render-graph quay.io/operatorhubio/catalog:latest 2>/dev/null | 

@grokspawn
Copy link
Contributor Author

grokspawn commented Aug 19, 2025

@bentito I think trying to graph an entire catalog will not function properly (though I'd love to see the warnings readout). You would want to limit to a single package, and possibly a lower version range via flags.

I generated customized FBC here, based on a semver catalog template expansion. (Original report here )
I have all the artifacts along the way at https://gist.github.com/grokspawn/e822d025f6718428f08efc2bd02a0d9d

The only missing detail is that, since OPM handles FBC as a hierarchical filesystem, I had to drop the FBC into a directory to manipulate it.

For e.g.:

mkdir /tmp/c4
./bin/opm alpha render-template semver reproducer-semver.yaml > /tmp/c4/catalog.json

./bin/opm alpha render-graph /tmp/c4

@bentito
Copy link
Contributor

bentito commented Aug 20, 2025

lgtm

@grokspawn
Copy link
Contributor Author

/approve

Copy link
Contributor

openshift-ci bot commented Aug 20, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grokspawn

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 Aug 20, 2025
}
cmd.Flags().StringVar(&minEdge, "minimum-edge", "", "the channel edge to be used as the lower bound of the set of edges composing the upgrade graph; default is to include all edges")
cmd.Flags().StringVarP(&specifiedPackageName, "package-name", "p", "", "a specific package name to filter output; default is to include all packages in reference")
cmd.Flags().BoolVar(&includeV0Semantics, "include-v0-semantics", false, "whether to indicate OLMv0 semantics in the output; default is to simply represent the upgrade graph")
Copy link
Contributor

@camilamacedo86 camilamacedo86 Aug 20, 2025

Choose a reason for hiding this comment

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

My only concern is with the flag name and description
Could we try to clarify better
If I am adding the flag than I am including that already right?
What does it acctually means v0-semantics?
Maybe:

Suggested change
cmd.Flags().BoolVar(&includeV0Semantics, "include-v0-semantics", false, "whether to indicate OLMv0 semantics in the output; default is to simply represent the upgrade graph")
cmd.Flags().BoolVar(&includeV0Semantics, "--olmv0-semantics", false, "apply OLM v0 upgrade-graph semantics; mark skipped bundles and ignore edges from them when computing paths.")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR is the first pass of what I expect will be additional efforts to make how v0 uses upgrade graphs more transparent. I deliberately left the flag very general as a result. This is all in an alpha command chain, so we have a lot of freedom to change the flags in the future as the support improves.

render action.Render
minEdge string
specifiedPackageName string
includeV0Semantics bool
Copy link
Contributor

@camilamacedo86 camilamacedo86 Aug 20, 2025

Choose a reason for hiding this comment

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

What about we add a doc here to explain why it is required?
What does it means?
Maybe:

Suggested change
includeV0Semantics bool
// includeV0Semantics show and compute the upgrade graph the way OLM v0 behaves: if a bundle is
// marked as skipped (via skips or skipRange), ignore any upgrade edges coming from that bundle.
// This can reveal why some versions get “stuck.”
includeV0Semantics bool

}
cmd.Flags().StringVar(&minEdge, "minimum-edge", "", "the channel edge to be used as the lower bound of the set of edges composing the upgrade graph; default is to include all edges")
cmd.Flags().StringVarP(&specifiedPackageName, "package-name", "p", "", "a specific package name to filter output; default is to include all packages in reference")
cmd.Flags().BoolVar(&includeV0Semantics, "include-v0-semantics", false, "whether to indicate OLMv0 semantics in the output; default is to simply represent the upgrade graph")
Copy link
Member

Choose a reason for hiding this comment

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

My nit is s/include/use/ for the name of the flag/variable, etc.

"Include" implies multiple $things could be included, all contributing. Whereas "use" has more of a mutual exclusive feel, which I think is more of what we're going for? I also notice that the actual mermaid renderer uses "use" terminology, so this would have better overall alignment as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

I’d prefer to use that as well.
Sorry for being so nitpicky, but could you please include “ring a bell”?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated to make the flag naming consistent across the front- & back-ends.

I don't understand the "ring a bell" reference.

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 2629279 into operator-framework:master Aug 21, 2025
13 checks passed
@grokspawn grokspawn deleted the v0-graph-mechanics branch August 27, 2025 18:57
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.

4 participants