Skip to content

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

Closed

Description

@jnothman

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

Activity

  1. gxyd commented on Jan 10, 2018

    @gxyd
    Contributor

    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.

  2. lesteve commented on Jan 11, 2018

    @lesteve
    Member

    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
  3. qinhanmin2014 commented on Jan 11, 2018

    @qinhanmin2014
    Member

    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?).

  4. jnothman commented on Jan 11, 2018

    @jnothman
    MemberAuthor
  5. jnothman commented on Jan 11, 2018

    @jnothman
    MemberAuthor
  6. lesteve commented on Jan 12, 2018

    @lesteve
    Member

    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
  7. gxyd commented on Jan 12, 2018

    @gxyd
    Contributor
  8. jnothman commented on Jan 13, 2018

    @jnothman
    MemberAuthor
  9. jnothman commented on Feb 1, 2018

    @jnothman
    MemberAuthor

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

  10. forstmeier commented on Feb 25, 2018

    @forstmeier

    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

  11. jnothman commented on Feb 26, 2018

    @jnothman
    MemberAuthor
  12. forstmeier commented on Feb 26, 2018

    @forstmeier

    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.

  13. rth commented on Apr 24, 2018

    @rth
    Member

    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...

  14. rth commented on Apr 24, 2018

    @rth
    Member

    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

  15. 1 remaining item

  16. rth commented on Apr 24, 2018

    @rth
    Member

    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.

  17. rth commented on May 2, 2018

    @rth
    Member

    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

  18. adrinjalali commented on Mar 3, 2019

    @adrinjalali
    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
  19. thomasjpfan commented on Mar 3, 2019

    @thomasjpfan
    Member

    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.

  20. jnothman commented on Mar 5, 2019

    @jnothman
    MemberAuthor
  21. adrinjalali commented on Mar 5, 2019

    @adrinjalali
    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.

  22. thomasjpfan commented on Mar 5, 2019

    @thomasjpfan
    Member

    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.

  23. amueller commented on Mar 6, 2019

    @amueller
    Member
  24. thomasjpfan commented on Mar 7, 2019

    @thomasjpfan
    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.

  25. massich commented on Mar 7, 2019

    @massich
    Contributor

    +1 to GitHub actions.

  26. cmarmo commented on Feb 19, 2020

    @cmarmo
    Contributor

    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?

  27. rth commented on Feb 19, 2020

    @rth
    Member

    Indeed, closing. Thanks @cmarmo !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions