jenkins-infra / helpdesk

Open your Infrastructure related issues here for the Jenkins project
https://github.com/jenkins-infra/helpdesk/issues/new/choose
17 stars 10 forks source link

Install `github-comment-ops` #3060

Closed timja closed 2 years ago

timja commented 2 years ago

Service(s)

Other

Summary

Hi

I've made a tool https://github.com/timja/github-comment-ops that can allow managing issues and pull requests by users without write access.

It has features like:

See the README for all features and required permissions.

It is powered by GitHub apps and is multi-tenanted so will work for any organizations that it's installed to, (i.e. only one deployment is needed).

Could we deploy this please?

I've created a helm chart for it: https://github.com/timja/github-comment-ops/tree/main/charts/github-comment-ops

Let me know of any issues / feedback, I'd be interested in someone else doing the setup to get any feedback from something I've missed

Reproduction steps

No response

timja commented 2 years ago

FYI @basil / @jglick you may be interested

lemeurherve commented 2 years ago

Who can use these commands?

timja commented 2 years ago

Anyone, they can't do anything harmful, similar to in Jira (it doesn't go quite as far though, i.e. no editing description) how anyone could update basically anything.

I have created an issue to allow restricting to certain people, but I don't think required for this (happy to be persuaded): https://github.com/timja/github-comment-ops/issues/10

jglick commented 2 years ago

close / reopen

Limited to issues for non-members, I would hope, and not pull requests.

NotMyFault commented 2 years ago

Are you looking forward to enable that on the jenkinsci org?

timja commented 2 years ago

close / reopen

Limited to issues for non-members, I would hope, and not pull requests.

Yes I only implemented it for issues: https://github.com/timja/github-comment-ops/blob/main/app/github.js#L367-L392

timja commented 2 years ago

Tested to make sure: https://github.com/timja-org/test-product-infra/pull/31

image

It's not handled properly as there's a stacktrace because it still tries to close it, but it only has the code for issues

lemeurherve commented 2 years ago

https://github.com/timja-org/test-product-infra/pull/31

Private repo? Got a "page not found"

timja commented 2 years ago

Fixed

lemeurherve commented 2 years ago

Presented during the last UX SIG meeting: https://www.youtube.com/watch?v=t1BSLRPNeQ4&t=2060s

lemeurherve commented 2 years ago

GitHub App created: https://github.com/apps/comment-ops-bot

Permissions:

lemeurherve commented 2 years ago

DNS record added:

Details image
lemeurherve commented 2 years ago

GitHub App webhook configured to https://webhook-github-comment-ops.jenkins.io/api/github/webhooks

Details image
lemeurherve commented 2 years ago

Added missing subscription to "issue comment" and "issue" events in the GitHub App settings:

Details image
lemeurherve commented 2 years ago

It's now working in jenkinsci organization 🎉

Example: https://github.com/jenkinsci/jenkins-infra-test-plugin/issues/42

image
timja commented 2 years ago

https://github.com/jenkinsci/jenkins-infra-test-plugin/pull/40#issuecomment-1191373934

image

timja commented 2 years ago

@lemeurherve did you want to raise an issue with any confusion you had or improvements? or PR the README directly?


Thanks for sorting so quickly!

lemeurherve commented 2 years ago

I'll prepare a PR later :)

Some points I'd add:

jglick commented 2 years ago

There is a bit of a discoverability problem here. How are users supposed to remember the list of supported commands, or find out that the whole system exists to begin with?

lemeurherve commented 2 years ago

How are users supposed to remember the list of supported commands

I've suggested https://github.com/timja/github-comment-ops/issues/36 as a first improvement.

find out that the whole system exists to begin with?

Some suggestions:

I fear some/most won't discover this functionality, but I think the curious/frequent contributors will quickly notice these comments and what they do.

lemeurherve commented 2 years ago

Also, a link/quick explanation could be added as comment in the issue and pull request templates

Another (noisy) possibility: make the GitHub App comments on every new issue/PR with an "help" message.

timja commented 2 years ago

I plan to announce, and update the core PR template.

I was planning to hold announcing till I fixed some of these issues that people have raised, but can also announce later on today if people prefer that

jglick commented 2 years ago

Oh a question about /reviewer. AFAIK GH actively blocks you from requesting a review from someone who is not a member of some group defined on the repo. (Even if the repo is public, and their only permission is read, which is otherwise redundant. And even though anyone can review any public PR without write access, including “suggesting” rather than “requesting” changes.) So this could be used by someone with no role in @jenkinsci but only to request review from someone who does have a role, not some other rando, right?

timja commented 2 years ago

Yes correct

lemeurherve commented 2 years ago

/label enhancement

lemeurherve commented 2 years ago

GitHub App installed on jenkins-infra org too 🙂

timja commented 2 years ago

and on https://github.com/timja/github-comment-ops

timja commented 2 years ago

At Daniel's request I've temporarily limited the repositories in the jenkinsci org to:

This is to gather feedback and in a couple of weeks if there's no objections we can enable globally.

There is a jenkinsci developer thread at: https://groups.google.com/g/jenkinsci-dev/c/sE7mH7hUZSY

lemeurherve commented 2 years ago

I've done the same on jenkins-infra organization, it's now activated only on https://github.com/jenkins-infra/helpdesk

I'll open an issue to gather the use cases for jenkins-infra and the repositories needing it.