jenkinsci / hipchat-plugin

HipChat notification plugin for Jenkins
https://plugins.jenkins.io/hipchat/
54 stars 85 forks source link

v2 notification doesn't work #39

Closed retoo closed 9 years ago

retoo commented 9 years ago

any idea what the problem could be? It happpens in the 'test notification' configuration.

Feb 23, 2015 2:03:24 PM jenkins.plugins.hipchat.impl.HipChatV2Service publish
WARNING: HipChat post may have failed. ResponseCode: 400, Response: {
  "error": {
    "code": 400,
    "expected_type": "boolean",
    "field": "notify",
    "message": "Value u'true' for field 'notify' is not of type 'boolean'",
    "type": "Bad Request",
    "validation": "type",
    "value": "true"
  }
}
aldaris commented 9 years ago

This looks a bit odd. I would think this should only happen if the v2 service is accessed using a JSON a payload for the POST ( https://www.hipchat.com/docs/apiv2/method/send_room_notification ). The error message suggests that the JSON had:

"notify": "true"

instead of

"notify: true

But the v2 impl is still using "application/x-www-form-urlencoded" content-type so I'm not really sure why this error could possibly occur.

aldaris commented 9 years ago

Are there any specific reproduction steps? Can you reliably reproduce this?

retoo commented 9 years ago

Go to a global configuration, set the api v2 token and press test connection. I tried it only once.

On 27 February 2015 21:19:17 Peter Major notifications@github.com wrote:

Are there any specific reproduction steps? Can you reliably reproduce this?


Reply to this email directly or view it on GitHub: https://github.com/jenkinsci/hipchat-plugin/issues/39#issuecomment-76392852

aldaris commented 9 years ago

Hmm, could be that only the Test button doesn't work, IIRC I was able to use v2 tokens from build jobs.

aldaris commented 9 years ago

I'm unable to reproduce this locally. Are you using a self-hosted HipChat server or api.hipchat.com? Just to be sure, this is what I did:

retoo commented 9 years ago

It's a self hosted hip chat sever. I'll try to find out the current version.

retoo commented 9 years ago

We use 1.1.9 (beta channel)

aldaris commented 9 years ago

Could you test with the v2testing branch and see if configuration testing works any better? (See also bb03093)

retoo commented 9 years ago

This worked on my test installation, both test button and notifications of jobs. I don't know yet when I will be able to install it on our production jenkins, but so far it looks good.

aldaris commented 9 years ago

Committed to master with ba19f04