Skip to content

⚠ REMOVE extension api from main branch - #820

Merged
everettraven merged 1 commit into
operator-framework:mainfrom
acmenezes:remove_extension
May 14, 2024
Merged

⚠ REMOVE extension api from main branch#820
everettraven merged 1 commit into
operator-framework:mainfrom
acmenezes:remove_extension

Conversation

@acmenezes

Copy link
Copy Markdown
Contributor

Description

The intent is to remove this API and its controllers for the v1.0.0 release. Once we've released 1.0.0, we plan to re-introduce the Extension API and controllers.

@joelanford, please take a look and tell me if that's what you had in mind. I did a flat removal of all the references to the api as well. Didn't try to circumvent or redesign around any errors. Any suggestions or changes are welcomed. Saving this as a draft PR to be safe.

My question, and I think it's an important one, would we pull the main branch's code to some secondary branch as a reference for after v1.0.0 before merging this if we plan to reintroduce it?

Solves #735

Reviewer Checklist

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

@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 May 2, 2024
@netlify

netlifyBot commented May 2, 2024

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

NameLink
🔨 Latest commit5f83813
🔍 Latest deploy loghttps://app.netlify.com/sites/olmv1/deploys/66437b470d70e70008b3e7a8
😎 Deploy Previewhttps://deploy-preview-820--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 site configuration.

@codecov

codecovBot commented May 2, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 66.66667% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 81.80%. Comparing base (6d73b73) to head (ca00f4a).

FilesPatch %Lines
...nternal/controllers/clusterextension_controller.go57.14%4 Missing and 2 partials ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #820 +/- ##
===========================================
+ Coverage 71.02% 81.80% +10.78% 
===========================================
Files 17 15 -2 Lines 1301 907 -394 ===========================================
- Hits 924 742 -182 + Misses 304 120 -184 + Partials 73 45 -28 
FlagCoverage Δ
e2e59.75% <61.11%> (+17.02%)⬆️
unit73.76% <66.66%> (+10.16%)⬆️

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.

@openshift-merge-robotopenshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 2, 2024
@joelanford

Copy link
Copy Markdown
Member

I don't think we need to save the code off. The git history is there, so we can just come back to the commit prior to this PR if necessary.

But I suspect we don't even do that. I think it is more likely that we'll essentially copy ClusterExtension back over to Extension and make the few tweaks necessary for it to work as a namespace-scoped API. And we'll do a similar thing for the controller.

Comment on lines -124 to -130
// +optional
InstalledBundle *BundleMetadata `json:"installedBundle,omitempty"`
// +optional
ResolvedBundle *BundleMetadata `json:"resolvedBundle,omitempty"`

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.

These should stay. If BundleMetadata is defined in extension_types.go, let's move those definitions to this file.

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.

Done.

Comment threadconfig/rbac/role.yaml
Comment on lines -32 to -33
- apiGroups:
- kappctrl.k14s.io

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.

We should remove the kapp dependency (I think you'll see breadcrumbs in Makefile and the install script template).

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.

Cool. Thanks I will check on that one yet.

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.

Hi @joelanford , I finally removed kapp from Makefile, install scripts and also from the scheme package I put on the last PR. I guess that should cover it. Let me know.

// Lookup the bundle that corresponds to the ClusterExtension's desired package.
bundle, err := r.resolve(ctx, ext)
if err != nil {
ext.Status.InstalledBundle = nil

@joelanfordjoelanfordMay 3, 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.

Re: keeping these fields in ClusterExtension, we also want to keep the ClusterExtension reconciler logic intact.

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.

Ok. Ack. Keeping it intact.

Comment threadinternal/controllers/common_controller.go
@openshift-merge-robotopenshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 3, 2024
TypePackageDeprecated,
TypeChannelDeprecated,
TypeBundleDeprecated,
TypeProgressing,

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.

Unit tests are probably failing due to the Progressing type being added to the set of conditions but it never being set on the ClusterExtension during the reconciliation process.

I would keep the type definitions for the condition and reasons but would remove them from the list here. IMO to keep the scope of this PR small, the implementation/usage of them should take place in #747

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.

Hi @everettraven , actually it will fail another test and ask me to add it to the list. What I did was adding that to the list but then it requires me to actually set progressing status in the ClusterExtension controller. That part I'm honestly not sure if I did right. I appreciate some eyes on this. On the other hand if you really want to keep the type out of the list of conditions sets then we may have to change some tests. Happy to go either way. I count on your directions here.

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.

Oh that is interesting. I didn't realize there was a test that we had the ensured those constants are added to the conditionsets.

I'm not sure this is really a valuable test for us at the moment. I'm not sure what the best path forward here is personally, maybe:

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.

Makes sense. I think we can talk about it on our meeting on Tuesday.

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.

actually it will fail another test and ask me to add it to the list.

What was the specific test failure? I think @everettraven is correct that we should be able to let this status condition type be completely removed since it is currently only present in the Extension API.

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.

@joelanford I think it is these test cases:

funcTestClusterExtensionTypeRegistration(t*testing.T) {
types, err:=parseConstants("Type")
iferr!=nil {
t.Fatalf("unable to parse Type constants %v", err)
}
for_, tt:=rangetypes {
if!slices.Contains(conditionsets.ConditionTypes, tt) &&!slices.Contains(conditionsets.ExtensionConditionTypes, tt) {
t.Errorf("append Type%s to conditionsets.ConditionTypes in this package's init function", tt)
}
}
for_, tt:=rangeconditionsets.ConditionTypes {
if!slices.Contains(types, tt) {
t.Errorf("there must be a Type%[1]s string literal constant for type %[1]q (i.e. 'const Type%[1]s = %[1]q')", tt)
}
}
for_, tt:=rangeconditionsets.ExtensionConditionTypes {
if!slices.Contains(types, tt) {
t.Errorf("there must be a Type%[1]s string literal constant for type %[1]q (i.e. 'const Type%[1]s = %[1]q')", tt)
}
}
}
funcTestClusterExtensionReasonRegistration(t*testing.T) {
reasons, err:=parseConstants("Reason")
iferr!=nil {
t.Fatalf("unable to parse Reason constants %v", err)
}
for_, r:=rangereasons {
if!slices.Contains(conditionsets.ConditionReasons, r) &&!slices.Contains(conditionsets.ExtensionConditionReasons, r) {
t.Errorf("append Reason%s to conditionsets.ConditionReasons in this package's init function.", r)
}
}
for_, r:=rangeconditionsets.ConditionReasons {
if!slices.Contains(reasons, r) {
t.Errorf("there must be a Reason%[1]s string literal constant for reason %[1]q (i.e. 'const Reason%[1]s = %[1]q')", r)
}
}
for_, r:=rangeconditionsets.ExtensionConditionReasons {
if!slices.Contains(reasons, r) {
t.Errorf("there must be a Reason%[1]s string literal constant for reason %[1]q (i.e. 'const Reason%[1]s = %[1]q')", r)
}
}
}

@everettraveneverettraven left a comment

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.

IMO the lint failures can be addressed via a //nolint:unused comment for now and be updated in #747 when they are used again.

This should help keep the scope of this PR smaller

@acmenezes
acmenezesforce-pushed the remove_extension branch 6 times, most recently from ca00f4a to b82812eCompareMay 7, 2024 20:33
@acmenezes

Copy link
Copy Markdown
ContributorAuthor

IMO the lint failures can be addressed via a //nolint:unused comment for now and be updated in #747 when they are used again.

This should help keep the scope of this PR smaller

@everettraven good idea. I just added the comments there. I think no more lint issues are found. Thanks.

@varshaprasad96varshaprasad96 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.

Comment on lines +34 to +35
ReasonFailedToReachDesiredIntent = "FailedToReachDesiredIntent"
ReasonReachedDesiredIntent = "ReachedDesiredIntent"

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.

IIRC these were related to upgrades and being used in extension-controller. These can be removed too.

@acmenezes
acmenezes marked this pull request as ready for review May 14, 2024 15:24
@acmenezes
acmenezes requested a review from a team as a code ownerMay 14, 2024 15:24
@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 May 14, 2024

@everettraveneverettraven left a comment

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.

LGTM! Great work @acmenezes !

@varshaprasad96varshaprasad96 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.

/lgtm
/approve

@openshift-ciopenshift-ciBot added the lgtm Indicates that a PR is ready to be merged. label May 14, 2024
@everettraven
everettraven added this pull request to the merge queue May 14, 2024
Merged via the queue into operator-framework:main with commit a458282May 14, 2024
@acmenezesacmenezes mentioned this pull request Jun 5, 2024
4 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtmIndicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@acmenezes@joelanford@everettraven@varshaprasad96@openshift-merge-robot