You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh issue create -R doesn't show issue templates #2361
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!
@divyaramanathan Sorry for the late reply! We would appreciate if someone like you could take a stab at this.
There is now a Repository.issueTemplates GraphQL 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 -R was passed and when it wasn't passed. See pkg/cmd/issue/create/create.go for existing code that uses githubtemplate, 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.pullRequestTemplates GraphQL 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 -R was used.
Reacted by Noah Lev, Divya Ramanathan and Zach Boyle
Hey @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!
Activity
divyaramanathan commentedon Nov 6, 2020
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!
samcoe commentedon 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.mislav commentedon 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.divyaramanathan commentedon Dec 3, 2020
Hey @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!