Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bot for adding "has pr" label to issues #10446

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

Closed
jnothman opened this issue Jan 10, 2018 · 30 comments
Closed

Bot for adding "has pr" label to issues #10446

jnothman opened this issue Jan 10, 2018 · 30 comments

Comments

@jnothman
Copy link
Member

We are terrible at removing "help wanted" labels from issues that have solutions in the works. Having another label added automatically when a PR exists that claims to fix an issue would help. Or perhaps just automatically removing "help wanted" would do.

Unfortunately GitHub provides little in the way of API to identify when an issue is referred to, let alone by a pr with "fixes", "closes", etc.

The idea, then, would be to watch activity on the repo (initially by polling the events API; otherwise with a web hook), and when a pull request event comes in, to check if its .payload.pull_request.body contains a "fixes"-style statement, and to label the targeted issue appropriately.

Firstly, the contributor (ping @gxyd) should check if there are existing bot apps for GitHub that can be easily configured to do this (especially to respond to events) Otherwise this should be implemented in a separate repo and initially tested on another repo (or on itself).

Extensions:

  • Track which PRs will close which issues in a database
  • Use that database to update the tags when a PR description is changed, or the PR is closed.
  • Record when each pr was last updated. Use this to distinguish between a "has active pr" and a "has inactive pr" label
@gxyd
Copy link
Contributor

gxyd commented Jan 10, 2018

Hi @maykulkarni , you sent me a private mail regarding your interest and me helping you in fixing this. Actually I'd (until Joel opened this issue) no prior knowledge that this is indeed required. So for the last part of mail, actually I don't have any further instructions to follow here. See discussion.

Though I'm interested in fixing this, I haven't initiated any work on this till now. But if you already have some leads on this, then your help is welcome.

@lesteve
Copy link
Member

lesteve commented Jan 11, 2018

As much as I'd like maybe one day (in my wildest dreams) to have bots helping us manage the volume of issues we have, I am not really convinced keeping the "help wanted" label up-to-date is really worth it. Personally I am comfortable enough with "help wanted" being a hint that some help may be needed. Then you need to look around to get a feel of the activity around the issue to figure out whether the label is still relevant. I agree it is not great but I don't think there is an easy way around this.

The problem with bots is that there is some non-negligible tooling effort (even if it is only configuring an existing tool) and there will always be special cases when we do not want the bot to apply. Even if there is a way to disable the bot on a given issue, learning how to interact with the bot it is still an additional layer of things to learn for new or occasional contributors.

A list I know of existing tools some of which may be of interest: https://github.com/collections/tools-for-open-source. Last time I quickly looked, danger seemed interesting.

My pet use cases that a bot could cover (maybe one day who knows, but to be honest I am not fully convinced they are worth it either):

  • parse a snippet in the OP and comment if the snippet is not stand-alone i.e. can not be copied and pasted
  • point contributors to contributing guidelines. Obvious cases I can think of: no [MRG] or [WIP] in the PR title, template left unmodified is in the issue, plenty of whitespace-only changes.
  • Close issues if no answer in a given amount of time. Maybe https://github.com/probot/stale but it feels like it should apply only if the issues has been marked explicitly (some special syntax in the comment), e.g. requests for additional information left unanswered for a week.
  • merge when green marker, so that you don't have to remember to go to a PR after the CIs are done running.
  • ping the PR author if the CIs are red if no activity for a while

@qinhanmin2014
Copy link
Member

qinhanmin2014 commented Jan 11, 2018

I am not really convinced keeping the "help wanted" label up-to-date is really worth it. Personally I am comfortable enough with "help wanted" being a hint that some help may be needed. Then you need to look around to get a feel of the activity around the issue to figure out whether the label is still relevant.

+1. Instead of a robot, I might prefer to update the contributing guide to let contributors check the status of the issue before contributing (I suppose most contributors are doing so?).

@jnothman
Copy link
Member Author

jnothman commented Jan 11, 2018 via email

@jnothman
Copy link
Member Author

jnothman commented Jan 11, 2018 via email

@lesteve
Copy link
Member

lesteve commented Jan 12, 2018

My main concerns:

  • it is a big chunk of work to set it up. Most of the bots I come across are not in Python and some recommend Heroku deployment. I feel this is not necessarily the kind of skills we have plenty of amongst contributors and core developers.
  • even when it works, making it actually useful is another non-trivial step.
  • maintaining it may prove challenging as well.

Looking a bit closer, the most promising thing I could find for your use case is https://github.com/zulip/zulipbot. An example of set-up I found with some features that are similar to what you want:

  • any user can claim/unclaim an issue with a comment in the issue. As a potential contributor you can search for "Easy" unassigned issues.
  • issues are unassigned if there is no activity for a while

@gxyd
Copy link
Contributor

gxyd commented Jan 12, 2018 via email

@jnothman
Copy link
Member Author

jnothman commented Jan 13, 2018 via email

@jnothman
Copy link
Member Author

jnothman commented Feb 1, 2018

Ah, this is what we need: https://github.com/clarkbw/probot-in-progress

@jnothman
Copy link
Member Author

jnothman commented Feb 1, 2018

Although it doesn't appear to have a hosted version, nor does it yet check explicitly for the "fixes" etc words :\

@forstmeier
Copy link

Hi all!

My name is John and I'm the co-creator of Heupr which is a machine learning-powered app that we're building to help large projects organize and coordinate their teams. We're actively building out our user base and feature set so we'd love to hear your input!

One of your maintainers recommended that I comment directly on this issue to get the community's take but I'm also available to chat over email if that's preferred. Let me know what you think!

Best,
John

@jnothman
Copy link
Member Author

jnothman commented Feb 26, 2018 via email

@forstmeier
Copy link

Thanks for the quick reply! Let us know if anything changes as we are rolling out expanded features including a new issue labeling/categorization service currently in public beta.

@rth
Copy link
Member

rth commented Apr 24, 2018

The option to "to wait for CI when merging a PR" from https://github.com/sindresorhus/refined-github seems quite useful for reviewers as well...

@rth
Copy link
Member

rth commented Apr 24, 2018

The option to "to wait for CI when merging a PR" from sindresorhus/refined-github seems quite useful for reviewers as well...

It also shows the number of accepted reviews / changes requested and the last updated date in the PR list, with sorted by "updated by default" (and lots of other small things),
untitled

thanks to @nicoddemus for mentioning it!

cc @lesteve @jnothman @qinhanmin2014 @glemaitre @massich

@qinhanmin2014
Copy link
Member

Great tool @rth !
But what's your plan? Seems that it's an extension for web browsers so we are going to recommend it in contributing guide?

@rth
Copy link
Member

rth commented Apr 24, 2018

No, for now, I just wanted to make you aware that it exists. It is somewhat complementary to @lesteve 's JS tools. It remains to be seen if this helps with review much.

@rth
Copy link
Member

rth commented May 2, 2018

Another potentially useful bot is GitMate - it helps to find related or duplicate issues. It has been used, for instance, by pytest (see example in pytest-dev/pytest#3350 (comment))..

Edit: though the limitations of their free plan might be problematic,

Free
Handle up to 50 issues/month
Limited to 8 users per organization

@adrinjalali
Copy link
Member

For the written record, we had some discussion with @thomasjpfan and a lot of these can be done with a bot. Last time I checked, IFTTT was the only one which could handle these cases, but it's too intrusive in permissions it requires. So I guess a custom github bot would make more sense for our cases. Some examples are:

  • automatic removal of "help wanted" if a PR claims to be fixing the issue.
  • automatically mark an issue and/or a PR stalled.
  • automatic setting of labels like "needs review" and/or "needs second review".
  • reminder messages on "tests failing" if there's no new commit for a while after tests start failing.
  • automatic reminder of "merge conflicts" for PRs which start having merge conflicts due to other PRs being merged, if they're not resolved within a certain period after the conflicts are introduced

@thomasjpfan
Copy link
Member

thomasjpfan commented Mar 3, 2019

Since the bot have fairly simple logic, I would write them as lambda functions on AWS, Azure, or GCP. The three cloud platforms give a pretty good amount of free compute time for lambda functions:

Basically, there is a cost per execution and for the amount of memory/cpu used. For the tasks we want, most of the time (and cost) spent will be waiting for a response from github after a sending POST request.

Edit: The other option would be to use a VPS and manage it ourselves.

@jnothman
Copy link
Member Author

jnothman commented Mar 5, 2019 via email

@adrinjalali
Copy link
Member

I would agree, but I spent a day working on this a few weeks ago which included me trying to find bots and/or solutions which could do this on github for us. I may have missed a product out there which does it, but as I said, IFTTT was the only one I saw which could handle these usecases, which is very intrusive in its required permissions. That's why I ended up checking how/if we could do a bot ourselves. Regardless, I'd be happy if we find something out there which works for us.

@thomasjpfan
Copy link
Member

thomasjpfan commented Mar 5, 2019

I agree IFTTT permissions are too much for a bot. In general, the bot would only need read/write permissions to scikit-learn issues/pr boards since it would be adding labels, writing messages, etc.

Using lambda functions would not be doing it from scratch since we would not need to manage the server. We would provide the code that listens to the webhook, do some processing, and sends a request to github.

Since we are moving so much to Azure, Azure Functions would work for our bot use case.

@amueller
Copy link
Member

amueller commented Mar 6, 2019

what about https://probot.github.io/ ?

probot/ideas#51

@amueller
Copy link
Member

amueller commented Mar 6, 2019

@thomasjpfan
Copy link
Member

Those are all valid options to build our bot with. They still need a host to run on.

The probot docs have a list of a few options to host: https://probot.github.io/docs/deployment/ The two options that stick up to me are: github actions and zeit

Github actions is current in beta, and it looks like it would be a good fit for bots.

@massich
Copy link
Contributor

massich commented Mar 7, 2019

+1 to GitHub actions.

@massich
Copy link
Contributor

massich commented Apr 17, 2019

I just came across this post https://towardsdatascience.com/mlapp-419f90e8f007

@cmarmo
Copy link
Contributor

cmarmo commented Feb 19, 2020

It seems to me that github now automatically provides this kind of information in the issue summary

image
and issue by issue

image

Maybe it is worth to close this issue though?

@rth
Copy link
Member

rth commented Feb 19, 2020

Indeed, closing. Thanks @cmarmo !

@rth rth closed this as completed Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests