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

Pull request displays "unknown repo" after deletion of fork #168

Open
tobiasvl opened this Issue Apr 14, 2014 · 96 comments

Comments

Projects
None yet
@tobiasvl

tobiasvl commented Apr 14, 2014

I recently had a pull request approved. I deleted the feature branch afterwards, as it was not needed anymore, and I also deleted the fork, because I didn't need it anymore either. Now the pull request came from an "unknown repository":

I understand that the reason is that the repo's name is retrieved dynamically and that it doesn't exist anymore when it's deleted, but this behavior is pretty jarring and I have to wonder if it's intended. I'd rather not keep old, out-of-date forks around just so past pull requests aren't "broken".

I guess there might be a privacy concern here, as deleted/private repos should probably not be publicized in any way, but seeing as the old fork's name is saved for posterity in the merge commit message, that shouldn't really be a problem.

@patcon

This comment has been minimized.

patcon commented Apr 15, 2014

+1

@tobiasvl

This comment has been minimized.

tobiasvl commented Apr 16, 2014

Reply from @rsese of GitHub staff:

Thanks very much for the feedback! I believe this was a recent change so I'm not positive if this behavior is intended for merged pull requests, but I'll find out if this was the intention and I'll also mention your thoughts to the team for discussion.

@tobiasvl

This comment has been minimized.

tobiasvl commented Apr 17, 2014

Just wanted to followup and let you know that I found that this was change was made in part to make it more clear why a pull request can't be re-opened (you can't reopen a closed pull request if the head repository is deleted). But I think you make a good point about merged pull requests so I'll mention this to the folks that implemented the change for discussion.

@patcon

This comment has been minimized.

patcon commented Apr 17, 2014

👍

2 similar comments
@Silox

This comment has been minimized.

Silox commented Oct 1, 2014

👍

@gustavotemple

This comment has been minimized.

gustavotemple commented Nov 25, 2014

+1

@hansfn

This comment has been minimized.

hansfn commented Apr 6, 2015

Just for the record: This is still an issue. I just deleted my forked repository, and the (approved) pull request is now said to come from an "unknown repository".

@DanailMinchev

This comment has been minimized.

DanailMinchev commented May 15, 2015

Any updates on this?

@nvasilescu

This comment has been minimized.

nvasilescu commented Jun 15, 2015

still having this problem. Now i'm stuck if i don't choose another name for the repo. I deleted a repor trying to upload again as not all files seemed to upload. Now the desktop client sees the repo missing as it was deleted but can't unpublish.

@petermarcoen

This comment has been minimized.

petermarcoen commented Jul 8, 2015

+1

8 similar comments
@rwanyoike

This comment has been minimized.

rwanyoike commented Aug 3, 2015

👍

@maximd

This comment has been minimized.

maximd commented Sep 4, 2015

+1

@DanielAsher

This comment has been minimized.

DanielAsher commented Sep 9, 2015

👍

@dijonkitchen

This comment has been minimized.

dijonkitchen commented Oct 14, 2015

+1

@brunowego

This comment has been minimized.

brunowego commented Oct 16, 2015

+1

@Schweinepriester

This comment has been minimized.

Schweinepriester commented Nov 5, 2015

+1

@OPersian

This comment has been minimized.

OPersian commented Nov 12, 2015

+1

@NiklasRosenstein

This comment has been minimized.

NiklasRosenstein commented Dec 8, 2015

+1

@ErikSwan

This comment has been minimized.

ErikSwan commented Dec 10, 2015

+1. This feels like something is broken even if it's intended behavior. I would rather the string be saved with the pull request instead of retrieved dynamically. Since I believe pull requests are stored with the upstream repo, I don't feel like this should be too difficult.

@szakharchenko

This comment has been minimized.

szakharchenko commented Dec 21, 2015

+1. Not having this encourages users to keep stale forks.

@DanielAsher

This comment has been minimized.

DanielAsher commented Jan 5, 2016

@szakharchenko +1
agreed.

@atodorov

This comment has been minimized.

atodorov commented Jan 21, 2016

+1

5 similar comments
@dr1s

This comment has been minimized.

dr1s commented Jan 21, 2016

+1

@vz10

This comment has been minimized.

vz10 commented Jan 21, 2016

+1

@TamoshaytisV

This comment has been minimized.

TamoshaytisV commented Jan 21, 2016

+1

@dorosh

This comment has been minimized.

dorosh commented Jan 21, 2016

+1

@cmltaWt0

This comment has been minimized.

cmltaWt0 commented Jan 21, 2016

+1

@dragetd

This comment has been minimized.

dragetd commented Dec 5, 2017

+1

1 similar comment
@nothinux

This comment has been minimized.

nothinux commented Dec 21, 2017

+1

@AleksCore

This comment has been minimized.

AleksCore commented Dec 26, 2017

10 years later

@bellgance

This comment has been minimized.

bellgance commented Dec 28, 2017

+1

@Asenar

This comment has been minimized.

Asenar commented Jan 5, 2018

Same here :)

curl -L url-repo/pull/1.path says diff is unavailable.

If this is impossible, maybe at least a button to show a raw version of the diff would be an acceptable fallback

@ziyasal ziyasal referenced this issue Jan 8, 2018

Closed

Add reduc.io to URL Shorteners section #1258

6 of 7 tasks complete
@chenrui333

This comment has been minimized.

chenrui333 commented Jan 15, 2018

👍

1 similar comment
@m3esma

This comment has been minimized.

m3esma commented Jan 21, 2018

+1

ashawley added a commit to ashawley/github-api-scala that referenced this issue Feb 18, 2018

Change head.repo on pull requests to Option
Pull requests can have their forks deleted:

https://stackoverflow.com/questions/36071272/fix-unknown-repository-of-an-opened-pr-after-deleted-the-fork
isaacs/github#168

This means the head.repo could be null, although this isn't documented
in the API doc for listing pull requests:

https://developer.github.com/v3/pulls/#list-pull-requests

This causes github-api to throw an exception:

java.util.NoSuchElementException: None.get

Here's how to recreate the bug with a JSON payload in a file.

import org.json4s.JArray
import org.json4s.jackson.JsonMethods.parse
import codecheck.github.models.PullRequest

val json = scala.io.Source.fromFile("data/prs.json").getLines.mkString
parse(json).asInstanceOf[JArray].arr.map(PullRequest(_)).map(_.head.repo.name)

ashawley added a commit to ashawley/github-api-scala that referenced this issue Feb 18, 2018

Change head.repo on pull requests to Option
Pull requests can have their forks deleted:

https://stackoverflow.com/questions/36071272/fix-unknown-repository-of-an-opened-pr-after-deleted-the-fork
isaacs/github#168

This means the head.repo could be null, although this isn't documented
in the API doc for listing pull requests:

https://developer.github.com/v3/pulls/#list-pull-requests

This causes github-api to throw an exception:

java.util.NoSuchElementException: None.get

Here's how to recreate the bug with a JSON payload in a file.

import org.json4s.JArray
import org.json4s.jackson.JsonMethods.parse
import codecheck.github.models.PullRequest

val json = scala.io.Source.fromFile("data/prs.json").getLines.mkString
parse(json).asInstanceOf[JArray].arr.map(PullRequest(_)).map(_.head.repo.name)

ashawley added a commit to ashawley/github-api-scala that referenced this issue Feb 18, 2018

Change head.repo on pull requests to Option
Pull requests can have their forks deleted:

https://stackoverflow.com/questions/36071272/fix-unknown-repository-of-an-opened-pr-after-deleted-the-fork
isaacs/github#168

This means the head.repo could be null, although this isn't documented
in the API doc for listing pull requests:

https://developer.github.com/v3/pulls/#list-pull-requests

This causes github-api to throw an exception:

java.util.NoSuchElementException: None.get

Here's how to recreate the bug with a JSON payload in a file.

import org.json4s.JArray
import org.json4s.jackson.JsonMethods.parse
import codecheck.github.models.PullRequest

val json = scala.io.Source.fromFile("data/prs.json").getLines.mkString
parse(json).asInstanceOf[JArray].arr.map(PullRequest(_)).map(_.head.repo.name)
@iSkore

This comment has been minimized.

iSkore commented Mar 6, 2018

+1

1 similar comment
@micky2be

This comment has been minimized.

micky2be commented Mar 15, 2018

+1

@aspiers

This comment has been minimized.

aspiers commented Mar 19, 2018

Firstly, for the love of $DEITY PLEASE STOP SPAMMING THIS ISSUE WITH +1 COMMENTS! Every time you do that it spams the inboxes of everyone subscribed to the issue. If you want to register your support for this issue, or any other reaction, use the reaction icon GitHub provided for this near the top-right of the original issue description. (And for anyone suffering from this spam, you can use @Mottie's awesome userscript to automatically hide the spam. See also #640).

Known workaround for this problem

With that rant out of the way, I want to highlight one of the few useful comments on this issue, which is from @jcasner but unfortunately got buried amongst all the comment spam. It points to this very useful gist which explains how to work around this issue.

Again that gist is full of comments, so to save you wading through them all, here's the TL;DR:

If there is a PR displaying unknown repository after the fork was deleted, and you want to resurrect that PR, simply type:

git fetch origin refs/pull/123/head:foo

substituting (if necessary) origin for the remote pointing at the target repo, 123 for the PR number, and foo for the name of the local branch you want created to point to the head of the PR.

Then you can simply git checkout foo, close the stale PR, and resubmit a new one which supersedes it.


Please don't just react & DON'T +1/👍-only post: also contact GitHub supporting this & report back here!

@nutmix

This comment has been minimized.

nutmix commented Aug 14, 2018

I am having the opposite problem. I deleted my fork, so I could "refork", and now I cant fork. It says the fork already exists. Havent found a work around yet, other than to create new dummy users which would be a pain.

@SamuelToh

This comment has been minimized.

SamuelToh commented Sep 10, 2018

+1 for this.

@RaidAndFade

This comment has been minimized.

RaidAndFade commented Oct 5, 2018

This leads to a more pronounced issue in the api where a pull requests diff in the api cannot be retrieved, and is always "Sorry, this diff is unavailable." even if the PR itself has clear differences in the individual commits. Not sure whether this should be a new issue of its own or a follow up of this but it's definitely related.

@jnm2

This comment has been minimized.

jnm2 commented Oct 26, 2018

https://blog.github.com/2018-08-28-announcing-paper-cuts/

Project Paper Cuts is dedicated to working directly with the community to fix small to medium-sized workflow problems, iterate on UI/UX, and find other ways to make the quick improvements that matter most.

@guilhermeleobas guilhermeleobas referenced this issue Oct 28, 2018

Closed

opt: add page #2500

5 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment