Skip to content

test: do not restore service if final state not-found#286

Merged
richm merged 1 commit intolinux-system-roles:mainfrom
richm:test-do-not-restore-service-if-final-state-not-found
Jan 22, 2026
Merged

test: do not restore service if final state not-found#286
richm merged 1 commit intolinux-system-roles:mainfrom
richm:test-do-not-restore-service-if-final-state-not-found

Conversation

@richm
Copy link
Copy Markdown
Collaborator

@richm richm commented Jan 22, 2026

On some platforms, the final state of the service is reported as 'not-found' which causes
a failure when trying to manage the service.

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

Summary by Sourcery

Update service restore tests to skip services whose final state is reported as not-found.

Bug Fixes:

  • Prevent test failures by avoiding restore operations on services that end in a not-found state.

Tests:

  • Adjust restore_services_state test playbook to only manage services whose initial and final states are both valid and not not-found.

On some platforms, the final state of the service is reported as 'not-found' which causes
a failure when trying to manage the service.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
@richm richm requested a review from natoscott as a code owner January 22, 2026 16:18
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Jan 22, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the test playbook that validates service state restoration to also skip restoring services whose final state is reported as 'not-found', preventing failures on platforms that report terminated services this way.

File-Level Changes

Change Details Files
Extend the service-restore condition in the test so services with a final status of 'not-found' are not managed.
  • Add an additional when-condition to check that the final service status is not 'not-found' before attempting to manage it
  • Keep the existing checks on presence in initial/final facts and initial status condition intact
tests/restore_services_state.yml

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

@richm
Copy link
Copy Markdown
Collaborator Author

richm commented Jan 22, 2026

[citest]

Copy link
Copy Markdown

@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 - I've left some high level feedback:

  • The 'not-found' status check is now duplicated for both initial and final states; consider extracting this status into a shared variable or helper to avoid repetition and make future changes to the condition less error-prone.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `'not-found'` status check is now duplicated for both initial and final states; consider extracting this status into a shared variable or helper to avoid repetition and make future changes to the condition less error-prone.

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.

@richm richm merged commit 11fa257 into linux-system-roles:main Jan 22, 2026
29 of 30 checks passed
@richm richm deleted the test-do-not-restore-service-if-final-state-not-found branch January 22, 2026 17:07
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