هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Setting Repo-Level Merge Request Rules

Updated on 2024-11-22 GMT+08:00

The MR configuration refers to the configuration of code merge conditions and modes in MR mode. Project-level MR rules can be inherited to the repos and repo groups.

You can select Inherit from project. The settings in the project are automatically inherited and cannot be changed. You can also access the repo homepage of the code to be configured and choose Settings > Policy Settings > Merge Requests. There are two MR mechanisms: score and approval. The differences between the two mechanisms are as follows:

  • Scoring mechanism: This mode includes only code review and is based on scoring. Code can be merged only when the score meets the gate conditions.
  • The approval method consists of code review and merge approval. Code can be merged only after the number of reviewers and approvers reaches gate requirements.

    After selecting a mechanism, set other parameters by referring to the following table. The configuration takes effect for the entire code repo.

    Table 1 Parameters for setting the merge condition and mode

    Parameter

    Description

    Merge Conditions

    Optional. There are two options:

    • Merge after all reviews are resolved. After this parameter is selected, if Must resolve is selected as the review comment, a message Review comment gate: failed is displayed and the Merge button is unavailable. If it is a common review comment, the Resolved button does not exist, the MR is not intercepted by the merge condition.
    • Must be associated with CodeArts Req The options are as follows:
      1. Associate only 1 ticket number. After this option is selected, one MR can be associated with only one ticket number.
      2. All E2E ticket numbers pass verification After this option is selected, all associated E2E ticket numbers must pass the verification.
      3. Branches to configure the MR policy: You can add multiple branches to configure the merge request policy. You can manually enter wildcard characters (for example, *-stable or production/*), and press Enter.

    MR Settings

    Optional. Options:

    • Do not merge your own requests After this parameter is selected, the Merge button is unavailable when you view the MRs created by yourself. You need to ask the person who has the permission to merge the MRs.
    • Do not approve your own requests
    • Do not review your own requests
    • A repo administrator or project manager can force merge code
    • Allow code review and comment for merged or closed MRs
    • Mark the automatically merged MRs as Closed If all commits in MR A are included in MR A, MR B is automatically merged after MR A is merged. By default, the B MR is marked as merged. You can use this parameter to mark the B MR as closed.)
    • Cannot re-open a Closed MR This function is enabled by default. You can enable or disable it as required.
    • Enable "Delete source branch after merged" when creating MRs
    • Forbid squash merge (Forbid to select squash merge when create merge request)
    • Enable Squash merge for new MRs

    Merge Method

    Mandatory. The options are as follows:

    • Merge commit If this parameter is selected, a merge commit is created for every merge, and merging is allowed as long as there are no conflicts. That is, no matter whether the baseline node is the latest node, the baseline node can be merged if there is no conflict.
      • Do not generate Merge nodes during Squash merge: If this parameter is selected, no merge node is generated during the squash merging.
      • Use MR merger to generate Merge Commit: If this parameter is selected, the commit information is recorded.

        Use MR creator to generate Merge Commit: If this parameter is selected, the commit information is recorded.

    • Merge commit with semi-linear history. If this parameter is selected, a merge commit is recorded for each merge operation. However, different from Merge commit, the commitment must be performed based on the latest commit node of the target branch. Otherwise, the system prompts the developer to perform the rebase operation. In this merging mode, if the MR can be correctly constructed, the target branch can be correctly constructed after the merge is complete.
    • Fast-forward If this parameter is selected, no merge commits are created and all merges are fast-forwarded, which means that merging is only allowed if the branch could be fast-forwarded. When fast-forward merge is not possible, the user is given the option to rebase.

Configure Branch Policy

If you select the Approval mechanism as the Merge Mechanism and want to configure a merge policy for a branch, go to the repo homepage to be configured, choose Settings > Policy Settings > Merge Requests, click Create Branch Policy, and set parameters by referring to the following table.

Click Create Branch Policy to set a merge policy for a specified branch or all branches in the repository.

Table 2 Parameters for creating a branch policy

Parameter

Description

Branch

Mandatory. Select a branch from the drop-down list. You can select all branches.

Reviewers Required

Mandatory. The default value is 0, indicating that the review gate can be passed without being reviewed by the reviewer.

Approvals Required

Mandatory. The default value is 0, indicating that the approval gate can be passed without being approved by the approver.

Reset approval gate

Optional. This option is selected by default, indicating that MR approval gate is reset when code is re-pushed to the source branch of the MR.

Reset review gate

Optional. This option is selected by default, indicating that the MR review gate is reset when code is re-pushed to the source branch of the MR.

Add approvers/reviewers only from the following ones

Optional. If this option is selected, you can configure the list of New Approvers and New Reviewers. If you want to add additional members, you can only add members from the lists.

Enable pipeline gate

Optional. If this option is selected, before the merge, you need to pass all pipeline gates. This rule integrates the CI into the code development process.

Mergers

Optional. The list of mandatory mergers can be configured. When a merge request is created, the list is automatically synchronized to the merge request.

Approvers

Optional. The list of mandatory approvers can be configured. When a merge request is created, the list is automatically synchronized to the merge request.

Reviewer

Optional. The list of mandatory reviewers can be configured. When a merge request is created, the list is automatically synchronized to the merge request.

NOTE:

The following is an example of the branch policy priority:

  • Assume that there are policies A and B in the repository and their branches are the same. The system uses the latest branch policy by default.
  • Assume that there are policies A and B in the repository. Branch a and branch b are configured for policy A, and branch a is also configured for policy B. When a merge request whose target branch is branch a is committed, the system uses policy B by default.

If no branch policy is set in the approval mechanism, the default branch policy is used when a merge request is committed. The branch policy can be edited and viewed but cannot be deleted. The policy configuration is as follows:

  • Branches: *. By default, all branches are used and cannot be modified.
  • Reviewers Required: The default value is 0.
  • Approvals Required: The default value is 0.
  • Reset approval gate: This option is selected by default.
  • Reset review gate: This option is selected by default.
  • Add approvers/reviewers only from the following ones: This option is not selected by default.
  • Enable pipeline gate: This option is not selected by default.
  • Mergers: This parameter is left blank by default.
  • Approvers: This parameter is left blank by default.
  • Reviewer: This parameter is left blank by default.
    Example of a mandatory reviewer list:
    • The Reviewers Required is 2. If the list of mandatory reviewers is empty, the 2 approvers in the list of New Reviewers give pass and the gate is passed.
    • The Reviewers Required is 2. If the list of mandatory reviewers is not empty, the gate can be approved only after at least one reviewer in the list give pass.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback