Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues referenced in pull requests #811

Closed
eduherminio opened this issue Jan 20, 2018 · 12 comments
Closed

Issues referenced in pull requests #811

eduherminio opened this issue Jan 20, 2018 · 12 comments

Comments

@eduherminio
Copy link

I've noticed that references in pull requests don't appear in open issues (references in commits do).

@maniac103
Copy link
Collaborator

maniac103 commented Jan 20, 2018

Can you please elaborate what exactly you mean (maybe with a screenshot of Github's web UI)?

@eduherminio eduherminio changed the title Issues referred in pull requests Issues referenced in pull requests Jan 20, 2018
@eduherminio
Copy link
Author

Sure.

Github:
github

App:
app

@maniac103
Copy link
Collaborator

OK, I see. Unfortunately, this information isn't present in the API we currently use (https://developer.github.com/v3/issues/events/). There is another API that has it (https://developer.github.com/v3/issues/timeline/), but it's in preview and thus subject to changes (and, from my impressions when I used it, has quite a few rough edges).

I guess we could use the timeline and extract only the cross-referenced events though...

@tjkirch
Copy link

tjkirch commented May 29, 2019

I think I'm having the same issue and have some more detail. I'm not positive it's the same, so I can open a new issue if you like.

In a browser, you see "Person referenced this issue X minutes ago" (as above) and also "Person closed this in #N X minutes ago" (not in the example above). This is very helpful context as to why someone closed a pull request.

In OctoDroid, you don't get this context, so you don't know why someone closed an issue. It can seem like issues are closed without resolution.

Browser:
issue-in-firefox

OctoDroid:
issue-in-octodroid

@maniac103
Copy link
Collaborator

Can you link to that issue report? That close-with-commit thing is already (supposed to be) supported ... see #877 for a working example.

@tjkirch
Copy link

tjkirch commented May 29, 2019

Sure, here's that issue: samuelclay/NewsBlur#1145

I see that the OpenHub Android app does show the pull request reference, and from a quick look at their code, I see they're using the timeline/mockingbird preview API to do it.

Now that GitHub is moving wholesale to GraphQL for their v4 API, I wouldn't expect the v3 timeline API to ever be stabilized. I'm guessing that moving to GraphQL would be a huge change for OctoDroid :)

@maniac103
Copy link
Collaborator

Oops, now I see that it's closed-with-PR, not closed-with-commit. Yeah, that one doesn't work indeed, but I even don't see how it's supposed to work with timeline either. This is the relevant snippet of the response (obtained via curl -H "Accept: application/vnd.github.mockingbird-preview" https://api.github.com/repos/samuelclay/newsblur/issues/1145/timeline):

  {
    "id": 2373780097,
    "node_id": "MDExOkNsb3NlZEV2ZW50MjM3Mzc4MDA5Nw==",
    "url": "https://api.github.com/repos/samuelclay/NewsBlur/issues/events/2373780097",
    "actor": {
      "login": "samuelclay",
      "id": 44229,
      "node_id": "MDQ6VXNlcjQ0MjI5",
      "avatar_url": "https://avatars3.githubusercontent.com/u/44229?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/samuelclay",
      "html_url": "https://github.com/samuelclay",
      "followers_url": "https://api.github.com/users/samuelclay/followers",
      "following_url": "https://api.github.com/users/samuelclay/following{/other_user}",
      "gists_url": "https://api.github.com/users/samuelclay/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/samuelclay/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/samuelclay/subscriptions",
      "organizations_url": "https://api.github.com/users/samuelclay/orgs",
      "repos_url": "https://api.github.com/users/samuelclay/repos",
      "events_url": "https://api.github.com/users/samuelclay/events{/privacy}",
      "received_events_url": "https://api.github.com/users/samuelclay/received_events",
      "type": "User",
      "site_admin": false
    },
    "event": "closed",
    "commit_id": null,
    "commit_url": null,
    "created_at": "2019-05-29T03:50:33Z"
  },

Obviously, there's no PR reference there ... does this really work in OpenHub? AFAICT from their source code they don't show any kind of closed-with. AFAICT the only thing timeline would gain us here is the generic issue/PR references ('XXX referenced this issue YYY time ago') but doesn't help with your issue. Am I missing something?

@tjkirch
Copy link

tjkirch commented May 29, 2019

Sorry, I definitely should have been clearer in my response! I should have said that I saw OpenHub using the timeline/mockingbird API (somewhere), and that I see the PR reference in the issue in OpenHub, but I wasn't sure that they're using the timeline API to get the PR reference - I didn't look into the code that closely.

Here's what I see in OpenHub:
issue-in-openhub

Where you see "caleb-allen referenced this issue in #set primary text color globally 14 hours ago", that's a PR reference, though sadly it isn't actually a clickable link -- I'm assuming making it a link is just a feature request in OpenHub, rather than a fundamentally different data source, but I could be wrong.

Note that it does not show everything the GitHub website does, namely how the website shows "samuelclay closed this in #1192 11 hours ago" with a link to PR 1192; it just shows "samuelclay close this 10 hours ago" with no link anywhere.

I think this is where OpenHub is setting that "referenced" link: https://github.com/ThirtyDegreesRay/OpenHub/blob/feff8b7c8c04a683abbf06228bf160b0638c6118/app/src/main/java/com/thirtydegreesray/openhub/ui/adapter/IssueTimelineAdapter.java#L216

It's at least in a "timeline" adapter... I haven't done Android/Java development before, so I can't trace that through very easily, but it might be obvious to someone with more experience?

@maniac103
Copy link
Collaborator

Note that it does not show everything the GitHub website does, namely how the website shows "samuelclay closed this in #1192 11 hours ago" with a link to PR 1192; it just shows "samuelclay close this 10 hours ago" with no link anywhere.

I thought precisely that was your additional feature request? Everything else ('XXX referenced this issue...') is exactly what this issue is about anyway.
I guess I should dig up my old correspondence with Github support and see whether the timeline API has improved since then...it mostly is an addition to the events API (doesn't work fundamentally different), so if its bugs are ironed out, I guess it shouldn't be too had to implement it.

@tjkirch
Copy link

tjkirch commented May 29, 2019

I thought precisely that was your additional feature request? Everything else ('XXX referenced this issue...') is exactly what this issue is about anyway.

I did assume this issue was about the "referenced this issue" but I wasn't sure; that's why I didn't create a new issue and was asking about it. I didn't want to cause too much hassle.

Ideally both reference types would be available, since someone might mention the issue in the commit, or in the PR, but not both.

Do you think the "closed in #N" should be another issue, or is it basically the same cause and solution as this, so it fits here as well?

Thanks for your consideration!

@maniac103
Copy link
Collaborator

Do you think the "closed in #N" should be another issue, or is it basically the same cause and solution as this, so it fits here as well?

I don't mind much either way, but the 'closed in #X' thing clearly is not implementable with current API v3.

@Fs00
Copy link
Contributor

Fs00 commented Jul 23, 2022

This has been implemented and released in version 4.6.8.
The issue can be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants