Skip to content

[6.19.z] Automate setting IoP log levels via satellite-installer - #20818

Merged
synkd merged 2 commits into
6.19.zfrom
cherry-pick-6.19.z-c48497990a02092a03e2efeab32af9d1722c4536
Feb 19, 2026
Merged

[6.19.z] Automate setting IoP log levels via satellite-installer#20818
synkd merged 2 commits into
6.19.zfrom
cherry-pick-6.19.z-c48497990a02092a03e2efeab32af9d1722c4536

Conversation

@Satellite-QE

@Satellite-QE Satellite-QE commented Feb 18, 2026

Copy link
Copy Markdown
Collaborator

Cherrypick of PR: #20815

This PR automates testing of SAT-41750, which introduced satellite-installer options that set the verbosity level of the IoP loggers. It verifies that none of these loggers are set to DEBUG by default, that all of them can be switched to DEBUG using satellite-installer, and that all of them can be switched back to their default values using satellite-installer. It also introduces a helper method for processing satellite-installer help output into a dictionary.

Summary by Sourcery

Add automated coverage for configuring IoP log levels via satellite-installer and introduce a helper for parsing installer help output.

Enhancements:

  • Introduce a helper function to convert satellite-installer help output into a dictionary of options to descriptions.

Tests:

  • Add an integration test that validates IoP log levels are not DEBUG by default, can be set to DEBUG via satellite-installer, and can be reset to their defaults.

* Automate setting IoP log levels via satellite-installer

This PR automates testing of SAT-41750, which introduced
satellite-installer options that set the verbosity level of the IoP
loggers. It verifies that none of these loggers are set to DEBUG by
default, that all of them can be switched to DEBUG using
satellite-installer, and that all of them can be switched back to their
default values using satellite-installer. It also introduces a helper
method for processing satellite-installer help output into a dictionary.

* Change Satellite fixture to the correct IoP fixture

(cherry picked from commit c484979)
@Satellite-QE Satellite-QE added 6.19.z Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches labels Feb 18, 2026
@Satellite-QE

Copy link
Copy Markdown
Collaborator Author
trigger: test-robottelo
pytest: tests/foreman/cli/test_rhcloud_iop.py::test_set_iop_log_level_via_installer

@Satellite-QE Satellite-QE added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Feb 18, 2026
@sourcery-ai

sourcery-ai Bot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds an automated CLI test that validates IoP log levels can be inspected, set to DEBUG, and reset to defaults via satellite-installer, along with a helper for parsing installer help output into a dictionary of options and descriptions.

File-Level Changes

Change Details Files
Add IoP log level end-to-end test using satellite-installer and a helper to parse installer help output.
  • Introduce process_iop_log_options(installer_output) to transform satellite-installer help text into an option-to-description dictionary by splitting each line on whitespace and treating the first token as the option name.
  • Add test_set_iop_log_level_via_installer to exercise IoP log level configuration: capture current IoP log-related options from satellite-installer --full-help via InstallerCommand piped through grep filters, parse them into a dictionary, and assert that DEBUG is not present by default.
  • Use InstallerCommand to set all IoP-related log levels (insights-core-dr, insights-kafka-service, insights-messaging, root) to DEBUG, re-query the help output, and assert all resulting option descriptions contain DEBUG.
  • Use InstallerCommand with the reset-iop-* options to reset IoP log levels to their defaults, re-query the help output, and assert that DEBUG no longer appears in any IoP log-level descriptions.
tests/foreman/cli/test_rhcloud_iop.py

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The process_iop_log_options helper currently splits every non-empty line and uses the first token as an option; consider constraining it to lines that actually look like installer options (e.g., starting with --iop- or matching a regex) to avoid accidentally treating headers or other text as options if the help output format changes.
  • In test_set_iop_log_level_via_installer, the installer command to fetch IoP log levels (f'{help_command} | grep iop.*log-level | grep -v reset') is duplicated three times; consider extracting this into a small helper or variable to avoid repetition and reduce the chance of future inconsistencies.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `process_iop_log_options` helper currently splits every non-empty line and uses the first token as an option; consider constraining it to lines that actually look like installer options (e.g., starting with `--iop-` or matching a regex) to avoid accidentally treating headers or other text as options if the help output format changes.
- In `test_set_iop_log_level_via_installer`, the installer command to fetch IoP log levels (`f'{help_command} | grep iop.*log-level | grep -v reset'`) is duplicated three times; consider extracting this into a small helper or variable to avoid repetition and reduce the chance of future inconsistencies.

## Individual Comments

### Comment 1
<location> `tests/foreman/cli/test_rhcloud_iop.py:389` </location>
<code_context>
+        iop_core_engine_log_level_insights_messaging=NEW_LOG_LEVEL,
+        iop_core_engine_log_level_root=NEW_LOG_LEVEL,
+    ).get_command()
+    module_satellite_iop.execute(command)
+
+    # Verify that log levels are now DEBUG
</code_context>

<issue_to_address>
**issue (testing):** Assert the success of `satellite-installer` commands instead of ignoring the exit status.

These `module_satellite_iop.execute(command)` calls for setting/resetting log levels should check the command result. Without asserting `status == 0` (and optionally validating stderr), the test may continue after a failed installer invocation and yield misleading assertion failures later. Please assert on the execution result so the test fails immediately when the installer call itself fails.
</issue_to_address>

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.

iop_core_engine_log_level_insights_messaging=NEW_LOG_LEVEL,
iop_core_engine_log_level_root=NEW_LOG_LEVEL,
).get_command()
module_satellite_iop.execute(command)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue (testing): Assert the success of satellite-installer commands instead of ignoring the exit status.

These module_satellite_iop.execute(command) calls for setting/resetting log levels should check the command result. Without asserting status == 0 (and optionally validating stderr), the test may continue after a failed installer invocation and yield misleading assertion failures later. Please assert on the execution result so the test fails immediately when the installer call itself fails.

@chris1984 chris1984 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK pending PRT

@synkd

synkd commented Feb 19, 2026

Copy link
Copy Markdown
Contributor
trigger: test-robottelo
pytest: tests/foreman/cli/test_rhcloud_iop.py::test_set_iop_log_level_via_installer

@Satellite-QE

Copy link
Copy Markdown
Collaborator Author

PRT Result

Build Number: 14401
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_rhcloud_iop.py::test_set_iop_log_level_via_installer --external-logging
Test Result : ================== 1 passed, 6 warnings in 2004.66s (0:33:24) ==================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 19, 2026
@synkd
synkd merged commit c3604ae into 6.19.z Feb 19, 2026
10 of 11 checks passed
@synkd
synkd deleted the cherry-pick-6.19.z-c48497990a02092a03e2efeab32af9d1722c4536 branch February 19, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.19.z Auto_Cherry_Picked Automatically cherrypicked PR using GHA AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants