check for disabled issues in issue view#240
Conversation
mislav
left a comment
There was a problem hiding this comment.
Thanks for handling this!
This smells to me like a bug in our API: if a repository has issues disabled, how come it lets us query specific issues from within it? But in any case, we have to work around it.
command/issue.go
Outdated
| return err | ||
| } | ||
|
|
||
| issuesEnabled, err := api.HasIssuesEnabled(apiClient, baseRepo) |
There was a problem hiding this comment.
This looks good! But I'm wondering whether we can avoid making this additional query every time? Using GraphQL, we can request extra information in existing queries.
For instance, this is done right before an issueFromArg(). In that call, we call api.IssueByNumber() to check if an issue exists. Within that call, we could add the hasIssuesEnabled field to repository and return an error if it returned false. That way we save ourselves an extra round trip to the server.
If this idea doesn't seem clear to you, let me know and we can try doing this together!
There was a problem hiding this comment.
it's clear. i have an impulse to have more clear and specific API helper functions but in retrospect that goes against the spirit of graphql :( i can retool for that.
|
ok, ready for a re-review @mislav |
mislav
left a comment
There was a problem hiding this comment.
Fantastic! Thank you for following up 🎉
check for disabled issues in issue view
* feat: Project tasks support reference object * fix: show only reference or only branch * fix: failing test and introduce additional cases * fix: extract reference deconstruction * Update api/models/project_v1_alpha.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update api/models/project_v1_alpha.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
closes #226
this PR adds another graphql query to
gh issue viewto ensure that a repo actually has issuesenabled before trying to query issues.