Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚠ Status condition clean up #379

Merged
merged 3 commits into from
Sep 20, 2024

Conversation

anik120
Copy link
Collaborator

@anik120 anik120 commented Sep 6, 2024

RFC: ClusterCatalog Status Conditions implementation.

Closes 363 Closes 364 Closes 365

@anik120 anik120 requested a review from a team as a code owner September 6, 2024 12:36
@anik120 anik120 changed the title (feat) Status condition clean up ✨ Status condition clean up Sep 6, 2024
Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 97.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 36.05%. Comparing base (e1d3605) to head (e36d516).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...rnal/controllers/core/clustercatalog_controller.go 97.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #379      +/-   ##
==========================================
- Coverage   37.25%   36.05%   -1.20%     
==========================================
  Files          14       14              
  Lines         816      796      -20     
==========================================
- Hits          304      287      -17     
  Misses        463      463              
+ Partials       49       46       -3     

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

@anik120 anik120 changed the title ✨ Status condition clean up ⚠ Status condition clean up Sep 6, 2024
@grokspawn
Copy link
Contributor

Seems like we should also update here and here and update the demos.
If you prefer, we can do this as a follow-on issue, but we should generally strive to keep the demos up to date.

Copy link
Contributor

@ankitathomas ankitathomas left a comment

Choose a reason for hiding this comment

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

great work!

There are a few more mentions of the Unpacking condition we should probably clean up in the README.md, docs/fetching-catalog-contents.md, test/tools/imageregistry/pre-upgrade-setup.sh and hack/scripts/gzip-demo-script.sh and hack/scripts/demo-script.sh.

We'd want to at least update the pre-upgrade-setup script since that's part of upgrade testing, but it'd be good to keep everything else up to date

api/core/v1alpha1/clustercatalog_types.go Show resolved Hide resolved
@anik120
Copy link
Collaborator Author

anik120 commented Sep 6, 2024

great work!

There are a few more mentions of the Unpacking condition we should probably clean up in the README.md, docs/fetching-catalog-contents.md, test/tools/imageregistry/pre-upgrade-setup.sh and hack/scripts/gzip-demo-script.sh and hack/scripts/demo-script.sh.

We'd want to at least update the pre-upgrade-setup script since that's part of upgrade testing, but it'd be good to keep everything else up to date

Thanks for pointing this out @ankitathomas ! I updated most of it, except for the pre-upgrade-setup.sh file. Correct me if I'm wrong, but this has to remain unchanged in this PR, since main (pre this commit) still has the Unpacking condition, which mean the script will expect that condition. There needs to be a follow up PR, that has to change this script.

Or did I get that wrong? The pre-upgrade test is passing with this setting though....

Also, I'll look into the updating of the actual demo file after lunch, but for now I ran into this issue, not sure if @grokspawn can help

make demo-update           
hack/scripts/generate-asciidemo.sh
hack/scripts/generate-asciidemo.sh: line 40: [: /var/folders/9p/q0l_ddk11jqd05vb098xk9f40000gn/T/d.mVVVtAWPPU: binary operator expected
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5481  100  5481    0     0  17382      0 --:--:-- --:--:-- --:--:-- 17400
curl: (6) Could not resolve host: generate-asciidemo.DTJEN
chmod: generate-asciidemo.DTJEN/asciinema-rec_script: Not a directory
/var/folders/9p/q0l_ddk11jqd05vb098xk9f40000gn/T/d.mVVVtAWPPU: line 155: generate-asciidemo.DTJEN/asciinema-rec_script: Not a directory
asciinema: /Users/anbhatta/go/src/github.com/operator-framework/catalogd/hack/scripts/demo-script.sh already exists, aborting
asciinema: use --overwrite option if you want to overwrite existing recording
asciinema: use --append option if you want to append to existing recording
usage: asciinema [-h] [--version] {rec,play,cat,upload,auth} ...
asciinema: error: unrecognized arguments: generate-asciidemo.DTJEN/catalogd-demo.cast
hack/scripts/generate-asciidemo.sh: line 17: [: /var/folders/9p/q0l_ddk11jqd05vb098xk9f40000gn/T/d.mVVVtAWPPU: binary operator expected
make: *** [demo-update] Error 2

@ankitathomas
Copy link
Contributor

Everything looks good!

There needs to be a follow up PR, that has to change this script.

If we're ok with the test breaking before we're done with the API review work, it may be easier to have this change on your PR and cut a new release immediately after, but you're right - we can also update the upgrade-e2e script in a followup PR if we want to keep the test passing.

@grokspawn
Copy link
Contributor

make demo-update
hack/scripts/generate-asciidemo.sh
hack/scripts/generate-asciidemo.sh: line 40: [: /var/folders/9p/q0l_ddk11jqd05vb098xk9f40000gn/T/d.mVVVtAWPPU: binary operator expected
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5481 100 5481 0 0 17382 0 --:--:-- --:--:-- --:--:-- 17400
curl: (6) Could not resolve host: generate-asciidemo.DTJEN
chmod: generate-asciidemo.DTJEN/asciinema-rec_script: Not a directory

This looks like your bash env wasn't able to test if the tempdir exists here.
You'd have to see why that test is failing.

@grokspawn
Copy link
Contributor

Correct me if I'm wrong, but this has to remain unchanged in this PR

IMO, we're making these changes in full awareness that we are breaking the API. We have opted not to create an interim API version to avoid it, and in the past we've committed and tried to cut a new release of the component to get the test passing again.

@ankitathomas ankitathomas force-pushed the remove-upack-delete branch 2 times, most recently from 7760e8d to 7d2f636 Compare September 10, 2024 17:56
everettraven
everettraven previously approved these changes Sep 10, 2024
Copy link
Collaborator

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

These changes LGTM, but we should probably get @grokspawn and @joelanford to do a final pass as well prior to merging

@anik120
Copy link
Collaborator Author

anik120 commented Sep 18, 2024

@ankitathomas fyi I removed the changes to the demo scripts and related stuff. The cognitive load required for review was probably getting a little heavier because of those changes, at least for me. We'll most definitely have more high quality reviews on the changes you want to make there if we put it up as a separate PR anyway.

@anik120
Copy link
Collaborator Author

anik120 commented Sep 18, 2024

@ankitathomas @joelanford @everettraven ready for review again.

}
updateStatusNotServing(&catalog.Status)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we add a comment here that talks about the issue that we encountered when we both modified the status and the ClusterCatalog finalizers? I think that issue still exists, we just won't hot-loop because of Joe's change and we would end up setting the status to the same thing (i.e no change) so we end up successfully removing the finalizer on the second reconcile.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created #409. I don't think we need a TODO comment here besides the issue

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 19, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 19, 2024
@anik120 anik120 force-pushed the remove-upack-delete branch 2 times, most recently from 750f545 to 32dd761 Compare September 19, 2024 13:13
@anik120
Copy link
Collaborator Author

anik120 commented Sep 19, 2024

codecov/project is complaining about a test not being included for the panic being introduced, that replaced dead/unused code (unpacking related) from main

README.md Outdated Show resolved Hide resolved
anik120 and others added 2 commits September 19, 2024 16:01
[RFC: ClusterCatalog Status Conditions](https://docs.google.com/document/d/1Kg8ovX8d25OqGa5utwcKbX3nN3obBl2KIYJHYz6IlKU/edit) implementation.

Closes [363](operator-framework#363)
Closes [364](operator-framework#364)
Closes [365](operator-framework#365)

Co-authored-by: Ankita Thomas <ankithom@redhat.com>
Co-authored-by: Anik Bhattacharjee <anbhatta@redhat.com>
Signed-off-by: Todd Short <todd.short@me.com>
@@ -308,10 +280,13 @@ func NewFinalizers(localStorage storage.Instance, unpacker source.Unpacker) (crf
panic("could not convert object to clusterCatalog")
}
if err := localStorage.Delete(catalog.Name); err != nil {
return crfinalizer.Result{}, updateStatusStorageDeleteError(&catalog.Status, err)
updateStatusProgressing(catalog, err)
return crfinalizer.Result{}, err
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to return crfinalizer.Result{StatusUpdated: true} on any code path that changes the status conditions. Otherwise, I'm not sure we fall into the if finalizeResult.Updated || finalizeResult.StatusUpdated block in line 130.

Signed-off-by: Todd Short <todd.short@me.com>
@joelanford joelanford added this pull request to the merge queue Sep 20, 2024
Merged via the queue into operator-framework:main with commit 2dc04d9 Sep 20, 2024
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants