Skip to content

Split different Filter parsing#5425

Merged
bjoernricks merged 2 commits into
mainfrom
filter-response-element
Jul 16, 2026
Merged

Split different Filter parsing#5425
bjoernricks merged 2 commits into
mainfrom
filter-response-element

Conversation

@bjoernricks

Copy link
Copy Markdown
Contributor

What

Split different Filter parsing

Why

Split parsing filter responses from filter model responses. Filter model responses are returned by <get_filters> only. Filter responses are included in all other <get_xyz> responses to define which filter has been used for the query.

For example <get_tasks> returns the following XML structure

<get_tasks_response status="200" status_text="OK">
  <task id="...">
    ...
  </task>
  <filters id="">
    <term>first=1 rows=10 sort=name</term>
      <keywords>
        <keyword>
          <column>first</column>
          <relation>=</relation>
          <value>1</value>
        </keyword>
        <keyword>
          <column>rows</column>
          <relation>=</relation>
          <value>10</value>
        </keyword>
        <keyword>
          <column>sort</column>
          <relation>=</relation>
          <value>name</value>
        </keyword>
      </keywords>
  </filters>
</get_tasks_response>

This XML structure is now parsed by fromResponseElement.

A <get_filters> XML response looks like

<get_filters_response status="200" status_text="OK">
  <filter id="..">
      ...
    <type>task</type>
    <term>apply_overrides=0 min_qod=70 sort=name first=1 rows=1</term>
  </filter>
  ...
</get_filters_response>

This structure is parsed by Filter.fromElement.

References

https://jira.greenbone.net/browse/GEA-1933

Checklist

  • Tests

@github-actions

github-actions Bot commented Jul 16, 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 f98ce00.
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

The former fromElement method of the Filter model did mix parsing of
different XML responses. First for the `<get_filters>` responses and
second for all filters included in all other get responses like
`<get_tasks>`.
@bjoernricks
bjoernricks force-pushed the filter-response-element branch from 9cf8978 to f98ce00 Compare July 16, 2026 10:20
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.97%. Comparing base (23f5b53) to head (f98ce00).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5425   +/-   ##
=======================================
  Coverage   80.96%   80.97%           
=======================================
  Files        1270     1270           
  Lines       33083    33090    +7     
  Branches     9913     9963   +50     
=======================================
+ Hits        26786    26793    +7     
  Misses       5615     5615           
  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.

@bjoernricks
bjoernricks marked this pull request as ready for review July 16, 2026 10:35
@bjoernricks
bjoernricks requested a review from a team as a code owner July 16, 2026 10:35
@bjoernricks
bjoernricks enabled auto-merge (rebase) July 16, 2026 10:35
@bjoernricks
bjoernricks merged commit 5224a97 into main Jul 16, 2026
27 checks passed
@bjoernricks
bjoernricks deleted the filter-response-element branch July 16, 2026 11:01
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