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

x/build/cmd/gitmirror: lock conversations on GitHub commits #25450

Open
davecheney opened this issue May 18, 2018 · 6 comments
Open

x/build/cmd/gitmirror: lock conversations on GitHub commits #25450

davecheney opened this issue May 18, 2018 · 6 comments
Labels
Builders x/build issues (builders, bots, dashboards) FeatureRequest NeedsFix The path to resolution is known, but the work has not been done. Proposal Proposal-Accepted
Milestone

Comments

@davecheney
Copy link
Contributor

Occasionally a GitHub user will post a comment on a commit. Frequently these are spam which leads to nuisance emails generated if you watch the repo. Very occasionally these are requests for help, which currently require a human to reply, reminding the OP to raise an issue. This also generates nuisance emails.

I propose that the bot should blanket lock discussion on all commits in this repo.

@gopherbot gopherbot added this to the Proposal milestone May 18, 2018
@ianlancetaylor
Copy link
Contributor

CC @andybons

@bradfitz bradfitz added Builders x/build issues (builders, bots, dashboards) NeedsFix The path to resolution is known, but the work has not been done. FeatureRequest labels May 18, 2018
@bradfitz
Copy link
Contributor

SGTM. But we don't record any GitHub commit activity in maintner, so the bot wouldn't know what it has or hasn't already done. But I suppose it could do occasional background queries of the past few dozen commits and lock any that aren't locked, and not use maintner at all.

@rsc rsc changed the title proposal: bot should lock conversations on commits x/build/cmd/gopherbot: lock commit conversations May 21, 2018
@bradfitz
Copy link
Contributor

bradfitz commented Aug 3, 2018

/cc @dmitshur

@dmitshur
Copy link
Contributor

dmitshur commented Aug 10, 2018

I've looked into this.

I think a better place to implement this might be in x/build/cmd/gitmirror, the command responsible for mirroring the canonical git repositories from go.googlesource.com to github.com/golang. In addition to pushing the commits, gitmirror can immediately lock conversation on the newly pushed commit.

According to https://help.github.com/articles/locking-conversations/, it's possible to:

lock conversations on issues, pull requests, and commits permanently or temporarily

I've looked into GitHub API v3 and I found existing endpoints to lock conversation on issues (https://developer.github.com/v3/issues/#lock-an-issue). I don't see a dedicated method for locking conversation on PRs, but I would guess the same endpoint might work on PRs because PRs are treated like issues in many ways.

However, I don't see an endpoint for locking conversation on commits at https://developer.github.com/v3/repos/commits/. It's possible it exists, but like for PRs, doesn't have documentation coverage.

I've also looked into GitHub API v4 and it contains a pretty generic lockLockable mutation that takes a lockableId input field. It's documented as "ID of the issue or pull request to be locked", so it may or may not support commits either. Edit: The Lockable interface is very clear in that it's implemented by Issue and PullRequest only.

So, the next step is to check if GitHub has API support for locking commits programmatically (and request it if not).

Edit: I've created https://platform.github.community/t/api-to-lock-conversations-on-commits/6891 to request this for GitHub GraphQL API v4.

@dmitshur dmitshur changed the title x/build/cmd/gopherbot: lock commit conversations x/build/cmd/gitmirror: lock commit conversations Aug 11, 2018
@dmitshur dmitshur self-assigned this Sep 5, 2018
@dmitshur dmitshur changed the title x/build/cmd/gitmirror: lock commit conversations x/build/cmd/gitmirror: lock conversations on GitHub commits Jan 17, 2021
@gopherbot
Copy link

Change https://golang.org/cl/284713 mentions this issue: commitcommentshook: politely respond to commit comments on golang/go

@gopherbot

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) FeatureRequest NeedsFix The path to resolution is known, but the work has not been done. Proposal Proposal-Accepted
Projects
None yet
Development

No branches or pull requests

6 participants