mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-27 00:25:50 +03:00
[GH-ISSUE #525] Hipchat woes... #185
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#185
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @temp on GitHub (Mar 5, 2015).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/525
Just noticed the upgrade to the v2 api of hipchat.
This does more bad, than good, in my opinion.
Since hipchat api v2 is now oauth-token-based, it sends the log messages in the name of the user of the oauth-token. The nickname is not being used at all. You have to register an integration for an app account with it's own oauth-token.
And, by the way, the nickname-length check is still in the HipchatHandler. And the nickname. Which is not used ;-)
Guess i'll add the old hipchat handler as a custom handler for now.
@Seldaek commented on GitHub (Mar 5, 2015):
Oh sorry I overlooked that while reviewing.. Don't use it myself so it's hard to keep track of all things. That said, I suppose they will bring the v1 API offline eventually so you'll have to make the move sooner or later.
@Seldaek commented on GitHub (Mar 5, 2015):
But yes room_id and from in buildContent (+ the nickname everywhere) should be removed.
@Seldaek commented on GitHub (Mar 5, 2015):
Just one thing though.. did you need to register a new token at hipchat to make the v2 work or not? Because if yes that's a BC break and I guess I should revert until monolog v2..
@temp commented on GitHub (Mar 5, 2015):
The old api token does not work with v2. Had to create a new personal oauth token. So, yes, this is a bc break.
@m4tthumphrey commented on GitHub (Mar 9, 2015):
Yeh this seems to have broken for me too. The annoying thing is, it just fails silently but appears to be auth related.
@Seldaek commented on GitHub (Mar 9, 2015):
I reverted and 1.13.1 uses the v1 API with old tokens again.
@m4tthumphrey commented on GitHub (Mar 9, 2015):
Would it make sense to add a new separate handler for HipChat v2?
@Seldaek commented on GitHub (Mar 9, 2015):
I think there are two ways.. either we can distinguish the auth token for v1 and v2 and then we could sort of automatically configure the correct endpoint, or we just migrate to v2 in monolog 2.0 and that's a BC break and that's it. I don't know if v2 of their API really brings much except making sure it'll continue working in the future.
@temp commented on GitHub (Mar 9, 2015):
The problem is that v2 accepts either an user-oauth-token (which will result in log messages from a specific user), or an integration-oauth-token (which only last an hour and have to be constantly created).
I think it sucks to have log messages with a specific user, which will end in creating a lot of users for your different deployments...
Don't really like what atlassian is doing with the v2 changes, cause it will require a lot of changes for something like monolog.
For now I would stick with v1, but I don't know wether or not it will be discontinued.
@m4tthumphrey commented on GitHub (Mar 9, 2015):
@temp Yeh but unfortunately theres nothing Monolog can do about it. Is there anywhere we can raise this with HipChat? I also really like the nickname functionality.
@esalter commented on GitHub (Mar 10, 2015):
The way I've seen this in other libraries is you just specify what version of the API you want to use as an option, and the library takes care of it. I'm disappointed to see that v2 isn't supported anymore.
@m4tthumphrey commented on GitHub (Mar 10, 2015):
Why don't you update the handler to support v2 as well and create a PR @esalter?
@esalter commented on GitHub (Mar 10, 2015):
I will if I can find time soon.
@esalter commented on GitHub (Mar 10, 2015):
https://github.com/Seldaek/monolog/pull/526
@temp commented on GitHub (Mar 10, 2015):
Gee, did you mind reading my comments at all?
I really don't think that supporting v2 makes sense at all.
v2 requires a personal oauth token, bound to an user, NOT one of the old api keys.
v2 WON'T work with them.
And, if you create your personal oauth token, all log messages will be sent with your name!
We used the nickname to distinguish the servers which sent the messages, but the nickname feature has been removed from v2.
And it won't come back.
Now you could create a user for every server, but who wants to create and maintain a few dozen users, that also appear in hipchat?
Atlassians solution for this are the integrations, but these also don't really work with monolog.
You can register an integration, which will provide you with a user id and a secret, with which you can create an integration-oauth-token, which will only be valid vor 3600 seconds.
So, monolog would have to track these tokens, OR create a new oauth-token for each request.
And it still doesn't solve the nickname issue, since messages would now be sent with the integration name.
I would suggest sticking with the v1 api for monolog - i don't think that atlassian will shut down the v1 api. In jira the v1 apis are still available after months or even years.
@esalter commented on GitHub (Mar 10, 2015):
It depends on your use case. For us, we use this for deployment messages, so we have a deployment user that is used to send messages. I'm sure there are other legitimate use cases. It's not for everyone, clearly, but I don't see a reason not to support it when it's easy enough to add.
@temp commented on GitHub (Mar 10, 2015):
Ok, but then why not stick to v1 where you don't even need a user? ;-)
@temp commented on GitHub (Mar 11, 2015):
@Seldaek is there an ETA for 1.13.1?
@Seldaek commented on GitHub (Mar 12, 2015):
@temp sorry I forgot to tag after updating the changelog :s It's up now.
@temp commented on GitHub (Mar 12, 2015):
👍