Configuring Pass Conditions for Pipelines
CodeArts Pipeline uses pass conditions to control whether a pipeline can proceed to the next stage. You can apply policies to pipelines as pass conditions for efficient project management and high-quality delivery.
Traditional automotive enterprises mainly rely on manual tests, leading to low efficiency.
With CodeArts Pipeline, more than 70% issues can be intercepted through automated code checks. This improves test efficiency and software quality.
Procedure
You can add pass conditions for a stage where there is a code check task. If the code check result meets the pass conditions, the pipeline continues to run. Perform the following procedure.
Preparations
- You have created a project. The following uses a Scrum project named Project01 as an example.
- You have created a code repository in the project. The following uses a repository named repo01 (created using the Maven template) as an example. (You can choose to automatically create a code check task.)
- You have created a code check task with the repo01 repository. The following uses a code check task named check01 as an example.
- You have created a build task with the repo01 repository. The following uses a build task named build01 (created using the Maven template) as an example.
- You have created a pipeline with the repo01 repository. The following uses a pipeline named pipeline01 (created using the blank template) as an example.
Step1: Create a Rule and Configure Thresholds
- Log in to CodeArts.
- Click the avatar icon in the upper right corner and choose All Account Settings from the drop-down list.
- In the navigation pane on the left, choose Policy Management > Rules.
- Click Create Rule. On the displayed page, configure parameters.
Figure 1 Creating a rule
Table 1 Rule parameters Parameter
Description
Name
Enter a rule name, for example rule01.
Type
Select the rule type Check.
Extension
Select the extension Check.
Version
Select the version 0.0.1.
Threshold Configuration
The extension thresholds are automatically filled based on the selected extension version. You can use the default values.
- Click Confirm.
Step 2: Create a Policy and Add a Rule to the Policy
There are tenant-level policies and project-level policies. Tenant-level policies can be applied to pipelines of all projects under the current tenant, while project-level policies can be applied to all pipelines under the current project. The following uses a tenant-level policy as an example.
- In the navigation pane on the left, choose Policies.
A system policy exists by default. You can view and use the policy, but cannot edit or delete it.
- Click Create Policy. On the displayed page, enter a policy name policy01 and select the rule rule01 created in step 1.
Figure 2 Creating a policy
- Click Confirm.
Step 3: Configure a Pipeline
- On the top navigation bar, click Homepage.
- Search for the project created in Preparations and access the project.
- In the navigation pane on the left, choose CICD > Pipeline.
- Search for the pipeline created in Preparations, click
in the Operation column, and select Edit. The Task Orchestration page is displayed.
- In stage 1, add the code check task created in Preparations, click
, add Pass-Conditions-of-Standard-Policies, and select the policy policy 01 created in step 2.
Figure 3 Adding pass conditions - Click
or
to add a new stage for the pipeline and add the build task created in Preparations to the new stage.
Figure 4 Configuring a pipeline
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot