Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

⚠️ API updates based on external review - #443

Merged
m1kola merged 1 commit into
operator-framework:mainfrom
everettraven:apis/external-review
Nov 7, 2024
Merged

⚠️ API updates based on external review#443
m1kola merged 1 commit into
operator-framework:mainfrom
everettraven:apis/external-review

Conversation

@everettraven

Copy link
Copy Markdown
Collaborator

No description provided.

@openshift-ciopenshift-ciBot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 22, 2024
Comment threadapi/core/v1alpha1/clustercatalog_types.go Outdated
Comment threadapi/core/v1alpha1/clustercatalog_types.go
Comment threadapi/core/v1alpha1/clustercatalog_types.go
Comment threadapi/core/v1alpha1/clustercatalog_types.go Outdated
Comment threadapi/core/v1alpha1/clustercatalog_types.go Outdated
Comment on lines +194 to +195
// +kubebuilder:validation:XValidation:rule="isURL(self.base)",message="base must be a valid URL"
// +kubebuilder:validation:XValidation:rule="url(self.base).getScheme() == \"http\" || url(self.base).getScheme == \"https\"",message="scheme must be one of [http, https]"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can these go on the Base string definition instead of the struct?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Depending on where these validations end up, also be cognizant of the message. For example:

  • If the validation is on the ClusterCatalogURLs struct, then the message needs to reference the field base by name.
  • If the validation is on the Base string field, then the apiserver will construct a prefix on our message that includes the base field name. Therefore we don't need to repeat base in the message.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

I believe they have to go on the struct for CEL validations.

@everettraveneverettravenOct 28, 2024

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

I will update all the CEL messages to have a reference to the field.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

Turns out that you can do this and I totally overlooked that it could. I'm happy to move all CEL validations to the individual fields , where it makes sense, if that is preferred.

Comment threadapi/core/v1alpha1/clustercatalog_types.go Outdated
Comment threadapi/core/v1alpha1/clustercatalog_types.go Outdated
//
// When omitted, the image will not be polled for new content.
// +kubebuilder:validation:Format:=duration
// +kubebuilder:validation:Minimum:=1

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.

Would we want to start off with a higher minimum? 1 minute feels very frequent.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The higher we go, the longer our operator-controller e2e test for "do we automatically upgrade when a catalog poll finds new content?" will take.

If we can come up with a way to make that test execute faster, I could see increasing this minimum.

@codecov

codecovBot commented Nov 5, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 82.22222% with 8 lines in your changes missing coverage. Please review.

Project coverage is 38.23%. Comparing base (9cf2e70) to head (6d09548).
Report is 1 commits behind head on main.

Files with missing linesPatch %Lines
api/core/v1alpha1/zz_generated.deepcopy.go0.00%8 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #443 +/- ##
==========================================
+ Coverage 37.83% 38.23% +0.40% 
==========================================
Files 15 15 Lines 1208 1224 +16 ==========================================
+ Hits 457 468 +11 - Misses 701 706 +5 
Partials 50 50 

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

@everettraveneverettraven changed the title wip: first pass at API changes from external review⚠️ API updates based on external reviewNov 5, 2024
Comment threadapi/core/v1alpha1/clustercatalog_types.go Outdated
Comment threadapi/core/v1alpha1/clustercatalog_types.go Outdated
Comment threadapi/core/v1alpha1/clustercatalog_types.go Outdated
Comment threadapi/core/v1alpha1/clustercatalog_types.go
Comment threadapi/core/v1alpha1/clustercatalog_types.go Outdated
Comment threadapi/core/v1alpha1/clustercatalog_types.go Outdated
Comment threadapi/core/v1alpha1/clustercatalog_types.go Outdated
Comment threadapi/core/v1alpha1/clustercatalog_types.go Outdated
Comment threadapi/core/v1alpha1/clustercatalog_types_test.go Outdated
Comment threadapi/core/v1alpha1/clustercatalog_types_test.go Outdated
Comment threadapi/core/v1alpha1/clustercatalog_types_test.go
Comment threadinternal/controllers/core/clustercatalog_controller.go Outdated
Comment threadinternal/controllers/core/clustercatalog_controller_test.go Outdated
Comment threadinternal/controllers/core/clustercatalog_controller_test.go
Comment threadinternal/controllers/core/clustercatalog_controller_test.go
Comment threadinternal/source/containers_image.go Outdated
@everettraven
everettraven marked this pull request as ready for review November 6, 2024 17:04
@everettraven
everettraven requested a review from a team as a code ownerNovember 6, 2024 17:04
@openshift-ciopenshift-ciBot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 6, 2024
// These on-cluster components may do a variety of things with this information, such as
// presenting the content in a GUI dashboard or installing content from the catalog on the cluster.
// The catalog source must contain catalog metadata in the File-Based Catalog (FBC) format.
// For more information on FBC, see https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I hope that we have a way to know when these URL links break.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

We don't. I'm not sure it is the end of the world if they do break, but we control that docs site.

Comment threadapi/core/v1alpha1/clustercatalog_types.go Outdated
@everettraven

Copy link
Copy Markdown
CollaboratorAuthor

Note: go-apidiff and upgrade-e2e are expected to fail as we've made breaking changes to the API

joelanford
joelanford previously approved these changes Nov 6, 2024
// base is a cluster-internal URL that provides endpoints for
// accessing the content of the catalog.
//
// It is expected that client append the path for the endpoint they wish

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// It is expected that client append the path for the endpoint they wish
// It is expected that clients append the path for the endpoint they wish

// It is expected that client append the path for the endpoint they wish
// to access.
//
// Currently, only a single version of the is served and is accessible at the path

@joelanfordjoelanfordNov 6, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Currently, only a single version of the is served and is accessible at the path
// Currently, only a single API is served and is accessible at the path

// Currently, only a single version of the is served and is accessible at the path
// /api/v1.
//
// The endpoints served for v1 of the are:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// The endpoints served for v1 of the are:
// The endpoints served for the v1 API are:

joelanford
joelanford previously approved these changes Nov 6, 2024
Signed-off-by: everettraven <everettraven@gmail.com>
Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
m1kola
m1kola previously approved these changes Nov 7, 2024

@m1kolam1kola left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

make generate is missing it seems. Also we need to squash the commits. Other than that - I think it is ready to go.

@m1kola
m1kola dismissed stale reviews from joelanford and themself via 6d09548November 7, 2024 10:22
@m1kola
m1kolaforce-pushed the apis/external-review branch from 58b72ef to 6d09548CompareNovember 7, 2024 10:22

@m1kolam1kola left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did make generate and 22 squashed commits into 1.

@m1kola
m1kola added this pull request to the merge queueNov 7, 2024
Merged via the queue into operator-framework:main with commit 20acf03Nov 7, 2024
@m1kola

Copy link
Copy Markdown
Member

v0.36.0 includes this PR

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@everettraven@m1kola@joelanford@perdasilva@LalatenduMohanty