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

🌱 Refactor filter package #1734

Merged

Conversation

perdasilva
Copy link
Contributor

@perdasilva perdasilva commented Feb 10, 2025

Description

Refactors the catalogmetadata/filter package by:

  • moving the predicates to internal/util/filter
  • renaming the Filter function to RemoveInPlace to make it clear that function mutates the input
  • adding a non-input-mutating Filter function
  • moving Filter and RemoveInPlace to internal/util/slices
  • generalizing and complementing the slice filtering/removing unit tests

This was done as slice (and other) filtering is, generally, a useful thing to have and can be used throughout the code-base. I've been using it as part of go'fied rbac rendering tool (hacks/tools/catalog/generate-manifests) that I made to help me with the single/own namespace testing and RBAC scoping.

Reviewer Checklist

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

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 10, 2025
Copy link

netlify bot commented Feb 10, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 5034d99
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/67aaf8aa21ced50008d387d6
😎 Deploy Preview https://deploy-preview-1734--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.

Copy link

codecov bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.26%. Comparing base (c0a2964) to head (5034d99).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1734      +/-   ##
==========================================
+ Coverage   68.24%   68.26%   +0.02%     
==========================================
  Files          58       58              
  Lines        4988     4995       +7     
==========================================
+ Hits         3404     3410       +6     
- Misses       1342     1343       +1     
  Partials      242      242              
Flag Coverage Δ
e2e 52.74% <52.94%> (-0.19%) ⬇️
unit 55.49% <100.00%> (+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.

@perdasilva perdasilva force-pushed the fix-filter-and-util-packages branch 6 times, most recently from c7964fe to 2cc81ae Compare February 10, 2025 14:57
@perdasilva perdasilva changed the title 🐛 Fix filter implementation 🌱 Fix filter implementation Feb 10, 2025
@perdasilva perdasilva changed the title 🌱 Fix filter implementation 🌱 Refactor filter package Feb 10, 2025
@perdasilva perdasilva marked this pull request as ready for review February 10, 2025 15:05
@perdasilva perdasilva requested a review from a team as a code owner February 10, 2025 15:05
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 10, 2025
camilamacedo86
camilamacedo86 previously approved these changes Feb 10, 2025
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.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2025
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2025
@perdasilva perdasilva force-pushed the fix-filter-and-util-packages branch 4 times, most recently from a7cf57d to d5980c0 Compare February 11, 2025 07:13
Per Goncalves da Silva added 4 commits February 11, 2025 08:13
Signed-off-by: Per Goncalves da Silva <[email protected]>
Signed-off-by: Per Goncalves da Silva <[email protected]>
Signed-off-by: Per Goncalves da Silva <[email protected]>
Signed-off-by: Per Goncalves da Silva <[email protected]>
Signed-off-by: Per Goncalves da Silva <[email protected]>
@perdasilva perdasilva force-pushed the fix-filter-and-util-packages branch from d5980c0 to 5034d99 Compare February 11, 2025 07:13
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.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 11, 2025
@perdasilva perdasilva added this pull request to the merge queue Feb 11, 2025
Merged via the queue into operator-framework:main with commit 9864ba7 Feb 11, 2025
22 checks passed
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.

4 participants