Skip to content

fix: facts being gathered unnecessarily#163

Merged
richm merged 1 commit intolinux-system-roles:mainfrom
richm:sort-required-facts-plus-subsets
Jul 14, 2023
Merged

fix: facts being gathered unnecessarily#163
richm merged 1 commit intolinux-system-roles:mainfrom
richm:sort-required-facts-plus-subsets

Conversation

@richm
Copy link
Copy Markdown
Collaborator

@richm richm commented Jul 13, 2023

Cause: The comparison of the present facts with the required facts is
being done on unsorted lists.

Consequence: The comparison may fail if the only difference is the
order. Facts are gathered unnecessarily.

Fix: Use difference which works no matter what the order is. Ensure
that the fact gathering subsets used are the absolute minimum required.

Result: The role gathers only the facts it requires, and does
not unnecessarily gather facts.

Signed-off-by: Rich Megginson rmeggins@redhat.com

Cause: The comparison of the present facts with the required facts is
being done on unsorted lists.

Consequence: The comparison may fail if the only difference is the
order.  Facts are gathered unnecessarily.

Fix: Use `difference` which works no matter what the order is.  Ensure
that the fact gathering subsets used are the absolute minimum required.

Result: The role gathers only the facts it requires, and does
not unnecessarily gather facts.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 13, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (a9931af) 72.66% compared to head (32d9a38) 72.66%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #163   +/-   ##
=======================================
  Coverage   72.66%   72.66%           
=======================================
  Files           1        1           
  Lines         450      450           
=======================================
  Hits          327      327           
  Misses        123      123           
Flag Coverage Δ
sanity ∅ <ø> (∅)

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

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@richm
Copy link
Copy Markdown
Collaborator Author

richm commented Jul 14, 2023

[citest]

@richm richm merged commit 9f4423c into linux-system-roles:main Jul 14, 2023
@richm richm deleted the sort-required-facts-plus-subsets branch July 14, 2023 21:42
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.

1 participant