Repository navigation
gh issue create -R doesn't show issue templates #2361
Description
Activity
Hello! I might be interested in taking a deeper look at this; does your team have any resources or tips you'd recommend to get started? Thanks so much!
Reacted by Zach Boyle- addedenhancementa request to improve CLIa request to improve CLIhelp wantedContributions welcomeContributions welcomeand removedbugSomething isn't workingSomething isn't working
on Nov 16, 2020 @camelid Good catch. I changed this to an enhancement since right now that is how the command is designed to work. We only check locally for issue templates, and when specifying the
-Rflag it is not required to have the repository cloned locally. The GraphQL API does expose repo issue templates though https://docs.github.com/en/free-pro-team@latest/graphql/reference/objects#issuetemplate so I don't see why we could not support handling this case.Reacted by Noah Lev and Divya Ramanathan- addedcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsand removedhelp wantedContributions welcomeContributions welcome
on Nov 16, 2020 - addedbugSomething isn't workingSomething isn't workinghelp wantedContributions welcomeContributions welcomepriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functionsand removedcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIa request to improve CLI
on Nov 16, 2020 @divyaramanathan Sorry for the late reply! We would appreciate if someone like you could take a stab at this.
There is now a
Repository.issueTemplatesGraphQL connection that returns a list of IssueTemplate objects. Our original templates implementation predates this API, so we opted to read the templates from disk instead. This, of course, does not work with-R.My preferred solution would be to use the API both when
-Rwas passed and when it wasn't passed. Seepkg/cmd/issue/create/create.gofor existing code that usesgithubtemplate, but should use API calls instead. You can try prototyping up these API calls!For pull request templates, we still have to read files from disk (i.e. use the old approach) because there is no
Repository.pullRequestTemplatesGraphQL API.@samcoe I've reclassified this as a bug, even though the original code is working as intended, since I feel that issue/PR templates should behave the same regardless of whether
-Rwas used.Reacted by Noah Lev, Divya Ramanathan and Zach BoyleHey @mislav and @samcoe! Apologies for the late reply to this, but finally took a stab at it!
Myself and @zaboyle wrote up a GraphQL API call to get issue templates and are attempting to use these when creating issues from the command line. Our changes are in #2539 and we'd love to hear any and all feedback!
Follow-up question: We noticed that the program was still defaulting to read files from the file system. How would you recommend calling the API appropriately? Thanks so much!
Reacted by Sam Coe
Describe the bug
gh issue create -Rdoesn't ask to choose an issue template, whilegh issue createin a clone of the repo does.Steps to reproduce the behavior
gh issue create -R rust-lang/rust(should happen forcli/clitoo)cdinto a clone ofrust-lang/rustand typegh issue createExpected vs actual behavior
Both should ask to choose a template.