Manage compliance status if policy only assigned to hostgroup#613
Merged
Conversation
adamruzicka
reviewed
Jun 23, 2026
435200c to
36f80b1
Compare
adamruzicka
reviewed
Jun 24, 2026
adamruzicka
left a comment
Contributor
There was a problem hiding this comment.
Could we also get a redmine?
36f80b1 to
09f952b
Compare
09f952b to
3565b4d
Compare
There was a problem hiding this comment.
Pull request overview
Updates compliance status evaluation so hosts inherit compliance policy applicability from hostgroups (including inherited hostgroup policies), ensuring compliance status is recalculated even when no policies are assigned directly to the host.
Changes:
- Switch compliance status relevance check from
host.policiestohost.combined_policies. - Switch compliance status calculation input set from
host.policiestohost.combined_policies(host + hostgroup + inherited).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| def to_status(options = {}) | ||
| latest_reports = host.policies.map { |p| host.last_report_for_policy p }.flatten | ||
| latest_reports = host.combined_policies.map { |p| host.last_report_for_policy p }.flatten |
3565b4d to
eb53eee
Compare
…stgroup If a host doesn't have policies assigned directly, but only via hostgroup, it still should re-calculate the compliance status.
eb53eee to
e0d9dc2
Compare
Contributor
Author
|
@adamruzicka good to merge? |
Contributor
|
Thank you @sbernhard ! |
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.
If a host doesn't have policies assigned directly, but only via hostgroup, it still should re-calculate the compliance status.