pingcap / pingcap/tiflash

ci: Refactor and optimize the CI pipelines

Open
#8,725 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type/enhancement
Dominant language
C++
Stars
1k
Forks
423
Avg merge
1d 15h
Merged PRs (30d)
24

Description

Enhancement

The current pipelines has some issues, which have brought a significant burden to the maintenance and updates of the pipelines.

  • testing logic and environment preparation logic are mixed in the Groovy file
  • There is a triggering relationship between the upstream and downstream calls of the pipelines.

The plan is to restructure CI Pipelines through intentional redesign, making the structure of the pipelins simpler and its execution more stable.

  • Refactor the script-based Jenkins Groovy to declarative Groovy.
  • The environment preparation script(like prepare cache and tools) is implemented using shell script instead of Groovy script.
  • Using Prow to take over the triggering of pipelines.
  • Remove the build-common CI pipeline and directly handle related tasks in the unit-test and integration-test pipelines.
  • Each branch has an independent pipeline configuration to avoid adding conditional logic in the pipeline that is compatible with the differences of multiple branches.
Which CI piplines will be affected?
New CI pipelines
image
Which branches' pipelines will be affected?

This optimization only targets the pipeline of the master branch. The remaining release branches will be switched and updated in the coming weeks.

Which behaviors will change

After this adjustment, the pipelines will be reduced from three to two. The functionality steps of tiflash_ghpr_build will be integrated into pull-integration-tests as a whole.

old pipelines

  • tiflash-ghpr-unit-tests
  • tiflash-ghpr-integration-tests
  • tiflash-ghpr-build

new pipelines

  • pull_unit_test
  • pull_integration_test
  1. The CI trigger command will change
    /run-unit-test --> /test pull-unit-test
    /run-integration-test --> /test pull-integration-test
    /run-all-tests --> /test all

  2. CI status will change
    idc-jenkins-ci-tiflash/integration-test --> pull-integration-test
    idc-jenkins-ci-tiflash/unit-test --> pull-unit-test

  3. Automatic triggering of the pielines
    For newly created PRs or PRs with new commits pushed, the pipeline will be triggered automatically. No need to comment /test all to trigger manually. Both pull-unit-test and pull-integration-test will be triggered automatically.

  4. Prefer to use /retest to trigger tasks that have failed, /test all will retrigger all tasks (including those that have run successfully and those that have failed).

How to check my pull requst ci status on prow

https://prow.tidb.net/?repo=pingcap%2Ftiflash&type=presubmit

Any others changes I need to pay attention to?
  • This refactoring optimization only targets the master branch, currently other branches are not affected.
  • The PR batch merge will be supported in the future.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the four affected Jenkins pipelines linked in the issue and the new pingcap/tiflash pipeline configuration for the master branch. Compare the current three-pipeline flow with the proposed pull_unit_test and pull_integration_test flow, including triggers and status names; done means the redesigned pipelines run stably with the documented automatic triggers and behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, shell
Domain
build-system, ci-cd, devops
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.