[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:
signature.asc
Description: OpenPGP digital signature