vermiculus / magithub

**DEPRECATED - please use Forge instead!** -- Magit-based interfaces to GitHub
GNU General Public License v3.0
579 stars 63 forks source link

Display issues regardless of milestone membership #374

Closed goodmami closed 6 years ago

goodmami commented 6 years ago

Not sure if this is a bug report or a feature request, or even a documentation request.

I use milestones with my GitHub issues for release planning, but Magithub seems to only list issues that are not assigned to a milestone. Note that this is different from #92, since I don't want to list issues with a specific milestone, but rather list all issues regardless of their milestone membership.

According to the GitHub API, passing none as the value of the milestone parameter lists only returns those without a milestone, while * returns all issues. This seems to describe the behavior I'm seeing, but I don't know where in the code the query takes place. I tried searching the Magithub code, but maybe it's in ghub or somewhere else? Sorry I'm not terribly proficient at Lisp so I can't easily track this down.

Is it currently possible to change the query to list all open issues? If not, where should I look for fixing this?

goodmami commented 6 years ago

since I don't want to list issues with a specific milestone

Well, actually, listing issues for a specific milestone would be a very welcome feature, but I meant that this issue is describing a different use case (the default list of repository issues)

vermiculus commented 6 years ago

This is truly strange -- I don't think I've seen this behavior.

What does (magithub--issue-list) return when evaluated inside your repo directory?

goodmami commented 6 years ago

What do you mean by inside the "repo directory"? Just that Emacs is opened with the repo as its working directory? I tried writing that in the *scratch* buffer and evaluating with C-x C-e and it prints some results in the status line, but I cannot copy them (clicking on the line makes it disappear) and I'm only able to see one or two issues before the result is truncated.

When I was trying to figure out how to run (magithub--issue-list) I ran M-x magithub-issue-refresh and it requested my password. After providing it, the issues with milestones were displayed in the list. Could this be some kind of authentication issue?

vermiculus commented 6 years ago

Run (mapc (lambda (i) (insert (concat (let-alist i .title) "\n"))) (magithub--issue-list)) to see everything (untested). Do you see every issue you expect to see?

Could this be some kind of authentication issue?

It's possible, but I don't see how. It's more likely the issues are getting filtered by magithub-issue-issue-filter-functions or there's a default API parameter value that's not being accounted for.

goodmami commented 6 years ago

Run (mapc (lambda (i) (insert (concat (let-alist i .title) "\n"))) (magithub--issue-list)) to see everything. Do you see every issue you expect to see?

Yes, although I can't say if it would have been different before I ran M-x magithub-issue-refresh. My issue seems to have been resolved by running that, although I'd still like to figure out what the original problem was. I use 2FA with GitHub and I followed the instructions here: https://github.com/vermiculus/magithub/blob/master/magithub.org#authentication, but Emacs doesn't usually ask for my password (presumably to decrypt the .authinfo file), so I wonder if a token expired or something.

It's more likely the issues are getting filtered by magithub-issue-issue-filter-functions or there's a default API parameter value that's not being accounted for.

I have not changed the default settings for that parameter. When I tried using curl to make an API call, it seems the default value for the milestone parameter was *, not none, but that was the REST API and not the GraphQL one.

vermiculus commented 6 years ago

Is it possible the issues in question were 'new' issues such that they didn't exist when Magithub last pulled data for this repository? Since there may be many issues in a repository and the status buffer is refreshed a lot (after staging a hunk, for example), issues are cached to avoid excessive API hits. magithub-issue-refresh (bound to g when in an issue section) updates the cache with new information from GitHub.

Could that be what's going on?

goodmami commented 6 years ago

Hmm, that's possible. The repo in question has several issues assigned to a milestone that are all 21 days old, and the next issue (the first one displayed when I filed this issue) had no milestone and was ~60 days old. I'd like to think the cache could be refreshed, e.g., once a day, without causing excessive API hits. Is there a way to customize the cache lifespan?

vermiculus commented 6 years ago

There used to be, but not currently. It added a lot of complexity that was hard to manage.

The easiest way to refresh everything seen in the magit-status buffer is to use C-u g.

vermiculus commented 6 years ago

We can continue to discuss here; I just wanted to note that this isn't a current issue :-)

goodmami commented 6 years ago

Yeah no worries. It's probably safe to assume that the milestone thing was a red herring and it was just coincidence that the issues with the milestone were newer, uncached entries. I think this issue could be "resolved" with some relevant documentation, e.g., a note about caching under viewing project status.