Skip to content

HMS-11196: remove default filters for /systems - #2302

Merged
Dugowitch merged 1 commit into
RedHatInsights:masterfrom
Dugowitch:sys-filter
Aug 18, 2026
Merged

Dugowitch merged 1 commit into
RedHatInsights:masterfrom
Dugowitch:sys-filter

Conversation

@Dugowitch

@Dugowitch Dugowitch commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Could not find a reason why they were added; perhaps it was some historic reason or just because it seemed logical at that time. The reason for removal is that in multiple places in FE, there is explicit filter for stale=in:true,false to counteract this. Moreover, I could not identify a single consumer that benefits from this default filter being set.

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

Summary by Sourcery

Remove the default stale=false filter from the /systems listing while keeping sort and field configuration unchanged.

Enhancements:

  • Update systems controller options to no longer inject an implicit stale=false filter into queries.
  • Adjust systems controller tests and metadata expectations to reflect the absence of the default stale filter in links and meta filters.

Could not find a reason why they were added; perhaps it was some
historic reason or just because it seemed logical at that time. The
reason for removal is that in multiple places in FE, there is explicit
filter for stale=in:true,false to counteract this. Moreover, I could not
identify a single consumer that benefits from this default filter being
set.
@sourcery-ai

sourcery-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR removes the implicit stale=false default filter from the /systems list options and updates tests so pagination links and metadata filters no longer include stale by default, making stale filtering fully client-controlled.

File-Level Changes

Change Details Files
Remove the default stale=false filter from /systems list options so the API no longer filters out stale systems implicitly.
  • Deleted the DefaultFilters configuration from SystemOpts that enforced stale eq:false.
  • Kept other list options intact, including selected fields, default sort on -last_upload, stable sort, and search fields.
manager/controllers/systems.go
Align systems controller tests with the new behavior where stale is not included in links or metadata filters unless explicitly requested by clients.
  • Updated pagination link expectations in TestSystemsDefault to omit filter[stale]=eq:false from first/last links.
  • Removed stale filter entries from expected Meta.Filter maps across various system_profile filter tests (SAP, AAP, MSSQL, Crowdstrike, IBM Db2, Intersystems, Oracle DB, RHEL AI, Satellite).
manager/controllers/systems_test.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.83%. Comparing base (091bc37) to head (244c5e3).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2302   +/-   ##
=======================================
  Coverage   58.83%   58.83%           
=======================================
  Files         150      150           
  Lines        9599     9599           
=======================================
  Hits         5648     5648           
  Misses       3359     3359           
  Partials      592      592           
Flag Coverage Δ
unittests 58.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@Dugowitch
Dugowitch marked this pull request as ready for review August 12, 2026 13:31
@Dugowitch
Dugowitch requested a review from a team as a code owner August 12, 2026 13:31

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@MichaelMraka MichaelMraka self-assigned this Aug 17, 2026
@Dugowitch
Dugowitch merged commit ee7ca24 into RedHatInsights:master Aug 18, 2026
8 checks passed
@Dugowitch
Dugowitch deleted the sys-filter branch August 18, 2026 08:28
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.

3 participants