Skip to content

🐛 gh repo create: Internal repository creation fails with a GraphQL error #2101

Closed

Description

@contourintegrals

Describe the bug

Output of gh --version:

gh version 1.0.0 (2020-09-16)
https://github.com/cli/cli/releases/tag/v1.0.0

When I tried to create an internal repo, this throws some GraphQL error:
Error image

The last message says:

GraphQL error: Something went wrong while executing your query. Please include `DDCB:419F:16E783A:1CC5E81:5F7C0869` when reporting this issue.

Steps to reproduce the behavior

  1. Type this gh repo create
  2. Answer the questions that follow, the visibility is Internal
  3. See error

Expected vs actual behavior

Expected: Create an internal GitHub repository.
Actual: Throws a GraphQL Error.

Activity

  1. added
    bug
    on Oct 6, 2020
  2. samcoe commented on Oct 6, 2020

    @samcoe
    Contributor

    @shrihanDev Are you trying to specifically create an internal repo? That is a special type of repo specific to enterprise accounts, if you are not creating the repository in an organization that is owned by an enterprise account then you won't be able to create this type of repo. docs

  3. ShubhankarKG commented on Oct 6, 2020

    @ShubhankarKG
    Contributor

    Can we selectively show the visibility to users when creating a repository ? Like if user isn't creating an enterprise repo, do not show the INTERNAL visibility. If that is possible, then we could use it to hide Internal visibility altogether.

  4. samcoe commented on Oct 6, 2020

    @samcoe
    Contributor

    @ShubhankarKG That is a good question. I think that is technically possible (there are API's we could use, I would want to double check) but would require some larger changes to the repo creation flow. Please feel free to open an enhancement issue around this feature. One easier change, that might make a difference, would be to add some description to each repo visibility type in the prompt text to make it less confusing.

  5. contourintegrals commented on Oct 6, 2020

    @contourintegrals
    ContributorAuthor

    @shrihanDev Are you trying to specifically create an internal repo? That is a special type of repo specific to enterprise accounts, if you are not creating the repository in an organization that is owned by an enterprise account then you won't be able to create this type of repo. docs

    Actually, I meant that it shouldn't show a GraphQL error like this. It should show something like: You cannot create an Internal repo........
    Or actually make this conditionally show if the account is an enterprise one, as @ShubhankarKG said.

  6. samcoe commented on Oct 7, 2020

    @samcoe
    Contributor

    @shrihanDev That makes sense. You are correct, the error message is not very helpful and could be made better. Since we now have #2106 I am going to close out this issue. We can move any further discussion about how best to solve this in that enhancement issue.

  7. Jenz8986 commented on Oct 29, 2021

    @Jenz8986

    2101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions