Repository navigation
[Fork] "Do you want to fork this repository?" Dialog - #8889
Conversation
b8f1d48 to
f41229c
Compare
@tierninho Great question. We discussed this, and creating a new local repo such that they now have both would require somehow moving the in-progress work over from one repo to the other. It's also likely that if they're in this situation, they're an external contributor and therefore having both is likely redundant and potentially confusing. |
|
Hey @niik thanks for all the great feedback!
@ampinsk and I did a pass at the copy to make this more clear. I've included full repo names (owner/repo-name) in the dialog text and updated the screenshots in the PR description (but not the gif).
Good shout! Done in 2c51b27.
I have this question too. So far in using the API, I haven't hit a case where the repo isn't ready by the time it needs to be, but its certainly possible. I think I'd like to address this safeguard in a follow up pull request, if that's ok with you? (My proposal would be some kind of polling with |
😆 @tierninho i fixed that right after in 94df80f. Good spot! |
|
I’m a bit iffy about the grammar of the error dialog. It just... doesn’t feel right. Maybe word it “We could not create your fork ”? |
| <> | ||
| <DialogContent> | ||
| <div> | ||
| {`Making your fork `} |
There was a problem hiding this comment.
| {`Making your fork `} | |
| {`We could not make your fork `} |
| <strong> | ||
| {`${props.account.login}/${props.repository.gitHubRepository.name}`} | ||
| </strong> | ||
| {` failed. `} |
There was a problem hiding this comment.
| {` failed. `} | |
| {` . `} |
niik
left a comment
There was a problem hiding this comment.
Seems like the build is legit failing here. I suspect it's because you're using multiple prop interfaces in the same file, I doubt the tslint rule is set up to handle that. Or it's the use of React.SFC, idk. I'd recommend for time and efficiency's sake to just use renderContent / renderErrorContent instance methods like we do in most other places.
I have this question too. So far in using the API, I haven't hit a case where the repo isn't ready by the time it needs to be, but its certainly possible. I think I'd like to address this safeguard in a follow up pull request, if that's ok with you?
Yeah, a follow up is fine. It might not be a problem but we have run into this general type of problem before. I think identifying what the failure mode would be if this happens should be our first priority and if it's not gnarly then we can skip that implementation entirely or wait until we hear it being a problem.
(My proposal would be some kind of polling with git ls-remote to make sure git objects are accessible, with a timeout. Perhaps max 3 seconds poll interval with a 60 second timeout? If it were to timeout but finish later, a subsequent run of the create fork flow would find that fork and use it, not try to make another (this is how the github fork api endpoint works).)
Pretty much what I thought too except I think we could do a fetch since that's something we're going to have to do anyway (rather than an ls-remote). I think we could optimize for the ideal case and do a fetch almost immediately or perhaps after a 1 or 2 second initial delay and then ~3 more fetches with an increasing backoff in between to match an overall timeout at roughly 30 seconds or so.
Co-Authored-By: Markus Olsson <[email protected]>
|
@niik should all be good now!
great point. i'm on it! #8949 |


closes #8548
This PR adds the basic "make a fork" dialog flow, triggered by a failed push to a repo that the user doesn't have write access to.
Create Fork Prompt

Error Dialog

Happy Flow

Description
AppStoremethod for redirecting a local repo to point to a fork