Skip to content

Unify logic to checkout PRs #9439

Closed

Description

@rafeca

Currently, there are two ways to checkout a PR:

  1. From the "Pull Requests" list tab that appears on the GitHub Desktop app.
  2. From github.com when navigating to a Pull Request page.

Each of these entry points has its own logic, which causes a few inconsistencies/bugs mostly on the checkout from dotcom flow.

Unifying this logic will make it much easier to fix bugs and keep the behaviour more consistent between the two flows.

(note that these bugs can be reproduced in current production).

1. PR branches created in dotcom don't get associated to the PR

How to reproduce:

  • Clone a repository that has PRs (e.g desktop/desktop) from Desktop.
  • Open a the dotcom page of a PR that was created from a fork (e.g https://github.com/desktop/desktop/pull/9430).
  • Click on the open this in GitHub Desktop link.

Expected behaviour: The PR branch gets checked out and it gets linked to the PR in the desktop UI:

Screenshot 2020-04-02 at 17 20 49

Actual behaviour: The PR branch does not get linked to the PR:

Screenshot 2020-04-02 at 17 19 58

2. Cannot checkout some PRs from dotcom

There's a quite rare situation that can cause an error popping out when trying to checkout some specific PRs from dotcom (@tierninho ran into it in #9340 (comment)).

Steps to reproduce:

  • Clone kuychaco/urban-potato from Desktop.
  • Open https://github.com/not-kuychaco/urban-potato/pull/3 and click on the open this in GitHub Desktop link.

Expected behaviour: The PR branch gets checked out.

Actual behaviour: The following error appears:

Screenshot 2020-04-02 at 17 49 38

3. Wrong name of PR branches created from Desktop

When checking out a PR created on an upstream repository from Desktop, in some situations (when the PR was created from a branch in the upstream repository) the local branch will have an incorrect name and the upstream remote will get duplicated.

(this issue is only reproducible with the changes in #9340, since before that the upstream PRs were not shown).

Steps to reproduce:

  • Clone kuychaco/urban-potato from Desktop.
  • Go to the list of PRs inside Desktop and click on the "Update readme.md" PR (PR number 3).

Expected behaviour: A local branch called kuychaco-patch-1 is created tracking upstream/kuychaco-patch-1 (the branch of the PR).

Actual behaviour: A new remote github-desktop-not-kuychaco is added to the repo with the same value as the upstream remote and a local branch called pr/3 is created tracking github-desktop-not-kuychaco/kuychaco-patch-1.

(this is not a big issue, but it's inconsistent with what happens when checking out the same PR from dotcom, see #9340 (comment)).

Activity

  1. added
    tech-debt
    on Apr 2, 2020
  2. self-assigned this
    on Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

epic:forktech-debt

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions