travis-buddy icon indicating copy to clipboard operation
travis-buddy copied to clipboard

TravisBuddy Reactions - Labels

Open bluzi opened this issue 6 years ago • 17 comments

Summary

The idea of TravisBuddy Reactions is to allow contributors to communicate with TravisBuddy using comments and labels.

travisbuddy-ignore label

Adding a label named travisbuddy-ignore to a PR should force TravisBuddy to ignore this PR and stop commenting on it. Just like in #37, routes/api.routes.js is probably the right place to query GitHub and see if the label is presented in the PR, and drop the request.

bluzi avatar Mar 17 '18 13:03 bluzi

This sounds interesting: I'd like to help with this. Just had a short look into this.

What wrapper do you use for the GitHub API / Where can I find the docs? Because as far as I saw a getLabels functionality isn't implemented in utils.js yet.

Do you have any automated tests which should be expanded to test this new functionality?

panmona avatar Apr 02 '18 21:04 panmona

Sorry, missed this comment somehow.

I'm using a fork of github-tools/github, that can be found here: bluzi/github. I needed some more functionality at some point and had to fork it to add few things.

Querying the labels really is the challenge of this task, you can read about it at https://developer.github.com/v3/.

As to the tests, you can add make a simple unit test.

Note that if you're working on it you probably want to rebase your fork since I've made a big change to the codebase.

bluzi avatar Apr 07 '18 15:04 bluzi

Okay thanks @bluzi. I began looking into this. I think we need to use this method here but I can't find it in the docs of the github-tools. So I think we need a new method there?

panmona avatar Apr 07 '18 17:04 panmona

Yup, github-tools suck. That's why I created this fork when I needed a method that was also missing there.

IMHO the best thing would be if you'd make a PR that adds listLabels to my fork, and then we'll publish it and use it in TravisBuddy.

What do you think?

bluzi avatar Apr 07 '18 17:04 bluzi

@bluzi Sounds good. I'll look into that now. Maybe that could also be made to a PR in the upstream project? (that doesn't seem to be active anymore :/)

panmona avatar Apr 07 '18 18:04 panmona

I think I need pagination for this aswell like the change you made to the comment list methods, right?

panmona avatar Apr 07 '18 18:04 panmona

Probably. If I remember correctly every method in GitHub API brings up to 30 entities per page, so 30 labels on one issue is pretty rear, but just in case i guess

bluzi avatar Apr 07 '18 18:04 bluzi

And yeah, I guess it worth a PR in the upstream repo, though it's true it's no longer maintained.

I'm thinking about taking this fork as a project to make a decent GitHub API for Node, since it's not the first time github-tool disappoints me, and it doesn't seem like there's an alternative.

bluzi avatar Apr 07 '18 18:04 bluzi

@bluzi Okay, just in case then.

And for the GitHub API: I have also looked around for alternatives. I have found two repos:

  • The one you use now
  • And: https://github.com/k33g/gh3

Haven't looked into the second one yet. But your idea also sounds good, check the second one out first though.

panmona avatar Apr 07 '18 19:04 panmona

gh3 doesn't even support promises. As far as I could find, there are no good products in the market of github api wrappers for Node :(

bluzi avatar Apr 13 '18 13:04 bluzi

Okay that's sad to hear. For now I think the best way to move forward is to extend the github tools repo.

Have you released the new version to npm?

panmona avatar Apr 13 '18 15:04 panmona

Look what I just found @bluzi: https://github.com/octokit/rest.js It looks really good! :)

panmona avatar Apr 13 '18 18:04 panmona

That's awesome, I'd even like to convert all the code related to github-api to use this library.

bluzi avatar Apr 13 '18 20:04 bluzi

I'd like to add this ability should be stated somewhere on the comment it posts. Because I don't care about Travis results: I don't use it, but the fork of the very active project I forked from does, and I'd really prefer if it didn't comment every time they push yet another commit to their master I've got a PR from... And I've gotten very annoyed with this bot filling my inbox with pointless comments... Even a link somewhere saying "am I doing bad? Click here to see how to turn me off" would be wonderful...

tustin2121 avatar May 03 '18 00:05 tustin2121

@tustin2121 This isn't implemented yet. Easiest way currently is to remove it from .travis.yml

panmona avatar May 03 '18 04:05 panmona

@tustin2121

a. Your comment is not related to the above issue at all, no idea why you chose to post it here b. Finding out how to disable TravisBuddy is as easy as pressing its name to enter its profile page, pressing on the repository link and reading the README.

bluzi avatar May 03 '18 12:05 bluzi

@bluzi a) This issue mentioned the problem I was having with it posting in a Pull Request, which it was doing several times in a single day. b) That's too many clicks, in my opinion. But never mind anyway, because I recently found what caused the bot to suddenly become interested in my PR (added by the upstream project and not me), and I'll be putting a bullet in that bit. So, I apologize for the rage-induced comment.

tustin2121 avatar May 03 '18 13:05 tustin2121