Coder Social home page Coder Social logo

fiscal-de-pr's Introduction

Usage


To run the fiscal-de-pr you have to login into azure and share your azure folder using -v ~/.azure:/root/.azure. Then you have to set your script configuration, for this step you have to create a file like this example:

module.exports = [ 
    {
        team: 'my team name',
        queryOn: {
            target: '[vsts|bitbucket]', 
            config: {

            }
        },
        notifyOn: {
            target: '[slack|google-chat]',
            config: {

            }
        }
    } 
]

An execution example: docker run --rm -e USER=$azure_user -e PASS=$azure_pass -v $(pwd)/config.js:/app/config.js matsproesser/fiscal-de-pr

Understanding the fields:

The default configuration object contains three fields:

  1. team: A simple identifier to simplify logs and tracking
  2. queryOn: An object containing a target and config
    • target: The identifier of query processor (see Query Processors)
    • config: Custom configuration based on selected target
  3. notifyOn: An object containing a target and config
    • target: The identifier of notifier processor (see Notifiers)
    • config: Custom configuration based on selected target

Query processors

[ vsts ]

This query processor uses Azure client to query for open Pull Requests based on member list.

OBS: To use this target the container must receive environment variable AZURE_DEVOPS_EXT_PAT containing a valid PAT for organization

Configurations:

{
    target: 'vsts',
    config: {
        azHost: 'http://azure', // the host of your azure DevOps. 
        azProject: 'MY_PROJECT', // the identifier of project inside azure DevOps where target repositories are.
        listDraft: true, // toogle to list or ignore pull requests in draft
        members: [
            "[email protected]" // list of users with pull requests to be watched
        ]
    }
}

[ vsts-repo ]

This query processor uses Azure client to query open Pull Requests based on repository name

OBS: To use this target the container must receive environment variable AZURE_DEVOPS_EXT_PAT containing a valid PAT for organization

{
    target: 'vsts-repo',
    config: {
        azHost: 'http://azure', // the host of your azure DevOps. 
        azProject: 'MY_PROJECT', // the identifier of project inside azure DevOps where target repositories are.
        listDraft: true, // toogle to list or ignore pull requests in draft
        repository: "target repository" // tha name of repository to be watched
    }
}

[ bitbucket ]

This query processor uses bitbucket API v2 to query Pull Requests by user, filtering by OPEN state.

Configurations:

{
    target: 'bitbucket',
    config: {
        authToken: "Basic base64(username:apiToken)", // requires a token api token with pull request read access only.
        members: [
            "matsproesser" // list of user ids to be watched 
        ]
    }
}

Notifiers

[ slack ]

This notifier uses slack webhook to notify about open pull requests found

Cofigurations:

{
    target: 'slack',
    config: {
        botUrl: 'http://slack', //The webhook url to post messages
        botName: 'fiscal de pr', // OPTIONAL The name of bot, overrides the original name
        botIcon: ':smile_face:', // OPTIONAL The slack emoji to replace original icon
        channel: '#team-channel', // OPTIONAL The slack channel to replace the originally configured
        headerMessage: '@here', // A custom header message to send before pull request list
        notifyEmpty = true, // Toogle to ignore notification if there is no open pull request
    }
}

[ google-chat ]

This notifier uses google-chat webhook to notify channels about open pull requests

Configurations:

{
    target: 'google-chat',
    config: {
        headerMessage: '<users/all>', // A custom header message to send before pull request list
        botUrl: 'https://chat.google.com/....' // The webhook url to post messages
    }
}

fiscal-de-pr's People

Contributors

msproesser avatar dependabot[bot] avatar

Stargazers

Dirceu Silva avatar Estêvão Francisco Fáy avatar Mauricio Lima avatar Silvio Silva avatar Eder Gonçalves avatar Cezar Cruz avatar Bruno Oliveira avatar André Roggeri Campos avatar

Watchers

 avatar

fiscal-de-pr's Issues

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.