Last active
July 17, 2017 06:58
-
-
Save theanalyst/fdc753a56bdb551eea2fa71a2aaa4eaa to your computer and use it in GitHub Desktop.
Rename prs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat release-x.rst | sed "s/\`\([a-z]\+\#[0-9]\+\)\s\(<[a-z0-9://.]\+>\`\_\)/\1/g" > release-x.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat process.sh | |
#!/bin/bash | |
filename=$1 | |
while read -r pr line | |
do | |
./rename-pr $pr "$line" | |
done < "$filename" | |
# Making the errors itself | |
$ cat 10.2.7.rst | grep "does not match" | sed 's/^\(.*\)\(does not match\).*$/\1/' > errors.txt | |
# for dev releases | |
$ cat 12.0.2-1.txt | grep "UNKNOWN" | sed 's/^\(.*\)\(UNKNOWN:\)\(.*$\)/\3/' | sed "s/\`\([a-z]\+\#[0-9]\+\)\│········································· | |
s\(<[a-z0-9://.]\+>\`\_\)/\1/g" | sed "s/\(.*\)(pr\#\([0-9]\+\).*/\2\1/" > errors.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import github | |
import argparse | |
if __name__ == "__main__": | |
parser = argparse.ArgumentParser() | |
parser.add_argument("pr", metavar="pr", | |
help="pr to modify/get title for") | |
parser.add_argument("title", metavar="title", nargs='?', | |
default=None, help= "new title for pr") | |
token = os.getenv("GITHUB_ACCESS_TOKEN") | |
gh = github.GitHub(access_token=token) | |
args = parser.parse_args() | |
print "gettting pr %s" % args.pr | |
gh_pr = gh.repos("ceph")("ceph").pulls(args.pr) | |
pr_json = gh_pr.get() | |
if args.title is None: | |
print pr_json["title"] | |
print "get succeeded" | |
else: | |
result=gh_pr.patch(title=args.title) | |
print result | |
print args.title |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment