Configuring Merge Request Templates
Overview
When managing code in CodeArts Repo, development teams often need to configure merge request templates for multiple repositories to ensure consistency and standardization of code commits and merging processes.
However, the scattered template configurations and complex operations caused unnecessary workload for team members.
Therefore, CodeArts Repo introduces project-, repository group-, and repository-level merge request templates.
Teams can now set merge request templates at the project, repository group, or repository level. These templates will automatically apply to all repositories at the same level for easier configuration.
You can also set default templates that are displayed first when creating merge requests. The template source is identified by an icon, making it easy for you to quickly identify and select templates. This not only streamlines the configuration but also improves efficiency by standardizing code commits and merge processes.
Constraints
Item |
Description |
---|---|
Package constraint |
Only available for CodeArts Repo professional edition and CodeArts. |
Procedure
- Go to the CodeArts Repo homepage of the project Test_Project to be configured and click Settings in the top navigation bar.
- Click Template Management under MR Templates.
- Click Create MR Template in the upper right corner and set parameters according to the following table.
Table 2 Parameters for creating an MR template Parameter
Description
Example Value
Template Name
The template name can contain a maximum of 200 characters.
Test_Template
Set as default
Optional. After this option is selected, the template is used by default when a merge request is created.
Auto Extract MR Title
Optional. The options are as follows:
- None
- Extract commit message
- Extract E2E title
CAUTION:If the first option is selected, you can continue to set the Title.
Title
Optional. Title of a merge request with a maximum of 255 characters.
When you create a new merge request and uses this template, the title you enter for this parameter will become the title of the merge request.
CAUTION:If you add [WIP] to the title and use this template, if means the merge request should not be merged yet.
Description
Optional. Description of a merge request with maximum of 255 characters.
Test
Helpful Links
After configuring the project-level merge request template for the Test_Project project, you can perform the following steps to view the results in the Test_Repo repository of the project:
- Go to the Code page of the Test_Repo repository and create a branch Branch_Test_Protect from the master branch.
- Create the Test_File file based on the Branch_Test_Protect branch.
- Click Merge Requests in the top navigation bar and click Create MR.
- As shown in the following figure, the template that is set to Default in the Template drop-down list box is displayed first.
If you configure default merge request templates at different levels (project level, repository group level, and repository level), the display priority is as follows: repository level > repository group level > project level.
- After you select this template, the MR title is automatically filled with MR and the description is automatically filled with Test.
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