Skip to content

lgflorentino/activity_monitor_rb

Repository files navigation

Activity Monitor for Ruby

Test Status

This is a Rack Middleware app. It is heavily influenced by the Hanami web framework and dry-rb libraries. The app will accept json data posted to it from webhooks commonly used on version control systems (VCS).

There is no documentation given about setting up webhooks on any of the VCS platforms. Most VCS systems and vendors will have extensive doco for you to peruse on that topic.

Features:

  • Supported Webhook Events
    • Feature location: lib/activity_monitor/json_parser/{all,subset}
    • Push
    • Pull Request event implemented
    • Issue Created event implemented
    • Comment event implemented
  • JSON payload parsing
    • Feature location: lib/activity_monitor/json_parser
    • implemented
  • Provide support for the following third party services
    • Feature location: lib/activity_monitor/services/
    • Github
    • Gitlab
    • Bitbucket
    • Codeberg
    • Source Hut (No webhooks yet)
    • Custom git deployment
  • Create and maintain a list of URL endpoints which will receive JSON from externally configured webhooks
    • Feature location: lib/activity_monitor/routing && config/config.rb
    • implemented
    • configurable
  • Provide webhook verification for each service
    • Feature location: ``
  • Persistance features
    • Feature location: lib/activity_monitor/db
    • Configures rom-rb to connect to db
      • supports the SQL adapter type from rom-rb
      • Only a single connection is supported

Anti-features:

  • No display or analysis of the data of any kind (see hheatmap for reference front-end) or write your own web app to grab the data from the db

Standalone Usage Instructions

Install the gem as a dependency through the usual bundle commands

    $> bundle add activity_monitor

Hanami Plugin Usage Instructions [TODO]

$ bundle exec hanami activity-monitor install

CLI Usage

The app comes a Command Line Interface (CLI) tool to help with some tasks. The documentation for the tool is provided by the tool when used in conjunction with the --help option. Ex:

  # List available rake tasks
  bundle exec rake [--tasks|-T]

  # Bundled activity monitor tool
  bundle exec am --help
  
  # bundle exec am COMMAND --help
  bundle exec am run --help
  
  # connect to the db to run some command 
  DATABASE_URL="sqlite://./.data/am.db" bundle exec rake db:clean

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

License

The gem is available as open source under the terms of the MIT License.

About

Activity Monitor backend for Ruby

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published