Skip to content

🐛 desired state in applier #1539

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

Conversation

azych
Copy link
Contributor

@azych azych commented Jan 1, 2025

A few minor fixes:

  1. internal/applier/helm.go:getReleaseState() contained two if blocks that handled driver.ErrReleaseNotFound with the first one returning, which meant the second block would never run.

    Additionally, the first handler always returned a nil desiredState causing the only currently used Preflight validator (crdupgradesafety) and potentially others in the future to exit immediately because of not having anything to validate.

    This fix leaves only the second handler block in, which actually triggers a dry-run installation and is able to return a proper desiredState that any Preflight validation can work with. It also has the added benefit of potentially spotting any issues and exiting earlier in case the dry-run failed.

2. hack/tools/catalogs/download-catalog script - changes the name of the catalogd service from catalogd-server to the currently used catalogd-service.

3. hack/tools/catalogs/list-compatible-bundles script - adds the missing extract-olm-package-property function to the call chain and uses the correct name of regex filtering function (filter-by-regex-if-necessary), making sure the script works.
The main issues here were two:
1. regex_it did not exist and was renamed during review of the original PR to filter-by-regex-if-necessary
2. extract-olm-package-property call was missing from the chain meaning the filter function couldn't recognize the structure it was expecting

Fixes to hack/tools/catalogs/ scripts have been separated from this PR into PRs of their own: #1546 and #1545 as per #1539 (comment)

Reviewer Checklist

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

@azych azych requested a review from a team as a code owner January 1, 2025 19:12
Copy link

netlify bot commented Jan 1, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 8060281
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/677f82b3bc03dc000844e89a
😎 Deploy Preview https://deploy-preview-1539--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.

@azych azych force-pushed the fix-desiredState-in-applier-and-some-hack-scripts-issues branch from d6a06d3 to c5c48bc Compare January 3, 2025 15:58
@camilamacedo86 camilamacedo86 self-requested a review January 4, 2025 01:14
@azych azych changed the title 🐛 Fix desired state in applier and some hack scripts issues 🐛 desired state in applier Jan 7, 2025
@azych azych force-pushed the fix-desiredState-in-applier-and-some-hack-scripts-issues branch from b7b70ca to 52fd265 Compare January 7, 2025 09:30
@azych azych force-pushed the fix-desiredState-in-applier-and-some-hack-scripts-issues branch 2 times, most recently from 313ce3d to 8ef484b Compare January 7, 2025 15:45
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.64%. Comparing base (5b5ccab) to head (8060281).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1539      +/-   ##
==========================================
+ Coverage   74.25%   75.64%   +1.38%     
==========================================
  Files          42       42              
  Lines        3329     3326       -3     
==========================================
+ Hits         2472     2516      +44     
+ Misses        676      638      -38     
+ Partials      181      172       -9     
Flag Coverage Δ
e2e 52.73% <0.00%> (+0.61%) ⬆️
unit 59.80% <100.00%> (+2.81%) ⬆️

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.

Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

HI @azych

That seems great !!!
Well done 🥇
Really thank you for adding the tests.

Just a small nits and questions.

@azych azych force-pushed the fix-desiredState-in-applier-and-some-hack-scripts-issues branch from 8ef484b to 261bc08 Compare January 8, 2025 08:51
@azych azych force-pushed the fix-desiredState-in-applier-and-some-hack-scripts-issues branch from 261bc08 to 8060281 Compare January 9, 2025 08:02
@azych
Copy link
Contributor Author

azych commented Jan 9, 2025

@camilamacedo86 @joelanford @bentito
I've just squashed the changes and the fix should be ready to go. Please take a look and approve.

I think any potential discussion about #1539 (comment) should not be a blocker and can be had outside (maybe on an issue?) if necessary, WDYT?

Copy link
Contributor

@camilamacedo86 camilamacedo86 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 🥇
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 9, 2025
Copy link
Contributor

@perdasilva perdasilva left a comment

Choose a reason for hiding this comment

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

looks awesome! Thanks for the thorough unit testing ^^

@perdasilva perdasilva added this pull request to the merge queue Jan 9, 2025
Merged via the queue into operator-framework:main with commit 6809614 Jan 9, 2025
19 checks passed
@azych azych deleted the fix-desiredState-in-applier-and-some-hack-scripts-issues branch January 9, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants