Skip to content

Issue create shows wrong templates #503

Closed

Description

@gianarb

Describe the bug

When I try to open an issue via CLI to gianarb/gianarb.github.com the prompt that lists available template does not show what I expect. It shows wrong templates.

Steps to reproduce the behavior

gh issue create --repo gianarb/gianarb.github.com 

Creating issue in gianarb/gianarb.github.com

? Choose a template  [Use arrows to move, type to filter]
  Beta: Bug report
> beta--feature-request.md

Expected vs actual behavior

As you can see the cli proposes two templates. But my repository only has one

https://github.com/gianarb/gianarb.github.com/issues/new/choose

Activity

  1. added
    bug
    on Feb 19, 2020
  2. added
    priority-3
    on Feb 19, 2020
  3. mislav commented on Feb 19, 2020

    @mislav
    Contributor

    @gianarb Thank you for reporting!

    I think that the bug is that, even though you've used the --repo, the issue templates are still read from the same current directory ignoring the --repo flag. This behavior is clearly wrong, as you've demonstrated. We will try to address this.

  4. gianarb commented on Feb 19, 2020

    @gianarb
    Author

    Hello @mislav ,

    I tried moving my terminal in the root directory of the project I am referencing to as you suggested, I removed the --repo flag as well, but now I do not get the template selection anymore:

    $ gh issue create
    
    Creating issue in gianarb/gianarb.github.com
    
    ? Title 
  5. mislav commented on Feb 19, 2020

    @mislav
    Contributor

    @gianarb Thanks for following up.

    Since there is only 1 template in your repo, there is no template chooser. This is by design. Your template will automatically be used when you choose to open the text editor to author the issue body. I can see how this could be confusing after your previous experience, though.

    func selectTemplate(templatePaths []string) (string, error) {
    templateResponse := struct {
    Index int
    }{}
    if len(templatePaths) > 1 {

  6. gianarb commented on Feb 19, 2020

    @gianarb
    Author

    Ah ok! yeah, this is another behavior I was not getting right.
    My expectation (just as the UI does), is to see the list of templates in any case (even if we have only one) because we should have something like Blank available to get a clean issue without any template.

    But I understand the behavior now that you told me it and I can keep removing the pre-populated information if I do not need them. But from who comes from the UI (everybody) this flow will look a bit weird I presume, but I don't know 👍 no big deal for me

  7. mislav commented on Feb 19, 2020

    @mislav
    Contributor

    My expectation (just as the UI does), is to see the list of templates in any case (even if we have only one) because we should have something like Blank available to get a clean issue without any template.

    That makes sense! We will try to provide an option to use the blank template just like the web UI does. Thank you for the suggestion!

  8. vilmibm commented on Sep 16, 2020

    @vilmibm
    Contributor

    I think we can call this closed as of #950

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

    bugpriority-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions