Skip to content

🌱 Refactor MakeCSV utility to builder pattern - #2244

Merged
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
perdasilva:refactor-makecsv
Oct 3, 2025
Merged

🌱 Refactor MakeCSV utility to builder pattern#2244
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
perdasilva:refactor-makecsv

Conversation

@perdasilva

Copy link
Copy Markdown
Contributor

Description

Since we moved the bundlefs test utility to the builder pattern, this PR moves the MakeCSV test utility to the builder pattern for consistency.

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@perdasilva
perdasilva requested a review from a team as a code ownerOctober 2, 2025 10:05
@netlify

netlifyBot commented Oct 2, 2025

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

NameLink
🔨 Latest commit9a18ee1
🔍 Latest deploy loghttps://app.netlify.com/projects/olmv1/deploys/68deaf801dd5f00008353dea
😎 Deploy Previewhttps://deploy-preview-2244--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecovBot commented Oct 2, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.43478% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.65%. Comparing base (fbd2e65) to head (9a18ee1).
⚠️ Report is 2 commits behind head on main.

Files with missing linesPatch %Lines
...kpak/util/testing/clusterserviceversion/builder.go80.43%9 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #2244 +/- ##
==========================================
+ Coverage 72.54% 72.65% +0.10% 
==========================================
Files 86 87 +1 Lines 8607 8593 -14 ==========================================
- Hits 6244 6243 -1 + Misses 1952 1940 -12 + Partials 411 410 -1 
FlagCoverage Δ
e2e38.70% <ø> (ø)
experimental-e2e45.68% <ø> (+0.16%)⬆️
unit57.80% <80.43%> (-0.04%)⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

b := source.FromBundle(
bundle.RegistryV1{
CSV: MakeCSV(WithInstallModeSupportFor(v1alpha1.InstallModeTypeAllNamespaces)),
CSV: csvbuilder.New().WithInstallModeSupportFor(v1alpha1.InstallModeTypeAllNamespaces).Build(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

to make it consistent with bundlefs.Builder() calls, how about that we also do csv.Builder() instance of csvbuilder.New()?

@perdasilvaperdasilvaOct 2, 2025

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

that was my original approach but csv is such a common variable name I didn't want to overload it with the package. Wdyt of csvbuilder.Builder()? That was my first alternative, but then it felt weird to have csvbuilder.Builder() - but maybe that's ok?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMHO, previously MakeCSV sounds also very generic/common, so I would go simply with csv.Builder() - adding redundant builder suffix does not bring much for clarity. Maybe to call the package clusterserviceversion and then we have clusterserviceversion.Builder()?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

feels so long though T_T

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I get that CSV is a particularity of this project. But, within this context, its widely used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I get that CSV is a particularity of this project. But, within this context, its widely used.

If so, then csv.Builder() is pretty clear then.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I've just gone for the original suggestion. I don't like csv because it's a common variable name for the csv.
csv := csv.Builder().Build() feels weird to me.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

We're just talking about some small test utility anyway.

@perdasilva
perdasilvaforce-pushed the refactor-makecsv branch 2 times, most recently from 9277daa to 459fab3CompareOctober 2, 2025 16:57
Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com>
@openshift-ciopenshift-ciBot added the lgtm Indicates that a PR is ready to be merged. label Oct 2, 2025
@tmshort

Copy link
Copy Markdown
Contributor

/approve

@openshift-ci

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pedjak, tmshort

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

The pull request process is described 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

@openshift-ciopenshift-ciBot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 3, 2025
@openshift-merge-bot
openshift-merge-botBot merged commit 35da385 into operator-framework:mainOct 3, 2025
25 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@perdasilva@tmshort@pedjak