/wgmeeting-github-ircbot

IRC bot to make github comments with relevant sections of CSS Working Group Meeting IRC minutes.

Primary LanguageRustMIT LicenseMIT

The plan

This is an IRC bot to help solve a problem we have in CSS Working Group meetings, which is that we discuss a topic for a while that has a GitHub issue, and then fail to make a note of that discussion in the GitHub issue. Since minute taking in meetings happens in IRC, an IRC bot is useful here.

The idea is that the bot will be in the channel, will split the IRC up based on "Topic:" and start/end of meeting, and then if somebody writes "Github topic: <github-url>" at some point within a topic (changeable/cancellable also with acknowledgment), it will acknowledge it and then when the topic concludes, make a comment in that GitHub issue at the end of the topic with the resolutions, and a <details> with the full IRC log, or something like that. (Understanding "Topic:" itself being a github URL turned out badly because of multiple people entering the same topic leading to multiple short or empty comments.)

(Ideally it will also understand ScribeNick: and the other scribe.perl conventions, but that's past minimum-viable-product, I think. Though ScribeNick should probably be doable quickly...)

How to use

Begin a topic on IRC:

Topic: [name of topic]
github: [URL of a GitHub issue]

The bot responds:

* github-bot OK, I'll post this discussion to [URL of the GitHub issue]

Discuss the topic on IRC.

Add the resolutions:

RESOLVED: frob the snozwuzzle breadth-first

Either begin a new topic:

Topic: Semantics of the gribble

or explictly end the topic:

github-bot, end topic

At this point, the github-bot responds:

* github-bot Successfully commented on [URL of the GitHub issue]

The comments that github-bot adds are everything since the last Topic was begun, even if that was before the github: [URL] was entered.

Development notes

If you don't have Rust installed, start with rustup.

If you want to use the bot to generate real GitHub comments, you'll need to generate a GitHub personal access token while logged in to the GitHub account that you want to make the comments, and put the personal access token in the github_access_token field in in ./src/config.json. Then you can compile and run the bot with a single cargo command, such as one of:

RUST_BACKTRACE=1 RUST_LOG=wgmeeting_github_ircbot cargo run ./src/config-dev.json
RUST_BACKTRACE=1 RUST_LOG=wgmeeting_github_ircbot cargo run --release ./src/config.json

Or you could just run automated tests with a different single cargo command (which doesn't require an access token):

RUST_BACKTRACE=1 RUST_LOG=wgmeeting_github_ircbot,test_chats cargo test

Do you want this bot for your working group?

If you want this bot for your working group that minutes its teleconferences on irc.w3.org, I'm happy to take pull requests to this repository. You need to change two things in src/config.json:

  • the github_repos_allowed line, which lists github repositories that the bot is allowed to comment in, and
  • the channels line, which lists the IRC channel that the bot joins when it starts. (/invite works for temporary channels, but it doesn't persist across restarting the bot.)

Acknowledgments

Thanks to Xidorn Quan and Alan Stearns for feature suggestions, and to Manish Goregaokar, Simon Sapin, Jack Moffitt, and Till Schneidereit for answering my questions about Rust while I was trying to learn Rust while writing this.