pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.23k stars 5.84k forks source link

How to block the pull requests which will decrease the total test coverage. #45560

Open wuhuizuo opened 1 year ago

wuhuizuo commented 1 year ago

Enhancement

As title said, currently we need to increase the project test coverage, but how to block it in CI that we need to do.

How to do

  1. We can make it failed in github commit status with codecov service feature.
  2. Then we block it with prow tide context policy:
    • set required-if-present-contexts key and add codecov/project into it's value.

Ref

prow's tide configuration example:

tide:
  # .....

  context_options:
    orgs:
      pingcap:
        repos:
          tidb:
            skip-unknown-contexts: true
            from-branch-protection: true
            branches:
              master:
                required-if-present-contexts:
                - "codecov/project"

The configuration is in configs repo.

wuhuizuo commented 1 year ago

Ref:

  1. https://github.com/pingcap/tidb/pull/45557
  2. https://github.com/ti-community-infra/configs/pull/941