GithubHelp home page GithubHelp logo

regulators's Introduction

Regulators is a hackathon project to create a simple, pluggable system to create approval workflows in CD/CI pipelines, provide checks in a deployment system or for any other use. These workflow tasks could include locks, code review verification, safety and security checks, alarm validation, etc.

Development

Prequisites

You must have Docker and Rust installed.

Basic Commands

# Build
$ cargo build
# Run server
$ cargo run

Docker

docker build -t regulators .
docker run -it --rm --publish 9000:8000 --name regulators regulators

Details

POST /regulate API details

The JSON data for POST /regulate should be something like this:

{
    "regulators": [{
        "name": "regulators-acquire-lock",
        "context": {
            "lock_key": "foo::bar"
        }
    }, {
        "name": "regulators-code-review-verification",
        "context": {
            "repository": "https://github.com/mmerkes/Regulators",
            "required_approvers": 1
        }
    }, {
        "name": "MyCustomRegulator",
        "context": {
            "foo": "bar"
        }
    }]
}

Calling Lambdas

The /regulate API calls Lambdas asynchronously and waits for them to complete their tasks via the PUT /workflows/:workflow/tasks/:task API. It will send them content in the following format:

{
    "workflow_id": "some-id",
    "task_id": "some-task",
    "context": {
        "keys": "exactly like the customer called with"
    }
}

GET /workflows/:workflow

Gets the workflow information by workflow ID.

GET /workflows/:workflow/tasks/:task

Gets the task information by workflow and task ID.

PUT /workflows/:workflow/tasks/:task

This API is used to complete tasks and trigger next events once the last task is completed. The JSON data for the PUT /workflows/:workflow/tasks/:task should be something like this:

{
    "status": "Succeeded"
}

Possible statuses are Succeeded and Failed.

regulators's People

Contributors

gdeblina avatar mmerkes avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

rduong

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.