Code Monkey home page Code Monkey logo

label-bot's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar facelessuser avatar gir-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

label-bot's Issues

App boot timeouts (rarely) in Heroku free

So, we are using the free Heroku server which is not always on. Maybe one day in the future we will change to a different one (maybe through funding via sponsorship), but currently, I don't plan to migrate away from the free solution. Occasionally, we can get app boot timeouts. We were getting them for a time, but they seem to have stopped occurring. I'm not sure if there is anything we can do to help speed up this process and become available faster, but something to look into.

I'm almost certain Heroku had just been having a period of performance issues.

Unit test the code

We probably need to get the code base unit tested. I'm not familiar with unit testing async/await code though, so I need to figure that out.

Use dedicated repo to share label configuration across an org

Storing label definition in a config file on the repo itself is pretty great however there are many instances where like 70% of the labels are strictly the same across repos of a given org by design to enforce convention over common ones (Severity, Priority, Kind, etc..).

It would be great if there was a way to have a dedicated repo to host the master definition which could be complemented at the repo level for specific project need.

Clean up code a bit

Clean up the code a bit for easier maintenance. The project came together pretty quick, and I was unfamiliar with projects of this type, so some cleanup needs to happen. Commands in comments (and issue bodies) should be split out into their own file and should be implemented a bit cleaner.

LGTM command

Add a way so we can say @bot lgtm in an issue, and it will clear any wip, triage, and/or review labels (depending on the issue type).

Optionally, you can say @bot lgtm, [key], where [key] is some user defined key, and appropriate labels will be set.

So, for an issue, I may say

@gir-bot lgtm, confirmed

And it may clear the triage label set the bug label and the confirmed label (as defined by the user).

Or if in a pull request, maybe:

@gir-bot lgtm, approved

And it would clear all the wip and review labels and set the label approved.

If we say:

@gir-bot lgtm

It would simply just remove the appropriate labels.

Potentially throttle label sync task more

We are already waiting a second between each API call to keep GitHub from failing our calls, but we still get failures when we are bulk label adding. It only happens when we are setting up a repo for the first time, but we should maybe try and throttle a bit more so we don't have to run it twice. Once a repo is established, you are probably doing minor label changes.

@gir-bot add sync-labels, feature
@gir-bot lgtm

Possibly add commands to bulk add/or remove labels

The idea would be to provide an add and remove command that would read the config and find match the parameters to real labels. If desired, you could define aliases as well for labels that are awkward to enter. We'll probably limit the scanning for certain characters, and if the label has characters outside that range, you would need to define an alias.

This may be useful for simple triage. For instance:

@gir-bot add feature
@gir-bot lgtm

or

@gir-bot remove triage
@gir-bot  add bug, needs-confrimation

@gir-bot lgtm

Automate installation

Can we easily setup an app scoped just to our username via traditional GitHub app infrastructure?

Something to look into. What we are doing now works, but it requires a bit of manual setup. It would be nice if we could as a repository as easy as it is on the marketplace. But not have to support everyone as a public app.

@gir-bot add maintenance
@gir-bot lgtm

Don't update labels in sync until retrieving all labels from repo

I think I finally figured out why label syncing fails, and it isn't because of rate limit abuse.

We were getting issue 422 which is essentially invalid field, and we would get for the attribute name. This would occur when we were specifically creating labels.

It finally occurred to me that we were paging repo labels while deleting or modifying labels. I realize now that this could cause some labels that would have appeared in the next page to not appear if labels were deleted before retrieving the next page. This is because labels on page X + 1 would now be on page X after the delete.

So why does this cause a 422? Because we missed indexing the label, and we think it needs to be created. So when we create it, it already exists, and so GitHub sends back a 422.

@gir-bot add bug, confirmed
@gir-bot lgtm

Allow running commands even when an issue is closed

Commands that run automatically should not run on closed issues, but commands that are initiated by a manual command should still run on a closed issue.

For instance, if we are closing an issue and updated labels via commands in the comment, they should still execute even though the command will be closed by time label commands execute. Also, the manual command should be respected in general, particularly add add remove commands. These are simple commands that add and remove labels.

So maybe not all commands should execute when the issue is closed, but at least add and remove.

@gir-bot add T: feature
@gir-bot lgtm

We seem to be suddenly getting this issue. We haven't changed our logic, and maybe we rarely got this before, but now it is happening a lot more. We should look into the why.

Jul 22 19:31:55 gir-label-bot app/web.1 Traceback (most recent call last):
Jul 22 19:31:55 gir-label-bot app/web.1   File "/app/label_bot/__main__.py", line 35, in deferred_commands
Jul 22 19:31:55 gir-label-bot app/web.1     async for cmd in commands.run(event, gh, bot):
Jul 22 19:31:55 gir-label-bot app/web.1   File "/app/label_bot/commands.py", line 171, in run
Jul 22 19:31:55 gir-label-bot app/web.1     comment = await gh.getitem(event.data[etype]['url'], accept=util.HTML_HEADER)
Jul 22 19:31:55 gir-label-bot app/web.1   File "/app/.heroku/python/lib/python3.6/site-packages/gidgethub/abc.py", line 126, in getitem
Jul 22 19:31:55 gir-label-bot app/web.1     "GET", url, url_vars, b"", accept, jwt=jwt, oauth_token=oauth_token
Jul 22 19:31:55 gir-label-bot app/web.1   File "/app/.heroku/python/lib/python3.6/site-packages/gidgethub/abc.py", line 106, in _make_request
Jul 22 19:31:55 gir-label-bot app/web.1     data, self.rate_limit, more = sansio.decipher_response(*response)
Jul 22 19:31:55 gir-label-bot app/web.1   File "/app/.heroku/python/lib/python3.6/site-packages/gidgethub/sansio.py", line 366, in decipher_response
Jul 22 19:31:55 gir-label-bot app/web.1     raise exc_type(*args)
Jul 22 19:31:55 gir-label-bot app/web.1 gidgethub.BadRequest: Not Found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.