[ 
https://issues.apache.org/jira/browse/YETUS-413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15316149#comment-15316149
 ] 

Kengo Seki commented on YETUS-413:
----------------------------------

I'm testing it, but posting JSON seems not working (I removed the last {{rm 
"$\{tempfile}"}} in slack.sh):

{code}
[sekikn@mobile yetus]$ precommit/test-patch.sh --basedir=../dev/yetus 
--plugins=all --slack-channel='*********' 
--slack-token='****-***********-***********-***********-**********' 
--slack-url='https://slack.com/api/chat.postMessage' --resetrepo YETUS-413

(snip)

============================================================================
============================================================================
                      Writing a comment to *********
============================================================================
============================================================================


{"ok":false,"error":"not_authed"}

(snip)

[sekikn@mobile yetus]$ cat /private/tmp/yetus-18747.22545/slack.33608.29469 
{
"token": "****-***********-***********-***********-**********",
"channel":"*********",
"icon_emoji":":shell:",
"text":": *+1 overall* :confetti_ball:\n
",
"username":"Apache Yetus"
}
[sekikn@mobile yetus]$ curl -X POST --silent --fail -H "Content-Type: 
application/json" -d @/private/tmp/yetus-18747.22545/slack.33608.29469 
--location https://slack.com/api/chat.postMessage
{"ok":false,"error":"not_authed"}
{code}

Instead, sending data as a form seems to work:

{code}
[sekikn@mobile yetus]$ curl -X POST --silent --fail -d 
"token=****-***********-***********-***********-**********" -d 
"channel=*********" -d "icon_emoji=:shell:" -d "text=: *+1 overall* 
:confetti_ball:" -d "username=Apache Yetus" --location 
https://slack.com/api/chat.postMessage
{"ok":true,"channel":"*********","ts":"1465180178.000004","message":{"text":": 
* 1 overall* :confetti_ball:","username":"Apache 
Yetus","icons":{"emoji":":shell:","image_64":"https:\/\/slack.global.ssl.fastly.net\/d4bf\/img\/emoji_2015_2\/apple\/1f41a.png"},"bot_id":"B1EAFHGCR","type":"message","subtype":"bot_message","ts":"1465180178.000004"}}
{code}

And some comments:

{code}
 85       if [[ ${result} == 0 ]]; then
 86         echo "${PATCH_OR_URL}: *+1 overall* :confetti_ball:\n"
 87       else
 88         echo "${PATCH_OR_URL}: *-1 overall* :broken_heart:\n"
 89       fi
{code}

s/PATCH_OR_URL/PATCH_OR_ISSUE/ ?

{code}
105   # Let's pull the PR JSON for later use
{code}

This is a comment for GH.

> Slack integration
> -----------------
>
>                 Key: YETUS-413
>                 URL: https://issues.apache.org/jira/browse/YETUS-413
>             Project: Yetus
>          Issue Type: New Feature
>          Components: Test Patch
>    Affects Versions: 0.4.0
>            Reporter: Allen Wittenauer
>            Assignee: Allen Wittenauer
>             Fix For: 0.4.0
>
>         Attachments: YETUS-413.00.patch
>
>
> All the cool kids are using slack.  We should support it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to