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

Update "not found" repo error for missing orgs #3764

Closed
tierninho opened this issue Jan 11, 2018 · 10 comments
Closed

Update "not found" repo error for missing orgs #3764

tierninho opened this issue Jan 11, 2018 · 10 comments
Labels
enhancement good first issue Issues marked as ideal for a brand new contributor to start with help wanted Issues marked as ideal for external contributors
Milestone

Comments

@tierninho
Copy link
Contributor

Currently we display "Not found" as the error message when a user attempts to publish a repo to an GitHub or Enterprise org that was recently deleted or renamed.

The error message should be more clear, perhaps "The selected organization was not found. Please try again."

This error message should also be removed if the user navigates to another tab to publish the repo.

screen shot 2018-01-11 at 8 54 37 am

osx,1.0.12-beta1

@tierninho tierninho added help wanted Issues marked as ideal for external contributors good first issue Issues marked as ideal for a brand new contributor to start with labels Jan 11, 2018
@JQuinnie
Copy link
Contributor

JQuinnie commented Jan 13, 2018

I would like to work on this issue, I will open a PR soon.

@iAmWillShepherd iAmWillShepherd added this to Tracking in @iAmWillShepherd Jan 13, 2018
@shiftkey
Copy link
Member

@JQuinnie the area of the codebase you probably need to modify to fix this is here. In here we should check for the 404 and instead throw a more friendly error message.

@iAmWillShepherd
Copy link
Contributor

iAmWillShepherd commented Jan 14, 2018

Turns out we are not keeping track of what orgs a user is a part of. We need to add this in before this issue is attempted.

@shiftkey
Copy link
Member

shiftkey commented Jan 14, 2018

@iAmWillShepherd do we need to track that? We already render the orgs list when it's publish time, and that should be relatively up to date enough to not bother with extra work.

Currently we display "Not found" as the error message when a user attempts to publish a repo to an GitHub or Enterprise org that was recently deleted or renamed.

@tierninho to be clear here, are these the repro steps (or similar) you performed?

  1. Create new repository
  2. Open publish repository dialog, which loads list of orgs
  3. Select organization X
  4. Rename or delete organization X so it's no longer valid
  5. Publish the repository
  6. Not Found error displayed

The reason I ask for steps is that this feels like an uncommon scenario (orgs are removed or renamed infrequently, and we might get the benefits of repository redirects in the API that hide away the work to deal with renamed orgs).

@Daniel-McCarthy
Copy link
Member

Daniel-McCarthy commented Aug 8, 2018

I am interested in giving this Issue a try (as long as JQuinnie is no longer interested).

However, I got a bit stuck reproducing it. While I was able to reproduce the exact steps listed above in my stable 1.3.2 installation of GitHub Desktop. However, any builds I made from a clone of the current Desktop repository were unable to detect any organizations in the Publish Repository window.

I have tried this on a few machines and tried two different accounts I had created an organization on. Currently I'm not sure if there has been a change to how this system works, if it could be a bug, user error, or something on my end.

@shiftkey
Copy link
Member

shiftkey commented Aug 8, 2018

However, any builds I made from a clone of the current Desktop repository were unable to detect any organizations in the Publish Repository window.

This is a known limitation about the development OAuth tokens being caught by application restrictions that can be enforced by organizations: #3364 (comment)

@Daniel-McCarthy
Copy link
Member

I see, thank you for the very quick response. Are these the steps you followed to resolve this? I have disabled third party app restrictions in the organization, however it still does not show for me. Is there a different process for Github Desktop?

Sorry to take up your time with this.

@shiftkey
Copy link
Member

shiftkey commented Aug 8, 2018

@Daniel-McCarthy I think you also need to enable access to "GitHub Desktop Dev" as it's a separate OAuth app.

Sorry to take up your time with this.

No problem, and I'm sorry this has been a pain to dig into.

@Daniel-McCarthy
Copy link
Member

Daniel-McCarthy commented Aug 11, 2018

Ah great, thank you again for the assistance.

No problem, and I'm sorry this has been a pain to dig into.

It's definitely not a pain. I'm happy to learn and try to help.

However, I was curious if there is a way to bypass causing the function to do this extra work by making use of the caught error/APIError or the returned response variable in the createRepository function. Is there a way to use the already provided information to determine that the organization is the causative factor in the publishing to fail (so that I can throw the new error only in that circumstance)?

Tierninho additionally suggested that the error be cleared when switching to another tab. I would happily submit a pull request for that as well. Should we also refresh the organizations list? In my tests, after switching to enterprise and back, you can still select this no longer existing organization.

@outofambit
Copy link
Contributor

@Daniel-McCarthy, @shiftkey It look like this issue has been addressed by the two PRs above, correct? If not, please reopen/comment this issue. thanks!

@iAmWillShepherd automation moved this from Tracking to Done Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Issues marked as ideal for a brand new contributor to start with help wanted Issues marked as ideal for external contributors
Projects
No open projects
Development

No branches or pull requests

6 participants