Suggestion: User-to-server endpoint support


#1

hello Community,

i am building a Github App (bot) with authenticated users (OAuth).
Looking at the user-to-server endpoints it seems that there are some endpoints supporting some issue commenting (GET, POST) but it would be really really helpful if the users were able to get the issues for a specific repo and then tell the bot to comment on a chosen issue.

A possible use case:

(user): give me the open issues for the repo <repo_name>
(bot): [replies back with a list of open issues]
(user): get me the comments for the issue <issue_num> on repo <repo_name>
(bot): [replies back with a list of comments on that issue of that repo]
(user): add comment <comment_text> on issue <issue_num>

so, as you may already understood, i am requesting (user-to-server) support for the endpoint:
GET /repos/:owner/:repo/issues

Thanks,
Andreas


#2

Hey, @andreash92 :wave:

i am requesting (user-to-server) support for the endpoint: GET /repos/:owner/:repo/issues

Just to make sure we understand – can you explain a bit more why you are interested in calling this endpoint with a user identity token (user-to-server) and are not using the installation’s token (server-to-server) for that call? In what way does that help you and in what way do you expect the results to be different?


#3

Hey, i wanted to call that endpoint with a user token because some users don’t have access to every repo that my bot (installation’s token) has access to. But i guess i can call that endpoint with bot’s token and filter the results based on user (?)


#4

hello again @izuzak ,
I realized that you are right about your “concern statement” :

Just to make sure we understand – can you explain a bit more why you are interested in calling this endpoint with a user identity token (user-to-server) and are not using the installation’s token (server-to-server) for that call? In what way does that help you and in what way do you expect the results to be different?

So, after re-thinking i ended up to this use case scenario:

(user) i want to see my repositotories’ issues
(bot) choose a repo:

  • List repositories accessible to the user for an installation (user-to-server):
    GET /user/installations/:installation_id/repositories

(user): give me the open issues for the repo <repo_name>
(bot): [replies back with a list of open issues]

  • List issues for a repository (server-to-server):
    GET /repos/:owner/:repo/issues

(user): get me the comments for the issue <issue_num> on repo <repo_name>
(bot): [replies back with a list of comments on that issue of that repo]

  • List comments on an issue (server-to-server):
    GET /repos/:owner/:repo/issues/:number/comments

(user): add comment <comment_text> on issue <issue_num>
(bot): (adds comment)

  • Create an issue comment (user-to-server):
    POST /repos/:owner/:repo/issues/:number/comments

which i didn’t test it but it seems to be ok as all the needed endpoints are available.

Thanks and sorry for the inconvenience