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 commit conversations #25450

Open
davecheney opened this Issue May 18, 2018 · 4 comments

Comments

Projects
None yet
6 participants
@davecheney
Copy link
Contributor

davecheney commented May 18, 2018

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

@gopherbot gopherbot added the Proposal label May 18, 2018

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

ianlancetaylor commented May 18, 2018

@bradfitz

This comment has been minimized.

Copy link
Member

bradfitz commented May 18, 2018

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

This comment has been minimized.

Copy link
Member

bradfitz commented Aug 3, 2018

/cc @dmitshur

@dmitshur

This comment has been minimized.

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.