Giter Club home page Giter Club logo

check-group's Introduction

Check Group

All Contributors

โš ๏ธ Sunset Notice โš ๏ธ

TODO(@tianhaoz95): add future plans and migration guide.

What are not going to change:

What are changing:

  • There will not be hosted services.
  • There won't be new features planned.

โš ๏ธ Check Group is now hosted on paid service to ensure better up time: Check out the details here and please consider sponsoring the project!

logo banner

Groups CI checks based on the sub-projects for monorepo projects.

Motivation

For example, a monorepo project can define that changes checked into documentation (e.g. files in docs/**.md) should pass a set of checks (e.g. markdown lint and github_pages_build), and changes checked into mobile app source code (e.g. files in clients/app/**.dart) should pass another set of checks (e.g. app_unit_tests and app_integration_test) before being merged. It's also possible that there is a set of checks to make sure related sub-projects are compatible (e.g. compatibility_check).

For the situation above, there is no easy way to guard the main branch with protected branch schema. The project has to either only define a subset of full CI checks as requirement leaving the main branch less secure or define and run a full list of CI checks for every pull request slowing down merging process.

With Check Group, we can add one more CI check that is a combination of CI checks based on sub-projects of interests. The protected branch rule can depend only on the combined check.

To fit the example above into the use case, we can use the following configuration to tell Check Group how to collect required checks:

subprojects:
  - id: documentation
    paths:
      - "docs/**.md"
    checks:
      - "markdown_lint"
      - "github_pages_build"
  - id: mobile_app
    paths:
      - "clients/app/**"
    checks:
      - "app_static_analysis"
      - "app_unit_tests"
      - "compatibility_check"
  - id: cli_app
    paths:
      - "clients/cli/**"
    checks:
      - "cli_unit_tests"
      - "compatibility_check"

With the configuration above, Check Group collects the requirements that will secure the main branch and only LGTM if they all pass.

Here is an example of how it works in the pull request:

screenshot of the pr checks

A list of requirements and current fulfillment status is available in the "Details":

screenshot of the details view

Note: since Check Group converts all required checks into a single check to make protected branch happy, the repository only needs to run the affected checks for pull requests. There are many ways to do on every CI/CD platform. Here's an example with GitHub Actions for the usecase above (for more details, check out the example project):

name: app checks
on:
  pull_request:
    branches:
      - "master"
    paths:
      - "clients/app/**"
jobs:
  app_static_analysis: ...
  app_unit_tests: ...

Getting started

GitHub

The app is available on the GitHub Marketplace.

The app can be configured with .github/checkgroup.yml.

Here's an example configuration for a monorepo project consist of a documentation site and a mobile app client:

# This field can customize the name this app shows up in the pull request
# checks list. This is requested in #457 since the name "Check Group" is not
# necessarily informative enough for engineers who knows less about this
# workflow. Something like "Integration tests" or "Required tests" might be
# better in some cases.
custom_service_name: your_awesome_name # default to "Check Group"
subprojects:
  - id: documentation
    paths:
      - "docs/**.md"
    checks:
      - "markdown_lint"
      - "github_pages_build"
  - id: mobile_app
    paths:
      - "clients/app/**"
    checks:
      - "app_static_analysis"
      - "app_unit_tests"

GitHub Enterprise

The following commands runs Check Group in self-host server for GitHub Enterprise:

# This is the GitHub Enterprise endpoint. You will
# need to replace it with your host.
export GHE_HOST=github.example.com

# The following command builds the TypeScript source code
npm run build

# The following command starts the server
npm run start

Note: since I don't use GitHub Enterprise, the steps above might not fully reflect the setup process. Please open an issue here if there is any problem while setting it up.

Quick links

Help us host the service

To make sure that the service is reliable, I will need to host it on a paid service.

You can help us out by sponsoring the service at Buy Me a Coffee. Really appreciate your support!

License

ISC ยฉ 2020 Tianhao Zhou [email protected]

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

Tianhao Zhou
Tianhao Zhou

๐Ÿ’ป
Joel Beach
Joel Beach

๐Ÿ’ป ๐Ÿค”
Kevin Heins
Kevin Heins

๐Ÿค”
Paul Jones
Paul Jones

๐Ÿ› ๐Ÿค”
Neil Kalman
Neil Kalman

๐Ÿ›
Christian Theilemann
Christian Theilemann

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

check-group's People

Contributors

dependabot[bot] avatar tianhaoz95 avatar allcontributors[bot] avatar geekflyer avatar jtbeach 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.