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

Add backfeed support for GitHub Discussions #1077

Open
aarongustafson opened this issue Oct 19, 2021 · 5 comments
Open

Add backfeed support for GitHub Discussions #1077

aarongustafson opened this issue Oct 19, 2021 · 5 comments
Labels

Comments

@aarongustafson
Copy link

@aarongustafson aarongustafson commented Oct 19, 2021

GraphQL endpoint: https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions

Using GitHub issues on https://WebWeWant.fyi for individual wants (e.g., WebWeWant/webwewant.fyi#191).

@tantek
Copy link
Contributor

@tantek tantek commented Oct 19, 2021

Most important here is Bridgy backfeed support for existing discussion posts on GitHub, similar to the backfeed support for responses to GitHub issues.

Bridgy Publish of a "discussion" post would be great too, should that be a separate issue / feature request?

(Originally published at: https://tantek.com/2021/292/t2/)

@snarfed
Copy link
Owner

@snarfed snarfed commented Oct 20, 2021

Thanks guys! And yes please, another issue for publish.

@snarfed snarfed added the listen label Oct 20, 2021
@snarfed
Copy link
Owner

@snarfed snarfed commented Oct 21, 2021

I looked at the notification object for discussion comments. Oddly, its subject.url, which we use to get the original API object, is null:

{
   "id" : "2574681035",
   "reason" : "comment",
   "subject" : {
      "latest_comment_url" : null,
      "title" : "I want DevTools to help me discover media that needs subtitling or captions",
      "type" : "Discussion",
      "url" : null,
   },
   "..."
}

Not sure what we'll do about that.

@snarfed snarfed changed the title Add support for GitHub Discussions Add backfeed support for GitHub Discussions Oct 21, 2021
@aarongustafson
Copy link
Author

@aarongustafson aarongustafson commented Oct 21, 2021

I submitted a support request with GitHub and referenced this issue.

Looking at the docs, it seems that it might be possible to infer the URL (if missing) from resourcePath

@snarfed
Copy link
Owner

@snarfed snarfed commented Oct 21, 2021

Thanks! And hmm, looks like resourcePath is in GraphQL, not REST? I don't see that notifications are available in GraphQL yet, nothing on https://docs.github.com/en/graphql/reference/queries or https://docs.github.com/en/graphql/reference/objects .

Here's the complete REST notification object, it doesn't seem to have anything that ties back to either the discussion or comment objects specifically. The only ids are node_ids for the repo and user and a notification id. (And nothing sensitive.)

{
   "id" : "2574681035",
   "last_read_at" : "2021-10-20T14:18:14Z",
   "reason" : "comment",
   "repository" : {
      "archive_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/{archive_format}{/ref}",
      "assignees_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/assignees{/user}",
      "blobs_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/git/blobs{/sha}",
      "branches_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/branches{/branch}",
      "collaborators_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/collaborators{/collaborator}",
      "comments_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/comments{/number}",
      "commits_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/commits{/sha}",
      "compare_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/compare/{base}...{head}",
      "contents_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/contents/{+path}",
      "contributors_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/contributors",
      "deployments_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/deployments",
      "description" : "If you build websites, you inevitably run into problems. Maybe there�s no way to achieve an aspect of your design using CSS. Or maybe there�s a device feature you really wish you could tap into using JavaScript. Or perhaps the in-browser DevTools don�t give you a key insight you need to do your job. We want to hear about it!",
      "downloads_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/downloads",
      "events_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/events",
      "fork" : false,
      "forks_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/forks",
      "full_name" : "WebWeWant/webwewant.fyi",
      "git_commits_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/git/commits{/sha}",
      "git_refs_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/git/refs{/sha}",
      "git_tags_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/git/tags{/sha}",
      "hooks_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/hooks",
      "html_url" : "https://github.com/WebWeWant/webwewant.fyi",
      "id" : 185854309,
      "issue_comment_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/issues/comments{/number}",
      "issue_events_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/issues/events{/number}",
      "issues_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/issues{/number}",
      "keys_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/keys{/key_id}",
      "labels_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/labels{/name}",
      "languages_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/languages",
      "merges_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/merges",
      "milestones_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/milestones{/number}",
      "name" : "webwewant.fyi",
      "node_id" : "MDEwOlJlcG9zaXRvcnkxODU4NTQzMDk=",
      "notifications_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/notifications{?since,all,participating}",
      "owner" : {
         "avatar_url" : "https://avatars.githubusercontent.com/u/51387951?v=4",
         "events_url" : "https://api.github.com/users/WebWeWant/events{/privacy}",
         "followers_url" : "https://api.github.com/users/WebWeWant/followers",
         "following_url" : "https://api.github.com/users/WebWeWant/following{/other_user}",
         "gists_url" : "https://api.github.com/users/WebWeWant/gists{/gist_id}",
         "gravatar_id" : "",
         "html_url" : "https://github.com/WebWeWant",
         "id" : 51387951,
         "login" : "WebWeWant",
         "node_id" : "MDEyOk9yZ2FuaXphdGlvbjUxMzg3OTUx",
         "organizations_url" : "https://api.github.com/users/WebWeWant/orgs",
         "received_events_url" : "https://api.github.com/users/WebWeWant/received_events",
         "repos_url" : "https://api.github.com/users/WebWeWant/repos",
         "site_admin" : false,
         "starred_url" : "https://api.github.com/users/WebWeWant/starred{/owner}{/repo}",
         "subscriptions_url" : "https://api.github.com/users/WebWeWant/subscriptions",
         "type" : "Organization",
         "url" : "https://api.github.com/users/WebWeWant"
      },
      "private" : false,
      "pulls_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/pulls{/number}",
      "releases_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/releases{/id}",
      "stargazers_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/stargazers",
      "statuses_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/statuses/{sha}",
      "subscribers_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/subscribers",
      "subscription_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/subscription",
      "tags_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/tags",
      "teams_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/teams",
      "trees_url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi/git/trees{/sha}",
      "url" : "https://api.github.com/repos/WebWeWant/webwewant.fyi"
   },
   "subject" : {
      "latest_comment_url" : null,
      "title" : "I want DevTools to help me discover media that needs subtitling or captions",
      "type" : "Discussion",
      "url" : null
   },
   "subscription_url" : "https://api.github.com/notifications/threads/2574681035/subscription",
   "unread" : false,
   "updated_at" : "2021-10-20T21:44:22Z",
   "url" : "https://api.github.com/notifications/threads/2574681035"
}

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

Successfully merging a pull request may close this issue.

None yet
3 participants