-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(client): Display correct Insights URL #4297
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4297 +/- ##
==========================================
- Coverage 76.98% 76.97% -0.02%
==========================================
Files 735 735
Lines 41306 41311 +5
Branches 8772 8773 +1
==========================================
- Hits 31801 31800 -1
- Misses 8439 8444 +5
- Partials 1066 1067 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Can one of the admins verify this patch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Matyáš gave ✅, so I am only giving a comment. I’d consider the URL parsing, but since we’re only dealing with know Red Hat URLs, in
is probably fine.
I didn’t test running --register
against stage. Unfortunately, I don’t know how to configure RHSM and the Client to connect to stage. If you know, please tell me.
if "stage" in config.base_url: | ||
console_url = "https://console.stage.redhat.com/insights/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I‘d go with something more robust like
if "stage" in config.base_url: | |
console_url = "https://console.stage.redhat.com/insights/" | |
hostname = urlparse(config.base_url).hostname | |
if hostname.endswith("stage.redhat.com"): | |
console_url = "https://console.stage.redhat.com/insights/" |
I’d even consider a function in insights.client.config
and an enum with PRODUCTION
, STAGE
, SATELLITE
options. I’ll utilize that in my CCT-963. That’d be over the scope of this simple PR though.
* Card ID: CCT-1008 With the introduction of IoP, the `insights-client` should display the correct URL for the respective environment. The client differentiates between Hosted, Stage Hosted, and IoP environments during registration. Signed-off-by: pkoprda <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from a QE POV, added a verification comment to the corresponding CCT card:)
🎉 Merge? @xiangce |
Thanks! ❤️ |
* Card ID: CCT-1008 With the introduction of IoP, the `insights-client` should display the correct URL for the respective environment. The client differentiates between Hosted, Stage Hosted, and IoP environments during registration. Signed-off-by: pkoprda <[email protected]> (cherry picked from commit 5be3260)
All Pull Requests:
Check all that apply:
Complete Description of Additions/Changes:
With the introduction of IoP, the
insights-client
should display the correct URL for the respective environment. The client differentiates between Hosted, Stage Hosted, and IoP environments during registration.