Skip to content

Add a message to Trust checks if not a trust agent/controller#367

Merged
rcritten merged 1 commit intofreeipa:masterfrom
rcritten:issue_85
Sep 15, 2025
Merged

Add a message to Trust checks if not a trust agent/controller#367
rcritten merged 1 commit intofreeipa:masterfrom
rcritten:issue_85

Conversation

@rcritten
Copy link
Collaborator

@rcritten rcritten commented Jul 18, 2025

Previously it would return an empty SUCCESS message because if the server is not an agent and/or controller role then there is nothing to do. So return a message that indicates this.

Note: this is a change in behavior. The test used to be skipped altogether so returned no result at all. Returning a result will help ensure that all tests were executed.

Fixes: #85

Summary by Sourcery

Return a success result with an explanatory message for all trust checks when the server is not a trust agent or controller, ensuring skipped tests still produce a result.

Enhancements:

  • Have each trust agent and controller plugin yield a SUCCESS result with a “Skipped. Not a trust agent/controller” message instead of silently skipping.

Tests:

  • Update trust-related tests to expect one SUCCESS result with the skip message instead of zero results for skipped scenarios.

Previously it would return an empty SUCCESS message because
if the server is not an agent and/or controller role then there
is nothing to do. So return a message that indicates this.

Note: this is a change in behavior. The test used to be skipped
altogether so returned no result at all. Returning a result will
help ensure that all tests were executed.

Fixes: freeipa#85

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @rcritten - I've reviewed your changes - here's some feedback:

  • Consider extracting the repeated skip logic (yielding Result(self, SUCCESS, …) and return) into a shared helper or base method so you don’t have to copy it into every check class.
  • Define the skip messages (e.g. “Skipped. Not a trust agent” / “Skipped. Not a trust controller”) as constants or via a helper function to guarantee consistency and simplify future updates.
  • Double-check message formatting (capitalization, punctuation) against project style guidelines to ensure the new SUCCESS messages are uniform across all checks.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the repeated skip logic (yielding Result(self, SUCCESS, …) and return) into a shared helper or base method so you don’t have to copy it into every check class.
- Define the skip messages (e.g. “Skipped. Not a trust agent” / “Skipped. Not a trust controller”) as constants or via a helper function to guarantee consistency and simplify future updates.
- Double-check message formatting (capitalization, punctuation) against project style guidelines to ensure the new SUCCESS messages are uniform across all checks.

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.

Copy link
Collaborator

@frasertweedale frasertweedale left a comment

Choose a reason for hiding this comment

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

Reviewed and tested. ACK.

@rcritten rcritten merged commit 6a5971b into freeipa:master Sep 15, 2025
7 checks passed
ssidhaye added a commit to ssidhaye/freeipa that referenced this pull request Nov 6, 2025
Previously the check would return an empty SUCCESS message.

This is an update to the integration test since this involves a
beahviour change

Related PR: freeipa/freeipa-healthcheck#367
Related JIRA: https://issues.redhat.com/browse/RHEL-112752

Signed-off-by: Sumedh Sidhaye <ssidhaye@redhat.com>
ssidhaye added a commit to ssidhaye/freeipa that referenced this pull request Nov 6, 2025
Previously the check would return an empty SUCCESS message.

This is an update to the integration test since this involves a
beahviour change

Related PR: freeipa/freeipa-healthcheck#367
Related JIRA: https://issues.redhat.com/browse/RHEL-112752

Signed-off-by: Sumedh Sidhaye <ssidhaye@redhat.com>
ssidhaye added a commit to ssidhaye/freeipa that referenced this pull request Nov 6, 2025
Previously the check would return an empty SUCCESS message.

This is an update to the integration test since this involves a
beahviour change

Related PR: freeipa/freeipa-healthcheck#367
Related JIRA: https://issues.redhat.com/browse/RHEL-112752

Signed-off-by: Sumedh Sidhaye <ssidhaye@redhat.com>
ssidhaye added a commit to ssidhaye/freeipa that referenced this pull request Nov 6, 2025
Previously the check would return an empty SUCCESS message.

This is an update to the integration test since this involves a
beahviour change

Related PR: freeipa/freeipa-healthcheck#367
Related JIRA: https://issues.redhat.com/browse/RHEL-112752

Signed-off-by: Sumedh Sidhaye <ssidhaye@redhat.com>
ssidhaye added a commit to ssidhaye/freeipa that referenced this pull request Nov 7, 2025
Previously the check would return an empty SUCCESS message.

This is an update to the integration test since this involves a
beahviour change

Related PR: freeipa/freeipa-healthcheck#367
Related JIRA: https://issues.redhat.com/browse/RHEL-112752

Signed-off-by: Sumedh Sidhaye <ssidhaye@redhat.com>
ssidhaye added a commit to ssidhaye/freeipa that referenced this pull request Nov 7, 2025
Previously the check would return an empty SUCCESS message.

This is an update to the integration test since this involves a
beahviour change

Related PR: freeipa/freeipa-healthcheck#367
Related JIRA: https://issues.redhat.com/browse/RHEL-112752

Signed-off-by: Sumedh Sidhaye <ssidhaye@redhat.com>
ssidhaye added a commit to ssidhaye/freeipa that referenced this pull request Nov 7, 2025
Previously the check would return an empty SUCCESS message.

This is an update to the integration test since this involves a
beahviour change

Related PR: freeipa/freeipa-healthcheck#367
Related JIRA: https://issues.redhat.com/browse/RHEL-112752

Signed-off-by: Sumedh Sidhaye <ssidhaye@redhat.com>
ssidhaye added a commit to ssidhaye/freeipa that referenced this pull request Nov 17, 2025
Previously the check would return an empty SUCCESS message.

This is an update to the integration test since this involves a
beahviour change

Related PR: freeipa/freeipa-healthcheck#367
Related JIRA: https://issues.redhat.com/browse/RHEL-112752

Signed-off-by: Sumedh Sidhaye <ssidhaye@redhat.com>
ssidhaye added a commit to ssidhaye/freeipa that referenced this pull request Nov 18, 2025
Previously the check would return an empty SUCCESS message.

This is an update to the integration test since this involves a
beahviour change

Related PR: freeipa/freeipa-healthcheck#367
Related JIRA: https://issues.redhat.com/browse/RHEL-112752

Signed-off-by: Sumedh Sidhaye <ssidhaye@redhat.com>
ssidhaye added a commit to ssidhaye/freeipa that referenced this pull request Nov 18, 2025
Previously the check would return an empty SUCCESS message.

This is an update to the integration test since this involves a
beahviour change

Related PR: freeipa/freeipa-healthcheck#367
Related JIRA: https://issues.redhat.com/browse/RHEL-112752

Signed-off-by: Sumedh Sidhaye <ssidhaye@redhat.com>
abbra pushed a commit to freeipa/freeipa that referenced this pull request Nov 20, 2025
…the check would return an empty SUCCESS message.

This is an update to the integration test since this involves a
beahviour change

Related PR: freeipa/freeipa-healthcheck#367
Related JIRA: https://issues.redhat.com/browse/RHEL-112752

Signed-off-by: Sumedh Sidhaye <ssidhaye@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
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.

Better handling of AD Trust checks when trust not installed/configured

2 participants