Skip to content

Introduce new FilterType interface - #5423

Merged
bjoernricks merged 18 commits into
mainfrom
filter-type
Jul 16, 2026
Merged

Introduce new FilterType interface#5423
bjoernricks merged 18 commits into
mainfrom
filter-type

Conversation

@bjoernricks

@bjoernricks bjoernricks commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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

  • Tests

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA c3d2db5.
Ensure 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 Files

None

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.85950% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.96%. Comparing base (e7924bd) to head (c3d2db5).

Files with missing lines Patch % Lines
src/web/components/powerfilter/PowerFilter.tsx 40.00% 2 Missing and 1 partial ⚠️
src/web/pages/reports/details/error/ErrorsTab.tsx 40.00% 3 Missing ⚠️
src/gmp/commands/entities.ts 33.33% 2 Missing ⚠️
src/gmp/commands/reports.ts 0.00% 2 Missing ⚠️
src/web/entities/EntitiesContainer.tsx 80.00% 2 Missing ⚠️
...es/reports/details/application/ApplicationsTab.tsx 50.00% 2 Missing ⚠️
...rc/web/pages/reports/details/cve/ClosedCvesTab.tsx 50.00% 2 Missing ⚠️
src/web/pages/reports/details/cve/CvesTab.tsx 50.00% 2 Missing ⚠️
src/gmp/commands/resource-names.ts 0.00% 1 Missing ⚠️
src/web/hooks/use-query/agents.ts 80.00% 0 Missing and 1 partial ⚠️
... and 8 more
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.
@bjoernricks
bjoernricks marked this pull request as ready for review July 16, 2026 06:45
@bjoernricks
bjoernricks requested a review from a team as a code owner July 16, 2026 06:45
@bjoernricks
bjoernricks enabled auto-merge (rebase) July 16, 2026 07:40
@bjoernricks
bjoernricks merged commit 23f5b53 into main Jul 16, 2026
26 of 27 checks passed
@bjoernricks
bjoernricks deleted the filter-type branch July 16, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants