Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to get PR metadata in case of relocated git repository #11

Closed
gaol opened this issue Dec 14, 2019 · 0 comments · Fixed by #12
Closed

Failed to get PR metadata in case of relocated git repository #11

gaol opened this issue Dec 14, 2019 · 0 comments · Fixed by #12

Comments

@gaol
Copy link
Contributor

gaol commented Dec 14, 2019

Some github repositories are relocated to another organization, which will lead to the getting PR metadata failure:

[🎩 lgao@lgao vertx]$ git status
On branch pulls/3228
nothing to commit, working tree clean
[🎩 lgao@lgao vertx]$ git remote -v
origin	https://github.com/eclipse/vert.x (fetch)
origin	https://github.com/eclipse/vert.x (push)
[🎩 lgao@lgao vertx]$ bash -x /sources/jboss-set/auxilia/pr-merge origin 3228
+ sanity_check
+ isJqInstalled
+ local jq_url=https://stedolan.github.io/jq
+ which jq
+ '[' 0 '!=' 0 ']'
+ isNetrcPresent
+ local netrc_file=/home/lgao/.netrc
+ '[' '!' -e /home/lgao/.netrc -o '!' -r /home/lgao/.netrc ']'
+ set -eo pipefail
+ '[' 2 '!=' 2 ']'
++ git rev-parse --abbrev-ref HEAD
+ readonly BRANCH=pulls/3228
+ BRANCH=pulls/3228
+ readonly REMOTE=origin
+ REMOTE=origin
+ readonly PR_ID=3228
+ PR_ID=3228
+ '[' -z origin ']'
+ '[' -z 3228 ']'
+ echo 'Merging 3228 from origin onto pulls/3228'
Merging 3228 from origin onto pulls/3228
++ git remote -v
++ grep '^origin[ ]*'
++ grep fetch
++ cut -f2
++ cut '-d ' -f1
+ readonly FETCH_URL=https://github.com/eclipse/vert.x
+ FETCH_URL=https://github.com/eclipse/vert.x
+ '[' -z https://github.com/eclipse/vert.x ']'
++ echo https://github.com/eclipse/vert.x
++ sed 's/\//:/g'
+ readonly URL_PARSE=https:::github.com:eclipse:vert.x
+ URL_PARSE=https:::github.com:eclipse:vert.x
+ readonly REPO_PART=vert.x
+ REPO_PART=vert.x
++ echo vert.x
++ sed s/.git//
+ readonly REPO=vert.x
+ REPO=vert.x
++ echo https:::github.com:eclipse:vert.x
++ sed s/:vert.x//
+ readonly URL_LEFT=https:::github.com:eclipse
+ URL_LEFT=https:::github.com:eclipse
+ readonly OWNER=eclipse
+ OWNER=eclipse
+ '[' -z eclipse -o -z vert.x ']'
+ readonly PR_GITHUB_API_URL=https://api.github.com/repos/eclipse/vert.x/pulls/3228
+ PR_GITHUB_API_URL=https://api.github.com/repos/eclipse/vert.x/pulls/3228
+ set -e
+ echo -n 'Retrieving PR information from https://api.github.com/repos/eclipse/vert.x/pulls/3228...'
Retrieving PR information from https://api.github.com/repos/eclipse/vert.x/pulls/3228...++ curl -s -n https://api.github.com/repos/eclipse/vert.x/pulls/3228
+ readonly 'PULL={
  "message": "Moved Permanently",
  "url": "https://api.github.com/repositories/1911523/pulls/3228",
  "documentation_url": "https://developer.github.com/v3/#http-redirects"
}'
+ PULL='{
  "message": "Moved Permanently",
  "url": "https://api.github.com/repositories/1911523/pulls/3228",
  "documentation_url": "https://developer.github.com/v3/#http-redirects"
}'
++ grep 'Not Found'
++ echo '{' '"message":' '"Moved' 'Permanently",' '"url":' '"https://api.github.com/repositories/1911523/pulls/3228",' '"documentation_url":' '"https://developer.github.com/v3/#http-redirects"' '}'
+ '[' 0 -ne 0 -o '' '!=' '' ']'
+ echo Done.
Done.
+ set +e
++ echo '{' '"message":' '"Moved' 'Permanently",' '"url":' '"https://api.github.com/repositories/1911523/pulls/3228",' '"documentation_url":' '"https://developer.github.com/v3/#http-redirects"' '}'
++ jq -r .head.label
++ echo '{' '"message":' '"Moved' 'Permanently",' '"url":' '"https://api.github.com/repositories/1911523/pulls/3228",' '"documentation_url":' '"https://developer.github.com/v3/#http-redirects"' '}'
++ jq -r .title
+ readonly 'MSG=Merge pull request #3228 from null null'
+ MSG='Merge pull request #3228 from null null'
+ echo 'Git commit message will be: Merge pull request #3228 from null null'
Git commit message will be: Merge pull request #3228 from null null
+ echo -n Continue...
Continue...+ read _
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant