Skip to content

Onboarding GitHub Enterprise users #1180

Closed

Description

@mislav

As part of offering GHE compatibility #273, we need to make some UI decisions on how to onboard users, i.e. authenticate them against their instance and detect when a local repository is a clone from a GHE host as opposed to from github.com.

  1. When in the context of a git repository, we might detect that the main git remote does not point to a github.com host, but to example.org, for example.

    • How should we assume if example.org is a GHE host that we should try authenticating against?
    • How should the authentication flow look like? E.g. Press Enter to open https://example.org/authorize in your browser
    • If there are several git remotes of which some point to github.com and others to a GHE host, which one should we default to?
  2. When not in the context of a git repository, how should users instruct commands such as repo create, repo clone owner/repo, repo fork owner/repo, and commands such as issue view 123 -R owner/repo to operate on their GHE instance instead of github.com?

    • In hub, users may set GITHUB_HOST=example.org in their environment before invoking a hub command, and that solution is fine for programmatic use, but not ideal for casual use.
  • Also in hub, whenever a user has previously authenticated against their GHE host, commands like hub clone repo prompt with Select host: and github.com, example.org as options. This works, but I find the interactive prompt sometimes tiresome considering I'm cloning from github.com 99% of the time.

/cc @ampinsk @billygriffin

Activity

  1. added
    needs-design
    enhancement
    on Jun 12, 2020
  2. mislav commented on Jul 23, 2020

    @mislav
    ContributorAuthor

    After chats with @ampinsk:

    1. We will add a dedicated authentication command, so when we encounter a hostname we don't recognize, we can print something like: To authenticate against example.com GitHub Enterprise instance, run `gh auth example.com` Dedicated authentication command #1413

    2. Proposed syntaxes for explicitly selecting a hostname:

      • gh repo view hubot/robots --host example.com
      • gh repo view example.com/hubot/robots
      • GH_HOST=example.com gh repo view hubot/robots
      • gh issue list -R example.com/hubot/robots
    3. When someone has authenticated against multiple GitHub hosts, but hasn't explicitly specified one for a command such as gh repo clone, there will be a prompt asking you to select a host.

      • Perhaps there could be a config setting to specify a default host?
  3. gibfahn commented on Aug 5, 2020

    @gibfahn

    A nice default for some commands might be to look at the remote-tracking branches of HEAD, e.g.

    • gh repo fork -> default to forking the @{upstream} branch's remote
    • gh pr create -> default to creating a PR to merge @{push} into @{upstream} (or merge @{upstream} into <prompt for remote> if @{push} == @{upstream})
    • gh pr checkout -> default to checking @{upstream} remote for PRs

    I currently use hub to have a zero-manual-effort g pr command, but it doesn't work when you have more than 2 remotes because, and it would be really nice to have this work in that context.


    This works, but I find the interactive prompt sometimes tiresome considering I'm cloning from github.com 99% of the time.

    FWIW 90% of the time I'm interacting with GHE (although it's really irritating because I already set up my remotes, so things should work with that).

  4. mislav commented on Aug 6, 2020

    @mislav
    ContributorAuthor

    After chats with @ampinsk, this is how a selection of a default host could look like:

    $ gh config set default_host example.com
    $ gh repo clone owner/repo  #=> defaults to cloning the repo from example.com
    $ gh repo clone github.com/owner/repo  #=> explicitly clone a repo from github.com
  5. gibfahn commented on Aug 8, 2020

    @gibfahn

    Allowing the --repo option to directly take a URL instead of just a org/repo combo would make things a lot easier, especially in situations when copy-pasting, or passing in input from scripts. Raised #1505

  6. self-assigned this
    on Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementneeds-design

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions