From: Loic Dachary <loic@dachary.org>
To: Nathan Cutler <presnypreklad@gmail.com>
Cc: Ceph Development <ceph-devel@vger.kernel.org>
Subject: Re: backporting script
Date: Sun, 10 May 2015 12:09:50 +0200 [thread overview]
Message-ID: <554F2E6E.6090608@dachary.org> (raw)
In-Reply-To: <CABNx+P820e=NOB9dvf-Pox+NaT3pL6ccveMUTzoOyqa2+ZU-4w@mail.gmail.com>
[-- 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 --]
parent reply other threads:[~2015-05-10 10:09 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <CABNx+P820e=NOB9dvf-Pox+NaT3pL6ccveMUTzoOyqa2+ZU-4w@mail.gmail.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=554F2E6E.6090608@dachary.org \
--to=loic@dachary.org \
--cc=ceph-devel@vger.kernel.org \
--cc=presnypreklad@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.