fix: allow system to be registered with broken insights-client#3700
Closed
jlocash wants to merge 3 commits intocandlepin:mainfrom
Closed
fix: allow system to be registered with broken insights-client#3700jlocash wants to merge 3 commits intocandlepin:mainfrom
jlocash wants to merge 3 commits intocandlepin:mainfrom
Conversation
jlocash
commented
Feb 27, 2026
- Card ID: CCT-1574
* Card ID: CCT-1574 Signed-off-by: Joshua Locash <jlocash@redhat.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR broadens the error handling when importing the insights_client constants so that any exception during import is treated as a missing/disabled insights client, allowing system registration to proceed even when the insights client is broken in non-ImportError ways. Flow diagram for insights_client import error handlingflowchart TD
A[Start module rhsmlib.facts.insights] --> B[Try import insights_client.constants as insights_constants]
B -->|Import succeeds| C[insights_constants set to imported constants]
B -->|Any Exception raised| D[insights_constants set to None]
C --> E[Rest of module uses insights_constants]
D --> E[Rest of module treats insights as missing/disabled]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Author
|
/packit build |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Catching a broad
Exceptionduring theinsights_clientimport risks masking unrelated runtime errors; consider narrowing this to the specific exception(s) raised by the broken client or adding a comment explaining why a broad catch is required. - When
insights_constantsis set toNonedue to a failed import, it might be helpful to log a warning or debug message so that operators can distinguish between a truly absent client and other import-time failures.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Catching a broad `Exception` during the `insights_client` import risks masking unrelated runtime errors; consider narrowing this to the specific exception(s) raised by the broken client or adding a comment explaining why a broad catch is required.
- When `insights_constants` is set to `None` due to a failed import, it might be helpful to log a warning or debug message so that operators can distinguish between a truly absent client and other import-time failures.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.