Giter Site home page Giter Site logo

zenika-open-source / hygie Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 1.0 4.63 MB

Easy-to-use NestJS API allowing you to interact with GIT events and manage your project's life-cycle.

Home Page: https://zenika-open-source.github.io/hygie/

License: MIT License

TypeScript 97.75% Shell 0.41% Dockerfile 0.06% JavaScript 0.10% HTML 1.69%

hygie's People

Contributors

bastienterrier avatar emmanueldemey avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hygie's Issues

Init pipelines for executing rules

If we want to add more rules (yes we do), we must thing about the pipeline that will execute them.

In order to test this behavior, lets first create a second rule. When a new branch is created, we should check its name via an regular expression also. You can use this regexp: (features|fix)\/.* . This rule should be configurable via the yml configuration file.

We have now two rules. How can we execute them synchronously ? If on rule failed, we should not execute the following ones.

We can maybe use dependency injection in NestJS ?

Extend RuleResult property

It could be interesting to provide more data usable in callbacks.
For example, always return gitApiInfos

Add a script for creating releases

We will add a script to Circle in order to create a release of our project. This script will be executed when a PR is accepted.
Here are the actions we should execute :

  • Create a GIT tag
  • Update the version in the package.json file
  • Push the new image on the Docker hub
  • Publish the CLI on the npm registry
  • Publish the documentation on gh-pages
  • Publish definition files on NPM registry
  • Create a release notes

Develop the first rule

AS a first rule, we will check if the commit message match a specific regular expression. For example (feat|fix|docs)\(?[a-z]*\)?:\s.*

We will make this regexp configurable later.

Create an Runnable interface for post-actions

If we want to execute post action for a rule, we have to configure them in the rules.yml file. We also need a switch statement in order to get the actions we want to execute.

Maybe we can improve this pattern, by using multi values for providers in NestJS.

We can create a Runnable interface, with a name property and a run method. Based of this interface, we can also create many implementation. We will first focus on a Logger implementation.

When those actions have to be executed, we will inject the right providers (an array) on which we will do a filter in order to get only the actions configured in the rules.yml file.

Create NestJS interceptor in order to convert Gitlab/Github objects

Github and Gitlab objects are (I think) not the same. In order to make our rules easier to read and maintain we should create our own models.
In order to convert Gitlab/Github objects to our models, we can create a NEST.js interceptor ?
As a first step, we will create only the model used by the rule #7

Typescript definition files for Github and Gitlab API

Do we have definition files for Gitlab and Github API ?
If not, we will create them and publish them on the NPM registry.

If this files do not existe, we will create them, and improve them based on the use of the APIs

Add checks at bootstrap

We must create checks when the server is started, in order to be sure everything is OK.
The first check we can implement will check if the config file is present and valid.

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.