Skip to content

Switching to PR branches (forks) no longer works #4842

Closed

Description

@MasterXen

Description

Selecting a pull request under the "Current Branch" menu used to stash changes and check out the PR locally. In the case of a PR that was opened against a fork (rather than a direct branch), GitHub Desktop used to create a new remote usually prefixed with github-desktop-xxxxx.

In the two most recent (stable) releases, the functionality to switch to PR branches silently fails with no change in the UI nor any visible errors in the logs.

Shown below is my selection of a PR hosted on GitHub (in a private repository) where the selection (via mouse click) closes the menu but results in no branch switch:

record

Version

  • GitHub Desktop: 1.2.x (occurs in 1.2.2 and 1.2.1)
  • Operating system: MacOS 10.13.4

Steps to Reproduce

  1. Add a local repository
  2. Create a pull request where the PR originates in a fork (not a branch of the repository)
  3. Use GitHub Desktop to view and checkout this PR

Expected Behavior

PRs originating from forks are available for local checkout (pull)

Actual Behavior

PRs originating from forks are not available for local checkout (pull)

Additional Information

Logs

2018-05-31.desktop.production.log

Activity

  1. iAmWillShepherd commented on May 31, 2018

    @iAmWillShepherd
    Contributor

    Thanks for taking the time to open an issue! 🙇

    Do you get this behavior on all repositories or just the one you mentioned?

  2. MasterXen commented on May 31, 2018

    @MasterXen
    Author

    I'm getting this across all repositories -- I have tried this with multiple PRs in each repository. Switching to other local branches works as expected.

    However, GitHub Desktop does several steps to check out a forked PR (thanks for that!) and none of those seem to be working any longer.

  3. shiftkey commented on May 31, 2018

    @shiftkey
    Member

    @MasterXen do you recall if this worked with 1.2.0? I ask because this PR #4240 might have been responsible for a change in behaviour.

    From the details I've gleaned from your issue it's a private repository, so the PRs are probably coming from local branches, so maybe if 1.2.0 is also affected we need to revert that change and revisit it.

    EDIT: one other thing to help with this theory - can run a git remote for this repository, attach the names to this issue and indicate which one is your default remote? Maybe something with our lookup code isn't handling your setup correctly.

    EDIT 2: argh, I missed the mentions that these PRs are coming from forks and not local branches. Apologies.

  4. added
    more-info-needed
    on May 31, 2018
  5. added
    investigation-needed
    on Jun 1, 2018
  6. ZeeWanderer commented on Jun 1, 2018

    @ZeeWanderer

    I too am unable to pull/checkout any remote PRs on any repositories. Already pulled PRs are available for chekout in the branch tab. Also if i add fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to [remote "origin"] in .git\config to pull all PRs on fetch then all of them are available for chekout in the branch tab.
    Console output:
    exception_0:
    Uncaught (in promise) ReferenceError: i is not defined
    at t.AppStore._checkoutPullRequest (renderer.js:17)
    at t.Dispatcher.checkoutPullRequest (renderer.js:17)
    at Object.onPullRequestClicked.e [as onItemClick] (renderer.js:17)
    at Object.onItemClick.e [as onItemClick] (renderer.js:17)
    at Object.onRowClick.e [as onRowClick] (renderer.js:12)
    at Object.onRowClick (renderer.js:17)
    at onRowClick.e (renderer.js:17)
    at Object.<anonymous> (renderer.js:25)
    at Object.invokeGuardedCallback (renderer.js:25)
    at Object.invokeGuardedCallbackAndCatchFirstError (renderer.js:25)
    exception_1:
    Uncaught (in promise) ReferenceError: i is not defined
    at t.AppStore._checkoutPullRequest (app-store.ts:3650)
    at t.Dispatcher.checkoutPullRequest (dispatcher.ts:1141)
    at Object.onPullRequestClicked.e [as onItemClick] (branches-container.tsx:237)
    at Object.onItemClick.e [as onItemClick] (pull-request-list.tsx:191)
    at Object.onRowClick.e [as onRowClick] (filter-list.tsx:340)
    at Object.onRowClick (list.tsx:909)
    at onRowClick.e (list-row.tsx:52)
    at Object.<anonymous> (react-dom.production.min.js:15)
    at Object.invokeGuardedCallback (react-dom.production.min.js:16)
    at Object.invokeGuardedCallbackAndCatchFirstError (react-dom.production.min.js:16)
    issue gif

    This problem was not present on version 1.2.0. I skipped over 1.2.1 so i don't know if it was also affected.

    Github Desktop Version: 1.2.2
    OS: Windows 10 1803 x64

  7. MasterXen commented on Jun 1, 2018

    @MasterXen
    Author

    @shiftkey:

    do you recall if this worked with 1.2.0? I ask because this PR #4240 might have been responsible for a change in behaviour.

    I'm confident that this is a recent breaking change but I was unable to find a way to download a prior version of the .DMG installer to verify. I tried to poke around central.github.com but had no luck to "guess" the older installer location :)

    For the error itself:
    I completely forgot about using the Developer Tools, but I can confirm that the error that @Maximilian578 reported above matches what I'm seeing onclick of a PR line item as well:

    app-store.ts:3650 Uncaught (in promise) ReferenceError: i is not defined
        at t.AppStore._checkoutPullRequest (app-store.ts:3650)
        at t.Dispatcher.checkoutPullRequest (dispatcher.ts:1141)
        at Object.onPullRequestClicked.e [as onItemClick] (branches-container.tsx:237)
        at Object.onItemClick.e [as onItemClick] (pull-request-list.tsx:191)
        at Object.onRowClick.e [as onRowClick] (filter-list.tsx:340)
        at Object.onRowClick (list.tsx:909)
        at onRowClick.e (list-row.tsx:52)
        at Object.<anonymous> (react-dom.production.min.js:15)
        at Object.invokeGuardedCallback (react-dom.production.min.js:16)
        at Object.invokeGuardedCallbackAndCatchFirstError (react-dom.production.min.js:16)
    
  8. MasterXen commented on Jun 1, 2018

    @MasterXen
    Author

    (Side note, I'm somewhat surprised that the uncaught errors in the UI are not being put into the *.log files)

  9. mosinve commented on Jun 2, 2018

    @mosinve

    Locally built dev version works well though, while prod version have this bug.

  10. removed
    more-info-needed
    on Jun 3, 2018
  11. shiftkey commented on Jun 4, 2018

    @shiftkey
    Member

    @MasterXen @mosinve thanks for the extra support. I've opened #4859 to address this, hopefully we can get this out soon!

  12. self-assigned this
    on Jun 4, 2018
  13. added
    bug
    and removed
    investigation-needed
    on Jun 4, 2018
  14. locked as resolved and limited conversation to collaborators on Aug 6, 2018
  15. unlocked this conversation on Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions