All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: backporting script
       [not found] <CABNx+P820e=NOB9dvf-Pox+NaT3pL6ccveMUTzoOyqa2+ZU-4w@mail.gmail.com>
@ 2015-05-10 10:09 ` Loic Dachary
  0 siblings, 0 replies; only message in thread
From: Loic Dachary @ 2015-05-10 10:09 UTC (permalink / raw)
  To: Nathan Cutler; +Cc: Ceph Development

[-- Attachment #1: Type: text/plain, Size: 2062 bytes --]

[cc'ing ceph-devel for archive]

Hi Nathan,

I've ran into this problem also and manually fixed the title... which is not great. Your fix is better :-) I think you have permission to update

    http://tracker.ceph.com/projects/ceph-releases/wiki/HOWTO_backport_commits

with your improvements. Let me know if that's not the case.

Cheers

On 10/05/2015 11:35, Nathan Cutler wrote:
> Hi Loic:
> 
> In your script at
> http://tracker.ceph.com/projects/ceph-releases/wiki/HOWTO_backport_commits
> 
> you have this line:
> 
> eval title=$(curl --silent
> 'http://tracker.ceph.com/issues/'$issue.json?key=$redmine_key | jq
> .issue.subject) ; echo $title
> 
> I found that when the title string contains double-quote characters --
> like, for example, in this commit:
> https://github.com/ceph/ceph/commit/fdd7f8d83afa25c4e09aaedd90ab93f3b64a677b
> -- the double quote characters cause the script to break in the next
> line:
> 
> number=$(curl --silent --data-binary
> '{"title":"'"$title"'","head":"'$github_user':wip-'$issue-$release'","base":"'$release'","body":"http://tracker.ceph.com/issues/'$issue'"}'
> 'https://api.github.com/repos/ceph/ceph/pulls?access_token='$github_token
> | jq .number)
> 
> because api.github.com sends back a 400 reponse (JSON not parseable).
> 
> For now I have "fixed" this issue by changing the code to look like this:
> 
> title=$(curl --silent
> 'http://tracker.ceph.com/issues/'$issue.json?key=$redmine_key | jq
> .issue.subject | tr -d '\\"')
> echo "Issue title: $title"
> number=$(curl --silent --data-binary
> '{"title":"'"$title"'","head":"'$github_repo':wip-'$issue-$release'","base":"'$release'","body":"http://tracker.ceph.com/issues/'$issue'"}'
> 'https://api.github.com/repos/ceph/ceph/pulls?access_token='$github_token
> | jq .number)
> echo "Opened pull request $number"
> 
> Sorry if the code is not readable -> here is the same code in a pastebin:
> 
> http://pastebin.com/LjfqaidV
> 
> Regards,
> Nathan
> 

-- 
Loïc Dachary, Artisan Logiciel Libre


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-10 10:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CABNx+P820e=NOB9dvf-Pox+NaT3pL6ccveMUTzoOyqa2+ZU-4w@mail.gmail.com>
2015-05-10 10:09 ` backporting script Loic Dachary

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.