Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

TravisBuddy Reactions - Labels #53

Open
bluzi opened this issue Mar 17, 2018 · 17 comments
Open

TravisBuddy Reactions - Labels #53

bluzi opened this issue Mar 17, 2018 · 17 comments

Comments

@bluzi
Copy link
Owner

bluzi commented Mar 17, 2018

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.

@panmona
Copy link
Contributor

panmona commented Apr 2, 2018

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?

@bluzi
Copy link
Owner Author

bluzi commented Apr 7, 2018

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.

@panmona
Copy link
Contributor

panmona commented Apr 7, 2018

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?

@bluzi
Copy link
Owner Author

bluzi commented Apr 7, 2018

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?

@panmona
Copy link
Contributor

panmona commented Apr 7, 2018

@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
Copy link
Contributor

panmona commented Apr 7, 2018

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

@bluzi
Copy link
Owner Author

bluzi commented Apr 7, 2018

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
Copy link
Owner Author

bluzi commented Apr 7, 2018

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.

@panmona
Copy link
Contributor

panmona commented Apr 7, 2018

@bluzi Okay, just in case then.

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

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

@bluzi
Copy link
Owner Author

bluzi commented Apr 13, 2018

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 :(

@panmona
Copy link
Contributor

panmona commented Apr 13, 2018

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
Copy link
Contributor

panmona commented Apr 13, 2018

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

@bluzi
Copy link
Owner Author

bluzi commented Apr 13, 2018

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

@tustin2121
Copy link

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

@panmona
Copy link
Contributor

panmona commented May 3, 2018

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

@bluzi
Copy link
Owner Author

bluzi commented May 3, 2018

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

@tustin2121
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants