Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

"moved" urls (which redirect) get 404 "Not Found" in GHI, work fine in git or github-web #210

Closed
smemsh opened this issue Nov 18, 2014 · 8 comments

Comments

@smemsh
Copy link

smemsh commented Nov 18, 2014

ghi seems to break when the github URL has changed since checkout:

$ git config --get remote.origin.url
https://github.com/hifi/raspbian-ua-netinst

$ curl -LI --stderr - https://github.com/hifi/raspbian-ua-netinst |
  grep -e ^Location -e ^Status
Status: 301 Moved Permanently
Location: https://github.com/debian-pi/raspbian-ua-netinst
Status: 200 OK

I tried 0.9.3 (gem install) and also trunk as of now (d89b5ab) shown below:

$ ./ghi list -- hifi/raspbian-ua-netinst | wc -l
Not Found
1

$ ./ghi list -- debian-pi/raspbian-ua-netinst | wc -l
17

only the canonicalized URL works. Since this is a 304 it should probably be followed by ghi

@AlexChesters
Copy link
Contributor

Hi @smemsh,

Thanks for reporting this! I've recently become a contributor to ghi and have experienced the same issue. Although rather than getting a 404 I actually get Moved Permanently in the output.

AlexChesters added a commit that referenced this issue Oct 16, 2015
The `client.rb` didn't cater for situations when the repo's name
changed. Now the request understands and follows 301 status codes
@AlexChesters
Copy link
Contributor

This issue has been fixed in 63987af

@smemsh
Copy link
Author

smemsh commented Oct 19, 2015

@AlexChesters with master branch (which appears to
include your commit 63987af) I still get the same issue
with the repository mentioned in my initial issue submission,
but this time there is no error, just an empty list. In
particular, a ghi list with the old url shows no issues
(has empty output), but with the new url, a full issue list
is shown.

Just try these two commands:

./ghi list -- hifi/raspbian-ua-netinst
./ghi list -- debian-pi/raspbian-ua-netinst

to see the difference. The former is the old, the
latter is the new. If you go to the url in a browser
(http://github.com/hifi/raspbian-ua-netinst) you will
end up at the new url after it follows the redirect.

I would say this issue is not fixed, since ghi isn't
following the redirect.

(aside: incidentally, your patch embeds tabs in the
source files, but surrounding code is space-expanded)

@AlexChesters AlexChesters reopened this Oct 19, 2015
@AlexChesters
Copy link
Contributor

@smemsh strange, it worked for me on one of my repos but not for the one you've shown... I'll have a look into this now

@AlexChesters
Copy link
Contributor

@smemsh I've managed to fix this 😄 My fix did fix the redirect issue, this issue will be affecting lots of repos... Will get a patch out now.

AlexChesters added a commit that referenced this issue Oct 19, 2015
AlexChesters added a commit that referenced this issue Oct 19, 2015
@AlexChesters
Copy link
Contributor

@smemsh This has been fixed in 1.0.3, thanks for reporting this!

The release is already available from rubygems now and will be available from brew as soon as this pull request is merged.

Thanks again 😄

@smemsh
Copy link
Author

smemsh commented Oct 19, 2015

confirmed, works now with bfe6349. thanks!

@AlexChesters
Copy link
Contributor

@smemsh no worries :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants