Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Refactor and optimize the CI pipelines #16807

Open
purelind opened this issue Apr 11, 2024 · 3 comments
Open

ci: Refactor and optimize the CI pipelines #16807

purelind opened this issue Apr 11, 2024 · 3 comments
Assignees
Labels
type/enhancement Type: Issue - Enhancement

Comments

@purelind
Copy link
Collaborator

purelind commented Apr 11, 2024

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
  • The pipeline is shared by multiple branches, which leads to the complexity and ambiguity of Groovy in order to be compatible with different branch version.

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

  • Refactor the script-based Jenkins Groovy to declarative Groovy. The code of the new pipeline groovy have been reduced from 800 lines to 200.
  • 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.
  • 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

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 trigger command of the pipeline will change, and the status of the pipeline will also change.

The CI trigger command will change
/run-test --> /test pull-unit-test

CI status will change
idc-jenkins-ci/test --> pull-unit-test

Automatic triggering of the pielines
For newly created PRs or PRs with new commits pushed, the pipeline will be triggered automatically.

How to check my pull requst ci status on prow

https://prow.tidb.net/?repo=tikv%2Ftikv&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.
@purelind
Copy link
Collaborator Author

To unify the experience across all branches, the following active release branch pipelines will also be restructured and adjusted in the next few weeks

  • release-8.1
  • release-7.5
  • release-7.1
  • release-6.5
  • release-6.1

@wuhuizuo
Copy link
Contributor

/assign purelind

@wuhuizuo
Copy link
Contributor

/type enhancement

@ti-chi-bot ti-chi-bot bot added the type/enhancement Type: Issue - Enhancement label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Type: Issue - Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants