As per https://github.com/tldr-pages/tldr/issues/980#issuecomment-235233941
@agnivade:
This is going to be indispensable as we grow bigger. IMO maintaining a list of commands with their contributors will be too much to keep on updating. Instead, I propose, something like this mention-bot. Its pretty neat, and I have seen this being used in a lot of projects.
Mention bot is setup. Lets see how it goes for a few days and I will add a setup file to further tune its settings if needed.
Awesome! 馃帀 +馃挴
Looks good to me so far. Closing it.
Mention-bot doesn't seem to be working lately... any hints to what could be the problem? /cc @agnivade, @vjeux.
Perhaps we could try running it ourselves? /cc @sbrl.
Tracking issue here - https://github.com/facebook/mention-bot/issues/230
Looks like it's broken for other people too, so I'd want to wait until that issue is fixed / we have more information before running it myself. I wonder how difficult it would be to build the functionality into our existing tldr-bot? We can list the committers for a file in git with something like this already:
git log filename | grep -i "Author:" | sort | uniq | cut -d' ' -f2-
....though I suspect that it would be the GitHub API that we'd need to deal with. It would simplify the services running on my server that way, at least :-)
As a side note, it would be great if we could use github's "owners" bot (or the now natively integrated code owners feature. Unfortunately, neither has an option to automatically detect appropriate owners (original committer of a file and all those who modified it). The way they are implemented, we would have to manually maintain that mapping in an OWNERS file, which is unfeasible :(
@bkeepers, would such a feature be in-scope for probot-owners, or is that bot going to be deprecated now that its functionality is provided natively?
though I suspect that it would be the GitHub API that we'd need to deal with. It would simplify the services running on my server that way, at least :-)
Maybe https://github.com/probot/github-app could help in this regard?
@bkeepers, would such a feature be in-scope for probot-owners, or is that bot going to be deprecated now that its functionality is provided natively?
Still to be determined if it will be deprecated. I know some people don't love how the new code owners feature is implemented, so I think there is room for both to exist.
I would _love_ to have mention-bot functionality implemented as a GitHub App. I looked into it when building the owners app, but unfortunately mention-bot screen-scrapped the GitHub UI to get blame history (which I suspect is why it is now broken).
Let me know if you want to work on something together. I'd be happy to help out.
Thanks for the info and quick response! @sbrl does this sound like something you'd want to give a try?
@waldyrious Possibly. I've just been looking into the tldr-bot source, and while my python is a bit rusty, it looks like a fairly simple task actually to update it - it's just testing it that might prove challenging! @agnivade, how do you test tldr-bot's logic?
We could use this github api method to search for commits made on a file, and parse the resulting list of commits into a list of usernames that might make good reviewers.
We'd have to be careful to only do the mention once, and not every time a commit is made to a PR though. What kind of git hook is in use at the moment?
Also, there's a "code owners" feature? What is it and what's wrong with it? Fromt eh description on that blog post, it sounds just like @mention-bot - I'm confused.
@agnivade, how do you test tldr-bot's logic?
I made a dummy PR. Intentionally made it to fail and confirmed that the bot catches it and updates the PR.
there's a "code owners" feature? What is it and what's wrong with it? From the description on that blog post, it sounds just like @mention-bot - I'm confused.
@sbrl I tried to answer precisely that question when I wrote
Unfortunately, neither has an option to automatically detect appropriate owners (original committer of a file and all those who modified it). The way they are implemented, we would have to manually maintain that mapping in an OWNERS file, which is unfeasible :(
That is exactly the difference between them and mention-bot. Not sure what I'm missing here...
Ah, right! I think I see now! GitHub's official description is rather vague :P
@agnivade uhh ok! Looks like I may end up creating a bunch of dummy PRs then :P
Any idea on the current git hook in use?
There's no git hook in use. There's a travis hook in use, if that's what you are asking. It pipes the test result output to send_to_bot.py. The script gets the test results POSTs it to the api endpoint listening on your server.
Ahhh ok! I didn't realise :P Ok, in that case then if it's possible, a git(hub?) hook for new PRs would simplify things a whole bunch. Is there such a thing?
I don't see how it will simplify things. Its a hook at the end of the day, whether its coming from Travis or Github doesn't really matter.
If you mean it will simplify things if you try to merge the tldr bot with the mention bot, then yes, that might be true because the github hook does send some additional metadata for the PR.
@agnivade I assume that we'd want our mentionbot implementation to send it's message every time a commit is made to a PR then?
@sbrl just to make sure, do you believe it is easier to develop this functionality within tldr-bot than to add it as a new feature for probot-owners, or is it more of a preference?
I'm asking because tldr-bot is specific to this project, while probot-owners is technically project-agnostic, so your effort would have a higher impact if this feature would become available for other projects to use as well. Not to mention it would provide an additional tool to help make the entire FOSS communities on github more collaborative!
@waldyrious I think it could work in either. I'm a little bit wary of running 2 separate processes / services on my server though, so if we're talking about the hosted version of probot then probot-owners would probably be my preference.
If probot-owners isn't the publicly-hosted version of probot and would need to run on my server, I'd much prefer to integrate the functionality into tldr-bot in order to keep the service on my server simple (I discovered just how much configuration I'd done when I migrated from one server to another!).
I think using the hosted version of probot-owners would be the best choice, since we could help identify potential issues that would affect other users as well. If that makes it easier for you, even better :)
I assume that we'd want our mentionbot implementation to send it's message every time a commit is made to a PR then?
That would be too much IMO. Just do it only when a new PR is created.
@sbrl - We can set up mention bot ourselves in your server. I was going to do that, but I forgot the username I used to log in to your server. Can you remind me ? :sweat_smile:
@agnivade It's the tldr-bot user. Also, if it's going to be running on my server, I'd like to keep a very close eye on it. It's a Node.JS application - and I've experienced memory leaks with those before.
In addition, that's a _lot_ of heavy dependencies it requires - like multiple babel packages, according to the package.json. Are those _really_ necessary? It's a lot of weight for something that could in theory be much lighter.
Yes, those are necessary. Until we rewrite the logic ourselves, we are tied to this unfortunately. Let me know what you decide.
What's the state on this?
Thanks for following up on this @zdroid. From their repo:
* THIS REPO HAS BEEN ARCHIVED AND IS NO LONGER BEING ACTIVELY MAINTAINED *
I will close this since I don't see much sense in using an unmaintained product. We can look into using some alternative if we want. But that's for a new issue.
We could use something like this for language translations.
Most helpful comment
Thanks for following up on this @zdroid. From their repo:
I will close this since I don't see much sense in using an unmaintained product. We can look into using some alternative if we want. But that's for a new issue.