You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@yetus.apache.org by "Kengo Seki (JIRA)" <ji...@apache.org> on 2017/09/08 10:05:00 UTC

[jira] [Commented] (YETUS-536) Jira plugin should output the information about curl failure in debug mode.

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

Kengo Seki commented on YETUS-536:
----------------------------------

I tested the patch and it worked properly.

{code}
sekikn@xenial:~/dev/yetus$ . precommit/core.d/00-yetuslib.sh 
sekikn@xenial:~/dev/yetus$ . precommit/core.d/01-common.sh 
sekikn@xenial:~/dev/yetus$ . precommit/test-patch.d/jira.sh 

sekikn@xenial:~/dev/yetus$ CURL=curl JIRA_URL=http://issues.apache.org/jira YETUS_SHELL_SCRIPT_DEBUG=true jira_http_fetch rest/api/2/issue/YETUS-538 output
[Fri Sep  8 05:43:41 EDT 2017 DEBUG]: jira_http_fetch: http://issues.apache.org/jira/rest/api/2/issue/YETUS-538

sekikn@xenial:~/dev/yetus$ CURL=curl JIRA_URL=foo://issues.apache.org/jira YETUS_SHELL_SCRIPT_DEBUG=true jira_http_fetch rest/api/2/issue/YETUS-538 output
[Fri Sep  8 05:43:53 EDT 2017 DEBUG]: jira_http_fetch: foo://issues.apache.org/jira/rest/api/2/issue/YETUS-538
[Fri Sep  8 05:43:53 EDT 2017 DEBUG]: jira_http_fetch: Unsupported protocol. Maybe misspelled jira's url?

sekikn@xenial:~/dev/yetus$ CURL=curl JIRA_URL=http://dummy/jira YETUS_SHELL_SCRIPT_DEBUG=true jira_http_fetch rest/api/2/issue/YETUS-538 output
[Fri Sep  8 05:48:19 EDT 2017 DEBUG]: jira_http_fetch: http://dummy/jira/rest/api/2/issue/YETUS-538
[Fri Sep  8 05:48:19 EDT 2017 DEBUG]: jira_http_fetch: Could not resolve host in URL http://dummy/jira.

sekikn@xenial:~/dev/yetus$ CURL=curl JIRA_URL=http://issues.apache.org:99999/jira YETUS_SHELL_SCRIPT_DEBUG=true jira_http_fetch rest/api/2/issue/YETUS-538 output
[Fri Sep  8 05:44:51 EDT 2017 DEBUG]: jira_http_fetch: http://issues.apache.org:99999/jira/rest/api/2/issue/YETUS-538
[Fri Sep  8 05:44:51 EDT 2017 DEBUG]: jira_http_fetch: http://issues.apache.org:99999/jira/rest/api/2/issue/YETUS-538 url is malformed.

sekikn@xenial:~/dev/yetus$ CURL=curl JIRA_URL=http://issues.apache.org/jira JIRA_USER=sekikn JIRA_PASSWD=password YETUS_SHELL_SCRIPT_DEBUG=true jira_http_fetch rest/api/2/issue/YETUS-538 output
[Fri Sep  8 05:45:51 EDT 2017 DEBUG]: jira_http_fetch: http://issues.apache.org/jira/rest/api/2/issue/YETUS-538
[Fri Sep  8 05:45:53 EDT 2017 DEBUG]: jira_http_fetch: http://issues.apache.org/jira/rest/api/2/issue/YETUS-538 returned 4xx status code. Maybe incorrect username/password?

sekikn@xenial:~/dev/yetus$ CURL=curl JIRA_URL=http://issues.apache.org:0/jira YETUS_SHELL_SCRIPT_DEBUG=true jira_http_fetch rest/api/2/issue/YETUS-538 output
[Fri Sep  8 05:44:12 EDT 2017 DEBUG]: jira_http_fetch: http://issues.apache.org:0/jira/rest/api/2/issue/YETUS-538
[Fri Sep  8 05:44:12 EDT 2017 DEBUG]: jira_http_fetch: http://issues.apache.org:0/jira/rest/api/2/issue/YETUS-538 returned 7 error code. See https://ec.haxx.se/usingcurl-returns.html for details.
{code}

For consistency, would you address the following minor issues?

- declare the variable at the beginning of the function
- use declare instead of local
- add curly brackets to $ec

> Jira plugin should output the information about curl failure in debug mode.
> ---------------------------------------------------------------------------
>
>                 Key: YETUS-536
>                 URL: https://issues.apache.org/jira/browse/YETUS-536
>             Project: Yetus
>          Issue Type: Improvement
>            Reporter: Mano Kovacs
>            Assignee: Mano Kovacs
>         Attachments: YETUS-536.001.patch, YETUS-536.002.patch
>
>
> If call to JIRA fails, there is not much information about the reason.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)