-
Notifications
You must be signed in to change notification settings - Fork 897
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
Stop using deprecated names of hawkular-client gem #14543
Stop using deprecated names of hawkular-client gem #14543
Conversation
Version 2.9.0 of hawkular-client has deprecated some names. This is replacing the deprecated names with the current ones.
Checked commit israel-hdez@71a7d66 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@chessbyte what is the syntax for me to assign/reassign a reviewer? |
@simon3z @yaacov @moolitayer please check if this affects containers provider as well |
@abonas thanks 👍 , the metrics client works with this changes. |
@abonas In case this helps: assigning a reviewer: However the user needs to be in the reviewers list per repo and I'm not sure who handles that As for dependencies, what I would do in a case like this to be on the safe side: Of curse that is just my opinion and not an official guideline |
@@ -279,7 +279,7 @@ def self.raw_alerts_connect(hostname, port, username, password) | |||
:username => username, | |||
:password => password | |||
} | |||
::Hawkular::Alerts::AlertsClient.new(url, credentials) | |||
::Hawkular::Alerts::Client.new(url, credentials) |
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.
Can you have a problem in middleware since you are not setting the tenant explicitly?
I'm referring to:
https://github.com/hawkular/hawkular-client-ruby/blob/master/api_breaking_changes.rdoc#200
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.
good point, @Jiri-Kremser and @lucasponce can you please reply?
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.
If the code worked before, this change shouldn't break it. Nor the version bump to 2.9.0
@lucasponce it works because alerts don't enforce the hawkular tenant header, right?
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.
@Jiri-Kremser yes, the Alerts client expects the tenant from the options, the default 'hawkular' tenant used by Middleware is set in the upper raw_client as far as I remember. Inside the Alerts rb there is not tenant manipulation.
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.
@lucasponce I'm not sure I'm seeing it set:
def self.raw_alerts_connect(hostname, port, username, password) |
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.
ok, so the alerts server side does require the header being set:
$curl -s -u jdoe:password 'http://localhost:8080/hawkular/alerts'
{"errorMsg":"The HTTP header Hawkular-Tenant has to be provided."}
So now I don't understand how this could have worked before.
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 think that the AlertsClient is generated from the with_provider_connection which should invoke the connect()
https://github.com/israel-hdez/manageiq/blob/71a7d668b9b5a88aec3e460efa46949d2d450197/app/models/manageiq/providers/hawkular/middleware_manager.rb#L197
and invoke the raw_connect with the default tenant.
I did a grep and I can't see where raw_alerts_connect is invoked, perhaps it is on a separate PR just for the Datawarehouse use cases ?
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 also grep'ed managui-ui-classic repo and found no references to it.
Anyway... The code using raw_alerts_connect
will fail with an exception because we have this: https://github.com/hawkular/hawkular-client-ruby/blob/master/lib/hawkular/base_client.rb#L32
I think it's dead code and I can safely remove it.
@moolitayer thanks. I think that we are talking about different things. |
Ahh right @abonas Testing something: |
ok so where do we stand with this PR? all reviewers acked? |
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
I'm ok with the containers metrics side. |
lgtm but travis is showing some errors related. So perhaps good to take a look to check if are derivated to the changes. |
I believe the tests fail as this patch actually needs the gem version to be bumped (which is done in another PR in another repo but not yet merged as they must be merged at the same time) |
In travis log: And that's because of the gem version, as @abonas said. |
@miq-bot add_label fine/yes, blocker Please see ManageIQ/manageiq-gems-pending#138 (comment) for backport notes. |
…_constants Stop using deprecated names of hawkular-client gem (cherry picked from commit f15a504) https://bugzilla.redhat.com/show_bug.cgi?id=1446329
Fine backport details:
|
@moolitayer @abonas Correct, reviewers are different from assignees. Currently the bot only deals with assignees (reviewers are a relatively new Github feature). |
Version 2.9.0 of hawkular-client has deprecated some names. This is
replacing the deprecated names with the current ones.
NOTE: This must be merged after ManageIQ/manageiq-gems-pending#102
@miq-bot add_labels providers/hawkular
BACKPORT UPDATE: https://bugzilla.redhat.com/show_bug.cgi?id=1446286