Coder Social home page Coder Social logo

xcloudplatform / ciscowebexgerritbotnotifications Goto Github PK

View Code? Open in Web Editor NEW

This project forked from boxdot/gerritbot-rs

0.0 0.0 0.0 1.12 MB

Cisco Teams bot for Gerrit code reviews.

License: Apache License 2.0

Shell 2.16% Python 11.49% Lua 6.03% Rust 69.68% Gherkin 10.65%

ciscowebexgerritbotnotifications's Introduction

Gerritbot Build Status

โš ๏ธ Important: This project is archived now because

  1. Cisco WebEx Teams changed their API
  2. I don't use Gerrit anymore

A Cisco WebEx Teams bot, which notifies you about new review approvals (i.e. +2/+1/-1/-2 etc.) from Gerrit.

screenshot

How to use:

  1. Register a developer account at https://developer.webex.com.
  2. Create a new bot and write down its api key.
  3. Build and run the bot in direct or SQS mode (cf. below).
$ cargo run -- <arguments>

The bot can run in two modes.

Direct mode

The bot is listening on a specified endpoint for incoming incoming WebEx Teams messages. For that, you need to provide the endpoint url to the bot by setting spark.webhook_url in the configuration file. The bot will register the url for you through the Cisco WebEx Teams API. Alternatively, you can also register the url yourself at https://developer.webex.com. In that case, do not provide the option spark.webhook_url, since otherwise it will overwrite you manually configured url.

See configuration example file in config-direct.yml in the repository.

Example:

$ cargo run -- --config config-direct.yml

In this setup, the bot is listening for the incoming messages at localhost:8888, where WebEx Teams will send the messages to the endpoint https://endpoint.example.org. This is useful to test the bot in a local environment. For an easy way to get a public url connected to a local endpoint cf. https://ngrok.com.

AWS SQS mode

The bot is polling the WebEx Teams messages from an AWS SQS queue provided by the configuration spark.sqs and spark.sqs_region. The url of the queue can be registered in WebEx Teams in the same way as in direct mode.

See configuration example file in config-sqs.yml in the repository.

Example:

$ cargo run -- --config-sqs.yml

This is useful, when the bot is running in a private network and does not have a connection to the internet. SQS is playing the role of a gateway between the internet and the internal traffic.

To forward the WebEx Teams messages to a SQS use an AWS API Gateway.

Gerrit

To listen to Gerrit messages, you need to have a Gerrit user with stream-api access capabilities. Admins and Non-interactive users should have such.

The state of the bot is stored in the state.json file in the same directory, where the bot is running.

The Gerrit version which was tested is 1.14.x.

License

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this document by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

ciscowebexgerritbotnotifications's People

Contributors

fbenkstein avatar boxdot avatar gferon avatar devcooch avatar eikesr avatar nzjony avatar tchernobog avatar

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.