Introduce new FilterType interface - #5423
Merged
Merged
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5423 +/- ##
=======================================
Coverage 80.95% 80.96%
=======================================
Files 1270 1270
Lines 33087 33083 -4
Branches 9917 9958 +41
=======================================
- Hits 26787 26786 -1
+ Misses 5618 5615 -3
Partials 682 682 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Extract a FilterType interface from the Filter class. The Filter class has several purposes and mixes responsibilities. Introducing a FilterType is the first step for splitting up the responsibilities.
All GMP requests return a filter. The structure of this retuned element is different from the structure returned by `<get_filters>`. Therefore both parts should be split too.
Use FilterType instead of Filter. Filter will be the class for the model returned by `<get_filters>` in future.
When creating a query the FilterType is expected now instead of the concrete Filter model class.
The FilterModelElement is only returned by `<get_filters>`.
Be more precise about what the function does.
The filter parse functions are used for get entities queries to return the applied filter of the backend.
All objects implementing the FilterType need to provide a length property.
Allow to pass in other FilterTypes.
This was already adapted in the Filter class.
The filter of both classes is a response filter and not a filter model.
Update all components already affected by the FilterType changes to fix type checking.
bjoernricks
marked this pull request as ready for review
July 16, 2026 06:45
bjoernricks
enabled auto-merge (rebase)
July 16, 2026 07:40
daniele-mng
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Introduce new FilterType interface
Why
Extract a FilterType interface from the Filter class. The Filter class has several purposes and mixes responsibilities. Introducing a FilterType is the first step for splitting up the responsibilities.
References
https://jira.greenbone.net/browse/GEA-1933
Checklist