Movatterモバイル変換


[0]ホーム

URL:


CN113687859B - A branch management method, device, electronic device and medium for software development - Google Patents

A branch management method, device, electronic device and medium for software development
Download PDF

Info

Publication number
CN113687859B
CN113687859BCN202110948161.3ACN202110948161ACN113687859BCN 113687859 BCN113687859 BCN 113687859BCN 202110948161 ACN202110948161 ACN 202110948161ACN 113687859 BCN113687859 BCN 113687859B
Authority
CN
China
Prior art keywords
branch
mode
management
development
custom
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110948161.3A
Other languages
Chinese (zh)
Other versions
CN113687859A (en
Inventor
鲜雨宏
梁琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Pudong Development Bank Co Ltd
Original Assignee
Shanghai Pudong Development Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Pudong Development Bank Co LtdfiledCriticalShanghai Pudong Development Bank Co Ltd
Priority to CN202110948161.3ApriorityCriticalpatent/CN113687859B/en
Publication of CN113687859ApublicationCriticalpatent/CN113687859A/en
Application grantedgrantedCritical
Publication of CN113687859BpublicationCriticalpatent/CN113687859B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The embodiment of the invention discloses a branch management method, a device, electronic equipment and a medium for software development. Wherein the method comprises the following steps: responding to a current iteration creation instruction of the user on software development, judging whether the user determines a target branch mode from candidate branch modes; if not, responding to a user-defined branch mode creation instruction of the user, and recording a branch management strategy of the current user-defined branch mode; judging whether the branch management strategy of the current custom branch mode meets a preset custom branch stability rule according to a preset strategy judging period; if yes, determining the current self-defined branch mode as a target branch mode of software development so as to finish self-defined management of the branch mode. The embodiment of the invention realizes that the project group can automatically determine the branch mode according to the self situation, and improves the branch management efficiency.

Description

Translated fromChinese
一种软件开发的分支管理方法、装置、电子设备及介质A branch management method, device, electronic device and medium for software development

技术领域Technical Field

本发明实施例涉及计算机技术领域,尤其涉及一种软件开发的分支管理方法、装置、电子设备及介质。The embodiments of the present invention relate to the field of computer technology, and in particular to a branch management method, device, electronic device and medium for software development.

背景技术Background technique

在软件开发技术领域中,不同软件开发团队以及不同开发场景下,有不同的分支模式。其中,主流的分支模式包括AoneFlow、GitFlow和TrunkBased等。各个分支模式在不同的开发团队、不同文化以及不同项目背景下都有各自的优缺点。随着开发团队技术的提升、人员变动以及交付需求变化等情况的发生,现有的分支模式无法满足于现状,通常需要借助合理的工具对现有的分支模式进行适当的裁剪或扩充,以更加顺畅的进行软件开发的分支管理工作。In the field of software development technology, different software development teams and different development scenarios have different branching modes. Among them, the mainstream branching modes include AoneFlow, GitFlow, and TrunkBased. Each branching mode has its own advantages and disadvantages in different development teams, different cultures, and different project backgrounds. With the improvement of development team technology, personnel changes, and changes in delivery requirements, the existing branching mode cannot be satisfied with the status quo. Usually, it is necessary to use reasonable tools to appropriately tailor or expand the existing branching mode to more smoothly perform branch management work in software development.

现有技术中的分支管理方案通常采用统一的、固定的分支管理策略,整个分支管理的过程中自动化程度较低,分支管理成本较高、耗时长,导致项目组无法根据自身情况自动化进行分支管理,从而降低了分支管理的效率。The branch management solutions in the prior art usually adopt a unified and fixed branch management strategy. The degree of automation in the entire branch management process is low, the branch management cost is high and the time is long, resulting in the project team being unable to automatically manage branches according to their own situation, thereby reducing the efficiency of branch management.

发明内容Summary of the invention

本发明提供一种软件开发的分支管理方法、装置、电子设备及介质,以实现根据项目组自身情况自动化进行分支模式的确定,提高分支管理效率。The present invention provides a branch management method, device, electronic equipment and medium for software development, so as to realize automatic determination of branch modes according to the situation of a project team itself and improve branch management efficiency.

第一方面,本发明实施例提供了一种软件开发的分支管理方法,该方法包括:In a first aspect, an embodiment of the present invention provides a branch management method for software development, the method comprising:

响应于用户对软件开发的当前迭代创建指令,判断用户是否从候选分支模式中确定目标分支模式;In response to a user creating an instruction for a current iteration of software development, determining whether the user determines a target branching pattern from candidate branching patterns;

若否,则响应于用户的自定义分支模式创建指令,记录当前自定义分支模式的分支管理策略;If not, in response to the user's custom branch mode creation instruction, the branch management policy of the current custom branch mode is recorded;

根据预设的策略判断周期,判断所述当前自定义分支模式的分支管理策略是否满足预设的自定义分支稳定规则;According to a preset policy judgment cycle, judging whether the branch management policy of the current custom branch mode satisfies a preset custom branch stability rule;

若是,则确定所述当前自定义分支模式为软件开发的目标分支模式,以完成对分支模式的自定义管理。If so, the current customized branch mode is determined to be the target branch mode for software development to complete customized management of the branch mode.

第二方面,本发明实施例还提供了一种软件开发的分支管理装置,该装置包括:In a second aspect, an embodiment of the present invention further provides a branch management device for software development, the device comprising:

目标分支模式确定模块,用于响应于用户对软件开发的当前迭代创建指令,判断用户是否从候选分支模式中确定目标分支模式;a target branch mode determination module, for determining, in response to a user's creation instruction for a current iteration of software development, whether the user determines a target branch mode from candidate branch modes;

分支管理策略记录模块,用于若用户不从候选分支模式中确定目标分支模式,则响应于用户的自定义分支模式创建指令,记录当前自定义分支模式的分支管理策略;A branch management strategy recording module, for recording a branch management strategy of a current custom branch mode in response to a user's custom branch mode creation instruction if the user does not determine a target branch mode from the candidate branch modes;

分支稳定策略判断模块,用于根据预设的策略判断周期,判断所述当前自定义分支模式的分支管理策略是否满足预设的自定义分支稳定规则;A branch stability strategy judgment module, used to judge whether the branch management strategy of the current custom branch mode meets the preset custom branch stability rule according to the preset strategy judgment cycle;

自定义管理模块,用于若当前自定义分支模式的分支管理策略满足预设的自定义分支稳定规则,则确定所述当前自定义分支模式为软件开发的目标分支模式,以完成对分支模式的自定义管理。The custom management module is used to determine that the current custom branch mode is the target branch mode for software development if the branch management strategy of the current custom branch mode meets the preset custom branch stability rule, so as to complete the custom management of the branch mode.

第三方面,本发明实施例还提供了一种软件开发的分支管理设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现如第一方面实施例所提供的任一软件开发的分支管理方法。In the third aspect, an embodiment of the present invention also provides a branch management device for software development, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements any branch management method for software development provided in the embodiment of the first aspect.

第四方面,本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,其中,该程序被处理器执行时实现如第一方面实施例所提供的任一软件开发的分支管理方法。In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the branch management method for software development provided in any one of the embodiments of the first aspect is implemented.

本发明方案响应于用户选择的自定义分支模式创建指令,并记录当前自定义分支模式的分支管理策略。当分支管理策略满足预设的自定义分支稳定规则时,确定当前自定义分支模式为软件开发的目标分支模式,并完成对分支模式的自定义管理。上述方案实现了项目组能够根据软件开发情况形成适用于自身的自动化分支管理方案,提高了分支管理效率,从而节约了分支管理成本。The solution of the present invention responds to the custom branch mode creation instruction selected by the user and records the branch management strategy of the current custom branch mode. When the branch management strategy meets the preset custom branch stability rule, the current custom branch mode is determined to be the target branch mode for software development, and the custom management of the branch mode is completed. The above solution enables the project team to form an automated branch management solution suitable for itself according to the software development situation, improves the branch management efficiency, and thus saves the branch management cost.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是本发明实施例一中的一种软件开发的分支管理方法的流程示意图;FIG1 is a schematic flow chart of a branch management method for software development in Embodiment 1 of the present invention;

图2是本发明实施例二中的一种软件开发的分支管理方法的流程示意图;2 is a schematic diagram of a flow chart of a branch management method for software development in Embodiment 2 of the present invention;

图3是本发明实施例三中的一种软件开发的分支管理装置的结构示意图;3 is a schematic diagram of the structure of a branch management device for software development in Embodiment 3 of the present invention;

图4是本发明实施例四中的一种软件开发的分支管理设备的结构示意图。FIG. 4 is a schematic diagram of the structure of a branch management device for software development in Embodiment 4 of the present invention.

具体实施方式Detailed ways

下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

实施例一Embodiment 1

图1为本发明实施例一提供的一种软件开发的分支管理方法的流程图,本实施例可适用于根据项目组自身情况,自动化确定软件开发的分支模式,并对分支模式进行分支管理的情况,该方法可以由软件开发的分支管理装置来执行,该装置可采用软件和/或硬件的方式实现。如图1所示,该方法具体包括如下步骤:FIG1 is a flow chart of a branch management method for software development provided by Embodiment 1 of the present invention. This embodiment can be applied to the situation where the branch mode of software development is automatically determined according to the situation of the project team itself, and the branch mode is managed. The method can be executed by a branch management device for software development, and the device can be implemented in software and/or hardware. As shown in FIG1, the method specifically includes the following steps:

S110、响应于用户对软件开发的当前迭代创建指令,判断用户是否从候选分支模式中确定目标分支模式。S110 . In response to a user creating instruction for a current iteration of software development, determining whether the user determines a target branch pattern from candidate branch patterns.

其中,候选分支模式可以包括AoneFlow分支模式、GitFlow分支模式和TrunkBased分支模式等中的至少一种。目标分支模式可以是在进行软件开发过程中,用户进行分支管理所采用的分支模式,例如可以是候选分支模式中的其中一个。当前迭代可以是项目组在迭代计划会结束后,用户根据当前的迭代计划会的内容创建相关工作项。其中,迭代计划会可以是在软件开发过程中,相关项目组定期举行的开发会议;在迭代计划会中,项目组可以根据本次迭代任务确定本次迭代的需求。其中,相关工作项可以包括迭代故事和迭代任务,进一步的,一个相关工作项可以包括至少一个迭代故事,一个迭代故事可以包括至少一个迭代任务。当前迭代创建指令可以是用户根据相关工作项所发起的相关工作项内容的更新指令。Among them, the candidate branch modes may include at least one of the AoneFlow branch mode, the GitFlow branch mode and the TrunkBased branch mode. The target branch mode may be the branch mode adopted by the user for branch management during the software development process, for example, it may be one of the candidate branch modes. The current iteration may be that the project team creates related work items according to the content of the current iteration planning meeting after the iteration planning meeting. Among them, the iteration planning meeting may be a development meeting held regularly by the relevant project team during the software development process; in the iteration planning meeting, the project team may determine the requirements of this iteration based on the tasks of this iteration. Among them, the related work items may include iteration stories and iteration tasks. Further, a related work item may include at least one iteration story, and an iteration story may include at least one iteration task. The current iteration creation instruction may be an update instruction of the content of the related work item initiated by the user according to the related work item.

示例性的,可以根据实际的软件开发情况,有针对性的选择分支模式。具体的,针对软件开发进行的迭代计划会,用户可以根据迭代计划会内容,线上或线下创建相关工作项,从而确定相关工作项的迭代故事和迭代任务,并根据当前迭代故事和迭代任务发起当前迭代创建指令。当前迭代创建指令中可以包括相关工作项中的迭代故事和迭代任务,还可以包括用户是否从候选分支模式中选择目标分支模式。根据由用户发起的当前迭代创建指令,判断用户是否从候选分支模式中确定目标分支模式。Exemplarily, the branch mode can be selected in a targeted manner according to the actual software development situation. Specifically, for the iteration planning meeting for software development, the user can create relevant work items online or offline according to the content of the iteration planning meeting, so as to determine the iteration stories and iteration tasks of the relevant work items, and initiate the current iteration creation instruction according to the current iteration stories and iteration tasks. The current iteration creation instruction may include the iteration stories and iteration tasks in the relevant work items, and may also include whether the user selects the target branch mode from the candidate branch modes. According to the current iteration creation instruction initiated by the user, it is determined whether the user determines the target branch mode from the candidate branch modes.

若用户是从候选分支模式中确定的目标分支模式,则按照目标分支模式中固定的分支模式管理方案进行一系列规范的分支管理。If the user determines the target branch mode from the candidate branch modes, a series of standardized branch management is performed according to the fixed branch mode management scheme in the target branch mode.

S120、若否,则响应于用户的自定义分支模式创建指令,记录当前自定义分支模式的分支管理策略。S120: If not, in response to the user's custom branch mode creation instruction, record the branch management policy of the current custom branch mode.

其中,若用户不是从候选分支模式中确定的目标分支模式,则可以响应用户发起的自定义分支模式创建指令。其中,自定义分支模式可以是用户根据软件开发的实际需求,自行创建的一套适合于自身需求的分支管理策略。If the user does not determine the target branch mode from the candidate branch modes, the user can respond to the custom branch mode creation instruction initiated by the user. The custom branch mode can be a set of branch management strategies suitable for the user's needs created by the user according to the actual needs of software development.

自定义分支模式创建指令可以包括创建分支指令、合并分支指令、删除分支指令、代码检视指令和流水线配置指令等;相应的,分支管理策略可以包括分支创建策略、分支合并策略、分支删除策略、代码检视策略和流水线配置策略等。其中,创建分支指令、合并分支指令和删除分支指令可以包括创建主分支、创建开发分支、创建发布分支、创建特性分支或创建热修复分支等中的至少一种;合并主分支、合并开发分支、合并发布分支、合并特性分支或合并热修复分支等中的至少一种;删除发布分支、删除特性分支或删除热修复分支等中的至少一种。Custom branch mode creation instructions may include creation branch instructions, merging branch instructions, deleting branch instructions, code review instructions, and pipeline configuration instructions, etc.; correspondingly, branch management policies may include branch creation policies, branch merging policies, branch deletion policies, code review policies, and pipeline configuration policies, etc. Among them, creation branch instructions, merging branch instructions, and deleting branch instructions may include at least one of creating a main branch, creating a development branch, creating a release branch, creating a feature branch, or creating a hot fix branch; merging a main branch, merging a development branch, merging a release branch, merging a feature branch, or merging a hot fix branch; deleting a release branch, deleting a feature branch, or deleting a hot fix branch, etc.

代码检视可以是开发过程中对创建、删除或合并后的分支进行的代码检测,从而确定创建、删除或合并后的分支上的代码是否正确。代码检视可以由相关工作人员进行人工检视,也可以自动检视。其中,自动检视可以根据不同的待进行代码检视的分支,预先配置相应的流水线,并通过流水线进行自动化检视。流水线配置可以是相关技术人员根据相关任务需求预先设定的一套流程,并且可以被相关任务直接调用。流水线配置可以根据不同相关任务需求进行不同的信息配置。其中,相关任务可以是自动代码检视等。Code review can be a code detection performed on branches created, deleted or merged during the development process to determine whether the code on the branches created, deleted or merged is correct. Code review can be performed manually by relevant staff or automatically. Among them, automatic review can pre-configure corresponding pipelines according to different branches to be reviewed, and perform automated review through the pipeline. The pipeline configuration can be a set of processes pre-set by relevant technical personnel according to relevant task requirements, and can be directly called by relevant tasks. The pipeline configuration can perform different information configurations according to different relevant task requirements. Among them, relevant tasks can be automatic code review, etc.

若用户不是从候选分支模式中确定的目标分支模式,则可以响应用户发起的自定义分支模式创建指令;根据用户发起的自定义分支模式创建指令,确定自定义分支模式创建指令对应的各分支创建策略;根据各分支创建策略,实时或定时记录当前自定义分支模式的分支管理策略。其中,若采用定时记录当前自定义分支模式的分支管理策略,则可以由用户提前预设定时周期,并由后台在定时周期内记录当前自定义分支模式的分支管理策略。If the user is not in the target branch mode determined from the candidate branch modes, the user-initiated custom branch mode creation instruction can be responded to; according to the user-initiated custom branch mode creation instruction, each branch creation strategy corresponding to the custom branch mode creation instruction is determined; according to each branch creation strategy, the branch management strategy of the current custom branch mode is recorded in real time or periodically. Among them, if the branch management strategy of the current custom branch mode is recorded periodically, the user can preset the timing period in advance, and the background records the branch management strategy of the current custom branch mode within the timing period.

在一个可选实施例中,响应于用户的自定义分支模式创建指令,记录当前自定义分支模式的分支管理策略,包括:根据自定义分支模式创建指令,确定分支创建策略、分支合并策略、分支删除策略、代码检视策略和流水线配置策略;根据分支创建策略、分支合并策略、分支删除策略、代码检视策略、流水线配置策略以及自定义分支模式创建指令的触发时间,确定当前自定义分支模式的分支管理策略。In an optional embodiment, in response to a user's custom branch mode creation instruction, the branch management strategy of the current custom branch mode is recorded, including: determining the branch creation strategy, branch merging strategy, branch deletion strategy, code review strategy and pipeline configuration strategy according to the custom branch mode creation instruction; determining the branch management strategy of the current custom branch mode according to the branch creation strategy, branch merging strategy, branch deletion strategy, code review strategy, pipeline configuration strategy and the trigger time of the custom branch mode creation instruction.

其中,触发时间可以是当前自定义分支模式中,发出创建分支指令触发时间、发出合并分支指令触发时间、发出删除分支指令触发时间、发出代码检视指令触发时间和发出流水线配置指令触发时间。示例性的,根据自定义分支模式创建指令,确定分支创建策略、分支合并策略、分支删除策略、代码检视策略和流水线配置策略;判断当前时间是否为自定义分支模式创建指令的触发时间。若是,则根据分支创建策略、分支合并策略、分支删除策略、代码检视策略、流水线配置策略以及自定义分支模式创建指令的触发时间,确定当前自定义分支模式的分支管理策略;若否,则等待确定当前自定义分支模式的分支管理策略,直到当前时间为自定义分支模式创建指令的触发时间时,继续确定当前自定义分支模式的分支管理策略。Among them, the trigger time can be the trigger time of issuing a create branch instruction, the trigger time of issuing a merge branch instruction, the trigger time of issuing a delete branch instruction, the trigger time of issuing a code review instruction, and the trigger time of issuing a pipeline configuration instruction in the current custom branch mode. Exemplarily, according to the custom branch mode creation instruction, the branch creation strategy, branch merge strategy, branch deletion strategy, code review strategy and pipeline configuration strategy are determined; and it is determined whether the current time is the trigger time of the custom branch mode creation instruction. If so, the branch management strategy of the current custom branch mode is determined according to the branch creation strategy, branch merge strategy, branch deletion strategy, code review strategy, pipeline configuration strategy and the trigger time of the custom branch mode creation instruction; if not, wait to determine the branch management strategy of the current custom branch mode until the current time is the trigger time of the custom branch mode creation instruction, and then continue to determine the branch management strategy of the current custom branch mode.

本可选实施例根据通过自定义分支模式创建指令确定的分支创建策略、分支合并策略、分支删除策略、代码检视策略、流水线配置策略以及自定义分支模式创建指令的触发时间,确定当前自定义分支模式的分支管理策略。上述方案实现了自定义分支模式的分支管理策略的确定,使得用户能够根据软件开发的实际需求在自定义分支模式中进行分支创建、删除、合并,根据实际需求进行代码检视和流水线配置。This optional embodiment determines the branch management strategy of the current custom branch mode according to the branch creation strategy, branch merging strategy, branch deletion strategy, code review strategy, pipeline configuration strategy determined by the custom branch mode creation instruction and the triggering time of the custom branch mode creation instruction. The above scheme realizes the determination of the branch management strategy of the custom branch mode, so that the user can create, delete, and merge branches in the custom branch mode according to the actual needs of software development, and perform code review and pipeline configuration according to actual needs.

S130、根据预设的策略判断周期,判断当前自定义分支模式的分支管理策略是否满足预设的自定义分支稳定规则。S130. According to a preset policy judgment cycle, it is determined whether the branch management policy of the current custom branch mode satisfies a preset custom branch stability rule.

其中,策略判断周期可以由相关技术人员进行提前预设,策略判断周期可以是时间周期,例如可以设置为5天,每5天进行一次自定义分支模式的分支管理策略的自定义分支稳定规则的判断;策略判断周期还可以是次数周期,例如可以设置为1次,每响应1次自定义分支模式的创建,进行1次自定义分支模式的分支管理策略的自定义分支稳定规则的判断。Among them, the policy judgment cycle can be preset in advance by relevant technical personnel. The policy judgment cycle can be a time period, for example, it can be set to 5 days, and the custom branch stability rules of the branch management policy of the custom branch mode are judged once every 5 days; the policy judgment cycle can also be a number period, for example, it can be set to 1 time, and the custom branch stability rules of the branch management policy of the custom branch mode are judged once every time a custom branch mode is created.

其中,自定义分支稳定规则可以由相关技术人员进行提前设定,例如可以是将各分支创建策略、分支合并策略、分支删除策略、代码检视策略和流水线配置策略转换成矩阵或记忆曲线的形式,当转换后的矩阵或记忆曲线符合预设条件时,则可以认为自定义分支模式趋于稳定,即满足自定义分支稳定规则;当转换后的矩阵或记忆曲线不符合预设条件时,则可以认为自定义分支模式不稳定,即不满足自定义分支稳定规则。其中,预设条件例如可以是当前策略判断周期下,转换后的记忆曲线与历史策略判断周期内的记忆曲线相比较是否更加趋于稳定。Among them, the custom branch stability rules can be set in advance by relevant technical personnel. For example, each branch creation strategy, branch merging strategy, branch deletion strategy, code review strategy and pipeline configuration strategy can be converted into a matrix or memory curve. When the converted matrix or memory curve meets the preset conditions, it can be considered that the custom branch mode is stable, that is, it meets the custom branch stability rules; when the converted matrix or memory curve does not meet the preset conditions, it can be considered that the custom branch mode is unstable, that is, it does not meet the custom branch stability rules. Among them, the preset conditions can be, for example, whether the converted memory curve is more stable than the memory curve in the historical strategy judgment cycle in the current strategy judgment cycle.

在一个可选实施例中,根据预设的策略判断周期,判断所述当前自定义分支模式的分支管理策略是否满足预设的自定义分支稳定规则,包括:获取预设策略判断周期内历史分支模式的分支管理策略;其中,所述历史分支模式为历史自定义分支模式或任一候选分支模式;确定当前自定义分支模式的分支管理策略与历史分支模式的分支管理策略之间的策略差值;若所述策略差值小于预设的差值阈值,则确定所述当前自定义分支模式的分支管理策略满足预设的自定义分支稳定规则。In an optional embodiment, according to a preset policy judgment period, it is determined whether the branch management policy of the current custom branch mode satisfies the preset custom branch stability rules, including: obtaining the branch management policy of the historical branch mode within the preset policy judgment period; wherein the historical branch mode is a historical custom branch mode or any candidate branch mode; determining the policy difference between the branch management policy of the current custom branch mode and the branch management policy of the historical branch mode; if the policy difference is less than the preset difference threshold, it is determined that the branch management policy of the current custom branch mode satisfies the preset custom branch stability rules.

获取预设的策略判断周期内的至少一个历史分支模式的分支管理策略,其中,历史分支模式可以为历史自定义分支模式或任一候选分支模式。A branch management policy of at least one historical branch mode within a preset policy judgment period is obtained, wherein the historical branch mode may be a historical custom branch mode or any candidate branch mode.

将历史分支模式的分支管理策略转换成矩阵或记忆曲线的形式。策略差值可以是当前自定义分支模式的分支管理策略转换后的矩阵,与历史分支模式的分支管理策略转换后的矩阵之间的矩阵差值;也可以是当前自定义分支模式的分支管理策略转换后的记忆曲线,与历史分支模式的分支管理策略转换后的记忆曲线之间的曲线上某两个点之间的差值。其中,预设的差值阈值可以由相关技术人员进行提前设定,具体可以是根据经验值或实验值对不同策略差值比较对象进行设定。其中,策略差值比较对象例如可以是矩阵差值或记忆曲线差值,相关技术人员可以根据矩阵差值或记忆曲线差值设置不同的差值阈值。例如,策略差值比较对象为记忆曲线差值的差值阈值可以设置为3,策略差值比较对象为矩阵差值的差值阈值可以设置为5。The branch management strategy of the historical branch mode is converted into the form of a matrix or a memory curve. The strategy difference can be the matrix difference between the matrix after the branch management strategy of the current custom branch mode is converted and the matrix after the branch management strategy of the historical branch mode is converted; it can also be the difference between two points on the curve between the memory curve after the branch management strategy of the current custom branch mode is converted and the memory curve after the branch management strategy of the historical branch mode is converted. Among them, the preset difference threshold can be set in advance by relevant technical personnel, and specifically, different strategy difference comparison objects can be set according to experience values or experimental values. Among them, the strategy difference comparison object can be, for example, a matrix difference or a memory curve difference, and the relevant technical personnel can set different difference thresholds according to the matrix difference or the memory curve difference. For example, the difference threshold when the strategy difference comparison object is the memory curve difference can be set to 3, and the difference threshold when the strategy difference comparison object is the matrix difference can be set to 5.

示例性的,以策略差值比较对象为矩阵差值为例,进行举例说明,可以将当前自定义分支模式的分支管理策略转换后的矩阵中的元素,与历史分支模式的分支管理策略转换后的矩阵中的元素进行比较,确定当前自定义分支模式的分支管理策略与历史分支模式的分支管理策略之间的矩阵差值。Exemplarily, taking the policy difference comparison object as the matrix difference as an example, the elements in the matrix after the branch management policy of the current custom branch mode is converted can be compared with the elements in the matrix after the branch management policy of the historical branch mode is converted to determine the matrix difference between the branch management policy of the current custom branch mode and the branch management policy of the historical branch mode.

示例性的,以策略差值比较对象为记忆曲线差值为例,进行举例说明,可以对当前自定义分支模式的分支管理策略转换后记忆曲线(以下称当前记忆曲线)任取一坐标点,对历史分支模式的分支管理策略转换后的记忆曲线(以下称历史记忆曲线)取与当前记忆曲线相对应的坐标点;可以将当前记忆曲线的坐标点对应的坐标值与历史记忆曲线的坐标点对应的坐标值进行逐一比较,确定当前自定义分支模式的分支管理策略与历史分支模式的分支管理策略之间的记忆曲线差值。即,判断自定义分支模式的变化是否趋于稳定。Exemplarily, taking the strategy difference comparison object as the memory curve difference as an example, an example can be given to illustrate that a coordinate point can be randomly selected from the memory curve after the branch management strategy of the current custom branch mode is converted (hereinafter referred to as the current memory curve), and a coordinate point corresponding to the current memory curve can be selected from the memory curve after the branch management strategy of the historical branch mode is converted (hereinafter referred to as the historical memory curve); the coordinate values corresponding to the coordinate points of the current memory curve can be compared one by one with the coordinate values corresponding to the coordinate points of the historical memory curve to determine the memory curve difference between the branch management strategy of the current custom branch mode and the branch management strategy of the historical branch mode. That is, it is determined whether the change of the custom branch mode tends to be stable.

具体的,若策略差值小于预设的差值阈值,则确定当前自定义分支模式的分支管理策略满足预设的自定义分支稳定规则,可以执行S140;若策略差值大于预设的差值阈值,则当前自定义分支模式的分支管理策略不满足预设的自定义分支稳定规则,可以由用户确定是否继续使用当前自定义分支模式作为目标分支模式,以完成对目标分支模式的分支管理。Specifically, if the policy difference is less than the preset difference threshold, it is determined that the branch management policy of the current custom branch mode meets the preset custom branch stability rules, and S140 can be executed; if the policy difference is greater than the preset difference threshold, the branch management policy of the current custom branch mode does not meet the preset custom branch stability rules, and the user can determine whether to continue using the current custom branch mode as the target branch mode to complete the branch management of the target branch mode.

本可选实施例通过获取预设判断周期内历史分支模式的分支管理策略,并将其与历史分支模式的分支管理策略进行比较,确定策略差值;根据策略差值与预设差值的关系,确定当前自定义分支模式的分支管理策略是否满足预设的自定义分支稳定规则。上述技术方案通过确定当前自定义分支模式的分支管理策略是否满足预设的自定义分支稳定规则的方式,实现了用户能够通过稳定的分支管理策略进行软件开发,在以后的迭代开发中,能够根据已形成的稳定的分支管理策略进行分支管理,从而减少了项目组的分支管理成本,实现了一体化的、自动化的分支管理策略。This optional embodiment obtains the branch management strategy of the historical branch mode within the preset judgment period, and compares it with the branch management strategy of the historical branch mode to determine the strategy difference; according to the relationship between the strategy difference and the preset difference, it determines whether the branch management strategy of the current custom branch mode meets the preset custom branch stability rule. The above technical solution enables users to develop software through a stable branch management strategy by determining whether the branch management strategy of the current custom branch mode meets the preset custom branch stability rule. In subsequent iterative development, branch management can be performed according to the already formed stable branch management strategy, thereby reducing the branch management cost of the project team and realizing an integrated and automated branch management strategy.

S140、若是,则确定当前自定义分支模式为软件开发的目标分支模式,以完成对分支模式的自定义管理。S140: If yes, determine the current customized branch mode as the target branch mode for software development to complete customized management of the branch mode.

若当前自定义分支模式的分支管理策略满足预设的自定义分支稳定规则,则可以确定当前自定义分支模式为软件开发的目标分支模式,并完成对分支模式的自定义管理。其中,分支模式的自定义管理可以包括项目组根据自身情况对主分支、开发分支、特性分支、发布分支和特性分支等中的至少一种进行自定义管理;还可以包括对代码检视、流水线配置的管理。例如,在不同分支管理策略下配置不同的流水线,在自定义管理过程中随时对各分支中的代码进行代码检视。If the branch management strategy of the current custom branch mode meets the preset custom branch stability rules, the current custom branch mode can be determined as the target branch mode for software development, and the custom management of the branch mode can be completed. Among them, the custom management of the branch mode can include the project team customizing at least one of the main branch, development branch, feature branch, release branch and feature branch according to its own situation; it can also include the management of code review and pipeline configuration. For example, different pipelines are configured under different branch management strategies, and the code in each branch is reviewed at any time during the custom management process.

本实施例方案通过响应于的用户选择的自定义分支模式创建指令,并记录当前自定义分支模式的分支管理策略;当分支管理策略满足预设的自定义分支稳定规则时,确定当前自定义分支模式为软件开发的目标分支模式,并完成对分支模式的自定义管理。上述方案实现了项目组能够根据软件开发情况形成适用于自身的自动化分支管理方案,提高了分支管理效率,从而节约了分支管理成本。This embodiment of the scheme responds to the user's selected custom branch mode creation instruction and records the branch management strategy of the current custom branch mode; when the branch management strategy meets the preset custom branch stability rule, the current custom branch mode is determined to be the target branch mode for software development, and the custom management of the branch mode is completed. The above scheme enables the project team to form an automated branch management solution suitable for itself according to the software development situation, improves the efficiency of branch management, and thus saves the cost of branch management.

实施例二Embodiment 2

图2为本发明实施例二提供的一种软件开发的分支管理方法的流程图,本实施例在上述各技术方案的基础上,进行了优化改进。FIG2 is a flow chart of a branch management method for software development provided in a second embodiment of the present invention. This embodiment is optimized and improved on the basis of the above-mentioned technical solutions.

进一步的,将操作“判断用户是否从候选分支模式中确定目标分支模式”,追加为“若确定用户从所述候选分支模式中选择目标分支模式,则根据所述当前迭代创建指令,确定当前迭代开始时间;判断当前时间是否为当前迭代开始时间;若是,则根据目标分支模式的预设管理策略,对当前迭代进行分支管理。”以完善目标分支模式的确定。Furthermore, the operation "determine whether the user has determined the target branch mode from the candidate branch modes" is appended as "If it is determined that the user has selected the target branch mode from the candidate branch modes, then determine the start time of the current iteration according to the current iteration creation instruction; determine whether the current time is the start time of the current iteration; if so, perform branch management on the current iteration according to the preset management policy of the target branch mode." to improve the determination of the target branch mode.

如图2所示,该方法包括以下具体步骤:As shown in FIG2 , the method includes the following specific steps:

S210、响应于用户对软件开发的当前迭代创建指令,判断用户是否从候选分支模式中确定目标分支模式。S210 . In response to a user creating instruction for a current iteration of software development, determining whether the user determines a target branch pattern from candidate branch patterns.

S220、若确定用户从候选分支模式中选择目标分支模式,则根据当前迭代创建指令,确定当前迭代开始时间。S220: If it is determined that the user selects the target branch mode from the candidate branch modes, determine the start time of the current iteration according to the current iteration creation instruction.

若用户从候选分支模式中选择目标分支模式,则根据当前迭代创建指令,确定当前迭代开始时间;若用户未从候选分支模式中选择目标分支模式,则可以执行S250。其中,当前迭代开始时间可以由用户根据需求进行人为设定。If the user selects the target branch mode from the candidate branch modes, the current iteration start time is determined according to the current iteration creation instruction; if the user does not select the target branch mode from the candidate branch modes, S250 can be executed. The current iteration start time can be manually set by the user according to needs.

S230、判断当前时间是否为当前迭代开始时间。S230: Determine whether the current time is the start time of the current iteration.

若接收到迭代创建指令,则判断当前时间是否为当前迭代开始时间;若未接收到迭代创建指令时,则不作响应,直到定时或实时的接收到迭代创建指令。若当前时间为当前迭代开始时间,则可以执行S240;若当前时间不是当前迭代开始时间,则等待当前时间为当前迭代创建指令的迭代开始时间后,可以继续执行S240。If an iteration creation instruction is received, it is determined whether the current time is the current iteration start time; if the iteration creation instruction is not received, no response is made until the iteration creation instruction is received in a scheduled or real-time manner. If the current time is the current iteration start time, S240 can be executed; if the current time is not the current iteration start time, S240 can be continued after the current time is the iteration start time of the current iteration creation instruction.

S240、若是,则根据目标分支模式的预设管理策略,对当前迭代进行分支管理。S240: If yes, perform branch management on the current iteration according to the preset management strategy of the target branch mode.

其中,若当前时间为当前迭代创建指令的当前迭代开始时间,则可以根据目标分支模式的预设管理策略,对当前迭代进行分支管理。其中,目标分支模式可以包括AoneFlow分支模式、GitFlow分支模式或TrunkBased分支模式等中的任一分支模式,目标分支模式的分支管理为预先设计好的一套固定的分支模式管理方案,可以直接被进行软件开发的所属用户使用,并在使用的过程中按照预先设置好的分支管理策略进行分支管理。If the current time is the current iteration start time of the current iteration creation instruction, the current iteration can be managed according to the preset management strategy of the target branch mode. The target branch mode can include any branch mode such as AoneFlow branch mode, GitFlow branch mode or TrunkBased branch mode. The branch management of the target branch mode is a pre-designed set of fixed branch mode management solutions, which can be directly used by the users who are engaged in software development, and the branch management is performed according to the pre-set branch management strategy during use.

在一个可选实施例中,若目标分支模式为GitFlow分支模式;则根据目标分支模式的预设管理策略,对当前迭代进行分支管理,包括:根据主干分支拉取当前迭代的第一开发分支;根据当前迭代的工作项,基于预设的特性分支创建场景,从第一开发分支拉取特性分支;响应于代码提交指令,判断特性分支的代码是否进行代码检视,若是,则将特性分支合并入第一开发分支,得到第二开发分支;根据第二开发分支拉取发布分支;将发布分支部署至测试环境,根据预先配置的提测级流水线,对发布分支进行测试;若发布分支测试无误,则将发布分支合并入所述第二开发分支,以及将发布分支合并入主干分支,以完成分支管理。In an optional embodiment, if the target branch mode is the GitFlow branch mode, branch management is performed on the current iteration according to the preset management strategy of the target branch mode, including: pulling the first development branch of the current iteration according to the trunk branch; pulling the feature branch from the first development branch based on the preset feature branch creation scenario according to the work items of the current iteration; in response to the code submission instruction, determining whether the code of the feature branch is subject to code review, and if so, merging the feature branch into the first development branch to obtain a second development branch; pulling the release branch according to the second development branch; deploying the release branch to the test environment, and testing the release branch according to the pre-configured test-level pipeline; if the release branch test is correct, merging the release branch into the second development branch, and merging the release branch into the trunk branch to complete branch management.

从主分支中拉取当前迭代的第一开发分支,根据当前迭代的工作项,基于预设的特性分支创建场景,从第一开发分支拉取特性分支。其中,第一开发分支主要用于后续特性分支的合并。特性分支创建场景可以由用户根据需求进行提前预设,具体可以是根据当前迭代的工作项的功能特性创建特性分支,还可以是根据当前迭代的工作项的项目开发小组团队创建特性分支。具体的,从第一开发分支拉取特性分支之前,可以根据软件开发实际需求选择相应的特性分支创建场景,从而根据特性分支创建场景,确定从第一开发分支拉取的特性分支。Pull the first development branch of the current iteration from the main branch, and according to the work items of the current iteration, based on the preset feature branch creation scenario, pull the feature branch from the first development branch. Among them, the first development branch is mainly used for the merging of subsequent feature branches. The feature branch creation scenario can be preset in advance by the user according to the needs. Specifically, it can be to create a feature branch based on the functional characteristics of the work items of the current iteration, or it can be to create a feature branch based on the project development team of the work items of the current iteration. Specifically, before pulling the feature branch from the first development branch, the corresponding feature branch creation scenario can be selected according to the actual needs of software development, so as to determine the feature branch to be pulled from the first development branch according to the feature branch creation scenario.

示例性的,若根据当前迭代的工作项的功能特性创建特性分支,则在特性分支的创建过程中,可以根据当前迭代的工作项的功能特性对特性分支进行创建;可以将工作项中相同功能对应的代码写入同一特性分支中,因此,不同特性分支的工作项的功能特性不同,便于后续能够根据工作项对应的不同功能,对相应的特性分支上的代码进行编辑、修改或删除。其中,工作项中可以包含至少一个故事,一个故事对应至少一个开发软件的功能。For example, if a feature branch is created based on the functional characteristics of the current iteration's work item, the feature branch can be created based on the functional characteristics of the current iteration's work item during the creation of the feature branch; the code corresponding to the same function in the work item can be written into the same feature branch, so the functional characteristics of work items in different feature branches are different, which facilitates the subsequent editing, modification or deletion of the code on the corresponding feature branch based on the different functions corresponding to the work item. A work item can contain at least one story, and one story corresponds to at least one function of the development software.

用户可以按照预设的命名规则对工作项中的故事进行命名,其中,命名规则可以由相关工作人员进行提前设定;对工作项中各故事的命名进行语义分析,并根据语义分析结果确定相关性较大的至少一个故事,其中,语义分析可以由相关语义分析算法对应的神经网络模型进行分析,并生成语义分析结果;将确定的相关性较大的至少一个故事关联到同一个特性分支下进行开发。可选的,用户还可以在拉取特性分支之前,手动将相关性较大的故事关联至一起,并在拉取特性分支之后,将相关性较大的故事关联至同一个特性分支下进行开发。Users can name the stories in the work item according to the preset naming rules, where the naming rules can be set in advance by relevant staff; perform semantic analysis on the names of the stories in the work item, and determine at least one story with high relevance based on the semantic analysis results, where the semantic analysis can be performed by a neural network model corresponding to the relevant semantic analysis algorithm, and generate semantic analysis results; associate the at least one story with high relevance to the same feature branch for development. Optionally, users can also manually associate stories with high relevance together before pulling the feature branch, and associate stories with high relevance to the same feature branch for development after pulling the feature branch.

示例性的,若根据当前迭代的工作项的项目开发小组团队创建特性分支,则在特性分支的创建过程中,可以根据当前迭代的工作项的所属开发团队,对特性分支进行创建。其中,一个开发团队对应至少一个开发小组,一个开发小组可以负责开发工作项中不同的工作单元,且工作单元之间相互独立,一个工作单元中可以包括至少一个故事。具体可以是根据开发小组数量创建同等数量的特性分支,若要对特性分支中的代码进行修改、删除或编辑等操作,则可以直接由待操作的特性分支对应的开发小组对待操作的特性分支进行操作。For example, if a feature branch is created based on the project development team of the current iteration's work item, the feature branch can be created based on the development team to which the current iteration's work item belongs during the feature branch creation process. Among them, one development team corresponds to at least one development group, and one development group can be responsible for different work units in the development work item, and the work units are independent of each other, and one work unit can include at least one story. Specifically, the same number of feature branches can be created based on the number of development groups. If the code in the feature branch needs to be modified, deleted, or edited, the feature branch to be operated can be directly operated by the development group corresponding to the feature branch to be operated.

用户在编写特性分支的代码时,可以不断发出代码提交指令。在接收到用户的代码提交指令之后,可以通过查询代码检视记录确定用户提交的各特性分支中的代码是否进行了代码检视,其中,代码检视记录可以通过后台获取,后台可以实时或定时的监测各特性分支是否被执行代码检视操作,并为执行代码检视操作的各特性分支生成代码检视记录;若当前判断的特性分支有代码检视记录,则可以认为该特性分支已进行代码检视,若当前判断的特性分支没有代码检视记录,则可以认为该特性分支未进行代码检视,并可以通过发送邮件的方式通知相关开发人员对未进行代码检视的特性分支进行代码检视。When writing code for a feature branch, the user can continuously issue code submission instructions. After receiving the user's code submission instruction, it is possible to determine whether the code in each feature branch submitted by the user has been code reviewed by querying the code review record, wherein the code review record can be obtained through the background, and the background can monitor in real time or periodically whether each feature branch has been subjected to code review operations, and generate code review records for each feature branch that has been subjected to code review operations; if the currently judged feature branch has a code review record, it can be considered that the feature branch has been code reviewed, and if the currently judged feature branch has no code review record, it can be considered that the feature branch has not been code reviewed, and the relevant developers can be notified by sending emails to conduct code reviews on feature branches that have not been code reviewed.

可以由相关技术人员手动对各特性分支中的代码进行代码检视,具体可以是将特性分支的代码手动放入测试工具中进行测试,并将测试通过的结果进行提交,由后台实时或定时的监测代码检视提交记录。若对代码检视的测试未通过,则由相关技术人员重新进行特性分支的代码检视,直到测试通过。其中,若采用定时监测的方式,则可以由相关工作人员设置定时周期,例如可以是1小时。可选的,代码检视还可以通过插拔式触发提交级构建流水线自动测试,其中,可以根据不同的开发语言类型对流水线进行相应的配置,例如,可以根据C语言、JAVA语言或JS语言对流水线进行相应的配置。The relevant technical personnel can manually review the codes in each feature branch. Specifically, the code of the feature branch can be manually put into the test tool for testing, and the test results can be submitted. The background monitors the code review submission records in real time or regularly. If the code review test fails, the relevant technical personnel will re-review the code of the feature branch until the test passes. Among them, if a timed monitoring method is adopted, the timing period can be set by the relevant staff, for example, it can be 1 hour. Optionally, the code review can also be triggered by the plug-in type to build the submission-level pipeline for automatic testing, wherein the pipeline can be configured accordingly according to different development language types, for example, the pipeline can be configured accordingly according to C language, JAVA language or JS language.

若代码检视由流水线自动化测试,则后台根据自动化测试结果确定是否生成代码检视提交记录。若自动化测试结果通过,则生成对应的特性分支的代码检视记录;若自动化测试结果未通过,则不生成对应的特性分支的代码检视记录,并且可以向流水线发送提示信息,以提示自动化检视未通过,并由流水线重新进行代码检视。If the code review is automated by the pipeline, the backend determines whether to generate a code review submission record based on the automated test results. If the automated test result passes, a code review record for the corresponding feature branch is generated; if the automated test result fails, a code review record for the corresponding feature branch is not generated, and a prompt message can be sent to the pipeline to prompt that the automated review has failed, and the pipeline will re-perform the code review.

判断特性分支的代码是否进行代码检视,若是,为便于验证合并后的当前迭代的各项功能,则将特性分支合并入第一开发分支,得到第二开发分支;若否,则后台可以通过发送邮件的方式通知相关工作人员进行代码检视。Determine whether the code of the feature branch needs to be reviewed. If so, in order to verify the functions of the current iteration after the merger, the feature branch will be merged into the first development branch to obtain the second development branch; if not, the background can notify relevant staff to conduct code review by sending emails.

若特性分支已进行代码检视,则将特性分支合并入第一开发分支,得到第二开发分支。具体的,将特性分支合并入第一开发分支,得到第二开发分支之前,可以对预合并的特性分支的代码进行质量检测。若质量测试通过,则将特性分支合并入第一开发分支,得到第二开发分支,并在合并的过程中,为第二开发分支创建标签,便于后续因开发需求变动从而需要对第二开发分支进行相应操作时,能够根据第二开发分支的标签,快速回滚至第二开发分支中合并前的位置,并进行相应的操作,从而不影响其他分支的合并,其中,相应操作例如可以是对删除、编辑或修改操作;若质量测试未通过,则通知相关开发人员对质量测试未通过的特性分支进行修改。If the feature branch has been code reviewed, the feature branch is merged into the first development branch to obtain the second development branch. Specifically, before merging the feature branch into the first development branch to obtain the second development branch, the code of the pre-merged feature branch can be quality tested. If the quality test passes, the feature branch is merged into the first development branch to obtain the second development branch, and during the merging process, a label is created for the second development branch, so that when the second development branch needs to be operated on due to changes in development requirements, it can be quickly rolled back to the position before the merge in the second development branch according to the label of the second development branch, and the corresponding operation can be performed, so as not to affect the merging of other branches, where the corresponding operation can be, for example, a deletion, editing or modification operation; if the quality test fails, the relevant developers are notified to modify the feature branch that failed the quality test.

在一个可选实施例中,将特性分支合并入第一开发分支,得到第二开发分支,包括:根据第一开发分支拉取临时分支;将特性分支合并入临时分支,得到预合并分支;根据预先设置的项目管理要求,对预合并分支的代码进行质量检测;若检测成功,则将特性分支合并入第一开发分支,得到第二开发分支。In an optional embodiment, merging a feature branch into a first development branch to obtain a second development branch includes: pulling a temporary branch based on the first development branch; merging the feature branch into the temporary branch to obtain a pre-merged branch; performing quality inspection on the code of the pre-merged branch according to pre-set project management requirements; if the inspection is successful, merging the feature branch into the first development branch to obtain a second development branch.

可以从第一开发分支中拉取临时分支,并将特性分支合并入临时分支,得到预合并分支。根据预先设置的项目管理要求,对预合并分支的代码进行质量检测。具体的,开发人员可以根据预先设置的项目管理要求,设置不同的指标和阈值。其中,指标可以包括单元测试覆盖率、新增代码覆盖率、债务率、快味道数量和程序漏洞(Bug)数量等中的至少一种;阈值可以是与各项指标相对应的指标阈值。对预合并分支的代码质量检测可以通过触发门禁式构建流水线进行检测,具体可以是通过门禁式构建流水线对预合并分支进行检测,在门禁式构建流水线中使用门禁规则对临时分支中不合格的特性分支进行阻断,从而实现对预合并分支进行质量检测。A temporary branch can be pulled from the first development branch, and the feature branch can be merged into the temporary branch to obtain a pre-merged branch. According to the pre-set project management requirements, the code of the pre-merged branch is quality checked. Specifically, the developer can set different indicators and thresholds according to the pre-set project management requirements. Among them, the indicators may include at least one of unit test coverage, new code coverage, debt ratio, number of fast tastes, and number of program vulnerabilities (bugs); the threshold may be an indicator threshold corresponding to each indicator. The code quality detection of the pre-merged branch can be performed by triggering a gated build pipeline. Specifically, the pre-merged branch can be detected through a gated build pipeline, and the gated rules are used in the gated build pipeline to block unqualified feature branches in the temporary branch, thereby achieving quality detection of the pre-merged branch.

若预合并分支的质量检测成功,则将特性分支合并入第一开发分支,得到第二开发分支;若合并分支的质量检测失败,则通知相关开发人员对质量测试失败的特性分支进行修改。本可选实施例通过确定预合并分支,判断预合并分支代码的质量测试是否通过的方式,确定是否将特性分支合并入所述第一开发分支,实现了对合并入第一开发分支之前的合并的特性分支代码的预先测试,从而防止特性分支在合并过程中出现错误,提高了合并后特性分支代码的准确度与稳定性。If the quality test of the pre-merged branch is successful, the feature branch is merged into the first development branch to obtain the second development branch; if the quality test of the merged branch fails, the relevant developers are notified to modify the feature branch that failed the quality test. This optional embodiment determines whether to merge the feature branch into the first development branch by determining the pre-merged branch and judging whether the quality test of the pre-merged branch code has passed, thereby achieving a pre-test of the merged feature branch code before merging into the first development branch, thereby preventing errors in the feature branch during the merging process and improving the accuracy and stability of the merged feature branch code.

在一个可选实施例中,在将特性分支合并入第一开发分支,得到第二开发分支之后,还包括:将特性分支添加至待删除清单中,判断特性分支是否满足预设的第一删除条件;若是,则将特性分支从待删除清单中删除。In an optional embodiment, after merging the feature branch into the first development branch to obtain the second development branch, it also includes: adding the feature branch to the list to be deleted, determining whether the feature branch meets the preset first deletion condition; if so, deleting the feature branch from the list to be deleted.

分支模式中的各分支包括短分支和长分支,其中,短分支周期较短,通常可以在各分支的代码开发完成后进行删除,例如,短分支可以是特性分支、发布分支和热修复分支。长分支通常在软件开发过程中长期保留,进而不会在分支上的功能开发完成后删除,例如,长分支可以是主分支或开发分支。Each branch in the branch mode includes short branches and long branches. Among them, the short branch cycle is shorter and can usually be deleted after the code development of each branch is completed. For example, short branches can be feature branches, release branches, and hot fix branches. Long branches are usually retained for a long time during the software development process and will not be deleted after the function development on the branch is completed. For example, long branches can be master branches or development branches.

其中,第一删除条件可以是当前待删除的特性分支分支已合并至第一开发分支,并且后台中在预设期限中不存在当前待删除特性分支的提交记录,即当前待删除特性分支中的代码在预设期限中未进行更新。Among them, the first deletion condition can be that the feature branch to be deleted has been merged into the first development branch, and there is no submission record of the feature branch to be deleted in the background within the preset period, that is, the code in the feature branch to be deleted has not been updated within the preset period.

将特性分支添加至待删除清单中,判断特性分支是否满足预设的第一删除条件;若是,则将特性分支从待删除清单中删除;若否,则将特性分支保留在待删除清单中,并提示开发人员该特性分支不满足第一删除条件。本可选实施例通过将满足预设第一删除条件的特性分支删除的方式,减小了对内存空间的占用。The feature branch is added to the to-be-deleted list, and it is determined whether the feature branch meets the preset first deletion condition; if so, the feature branch is deleted from the to-be-deleted list; if not, the feature branch is retained in the to-be-deleted list, and the developer is prompted that the feature branch does not meet the first deletion condition. This optional embodiment reduces the occupation of memory space by deleting the feature branch that meets the preset first deletion condition.

根据第二开发分支拉取发布分支;将发布分支部署至测试环境,根据预先配置的提测级流水线,对发布分支进行测试。具体的,开发人员可以通过预先配置的提测级流水线,将发布分支部署至测试环境,对发布分支进行测试;若发布分支测试无误,则将发布分支合并入第二开发分支,以及将发布分支合并入主分支,以完成分支管理;若发布分支测试有误,则提示相关开发人员测试有误,并可以提示相关开发人员可以直接在测试环境中对测试有误的代码进行修改,并将修改后的发布分支合并至第二开发分支以及主分支中。Pull the release branch according to the second development branch; deploy the release branch to the test environment, and test the release branch according to the pre-configured test-level pipeline. Specifically, developers can deploy the release branch to the test environment through the pre-configured test-level pipeline and test the release branch; if the release branch test is correct, merge the release branch into the second development branch, and merge the release branch into the main branch to complete branch management; if the release branch test is incorrect, the relevant developers will be prompted that the test is incorrect, and the relevant developers can be prompted to modify the incorrectly tested code directly in the test environment, and merge the modified release branch into the second development branch and the main branch.

其中,当发布分支合并至主分支后,可以将发布分支放入待删除清单中。判断发布主分支是否满足第二删除条件,若满足,则可以将各发布分支从待删除清单中删除,若不满足,则可以保留在待删除清单中,并提示工作人员该发布分支不满足第二删除条件。其中,第二删除条件可以是当前待删除发布分支已合并至主分支,并且后台中在预设期限中不存在当前待删除发布分支的提交记录,即当前待删除发布分支中的代码在预设期限中未进行更新。When the release branch is merged into the main branch, the release branch can be put into the list to be deleted. It is determined whether the main release branch meets the second deletion condition. If so, each release branch can be deleted from the list to be deleted. If not, it can be kept in the list to be deleted, and the staff is prompted that the release branch does not meet the second deletion condition. The second deletion condition can be that the current release branch to be deleted has been merged into the main branch, and there is no submission record of the current release branch to be deleted in the background within the preset period, that is, the code in the current release branch to be deleted has not been updated within the preset period.

若在部署测试环境后,需要对生产环境中的代码进行紧急修复,具体可以是在主分支中拉取热修复分支,并在热修复分支中对待紧急修复的代码进行修复,并将修复成功的代码合并入主分支中,同时合并入发布分支。具体的,当热修复分支中的代码完成紧急修复,并且已合并至主分支后,可以将热修复分支添加至待删除清单中。判断热修复分支是否满足第三删除条件,若满足,则可以将各热修复分支从待删除清单中删除,若不满足,则可以保留在待删除清单中,并提示工作人员该热修复分支不满足第三删除条件。其中,第三删除条件可以是当前待删除的热修复分支已合并至主分支,并且后台中在预设期限中不存在当前待删除热修复分支的提交记录,即当前待删除热修复分支中的代码在预设期限中未进行更新。If after the deployment of the test environment, the code in the production environment needs to be urgently repaired, specifically, the hot repair branch can be pulled from the main branch, and the code to be urgently repaired can be repaired in the hot repair branch, and the successfully repaired code can be merged into the main branch and merged into the release branch at the same time. Specifically, when the code in the hot repair branch has completed the emergency repair and has been merged into the main branch, the hot repair branch can be added to the list to be deleted. Determine whether the hot repair branch meets the third deletion condition. If it does, each hot repair branch can be deleted from the list to be deleted. If not, it can be retained in the list to be deleted, and the staff is prompted that the hot repair branch does not meet the third deletion condition. Among them, the third deletion condition can be that the current hot repair branch to be deleted has been merged into the main branch, and there is no submission record of the current hot repair branch to be deleted in the background within the preset period, that is, the code in the current hot repair branch to be deleted has not been updated within the preset period.

本可选实施例通过当前迭代的工作项,基于预设的特性分支创建场景,从第一开发分支中拉取特性分支,实现了在GitFlow分支模式中进行特性分支创建的过程中,能够根据预设的特性分支创建场景与实际需求,选择性的对特性分支进行创建,为使用GitFlow分支模式进行分支管理的所属开发人员提供更多的创建选择,并在开发过程中提供便利。通过将发布分支部署至测试环境,根据预先配置的提测级流水线,对发布分支进行测试的方式完成分支管理,实现了对各发布分支的自动化测试,从而提高了各发布分支代码的准确度。This optional embodiment uses the current iteration's work items and based on the preset feature branch creation scenario to pull feature branches from the first development branch, and achieves the process of creating feature branches in the GitFlow branch mode. Feature branches can be selectively created based on the preset feature branch creation scenario and actual needs, providing more creation options for developers who use the GitFlow branch mode for branch management, and providing convenience in the development process. Branch management is completed by deploying the release branch to the test environment and testing the release branch according to the pre-configured test-level pipeline, which achieves automated testing of each release branch, thereby improving the accuracy of each release branch code.

在一个可选实施例中,若目标分支模式为TrunkBased分支模式,则可以按照TrunkBased分支模式的设定规则进行分支管理。在TrunkBased分支模式下,工作项中的各故事所包含的任务均与主分支相关联,开发人员可以基于主分支完成对软件的开发。In an optional embodiment, if the target branch mode is the TrunkBased branch mode, branch management can be performed according to the setting rules of the TrunkBased branch mode. In the TrunkBased branch mode, the tasks contained in each story in the work item are associated with the main branch, and developers can complete the development of the software based on the main branch.

开发人员可以根据主分支拉取软件开发的当前迭代的副主分支,用于承载工作项中各故事所包含的任务代码;后台可以定时或实时监测是否有代码检视记录,其中,若采用定时监测方式,则后台可以监测在定时周期内是否有代码检视记录,其中,定时周期可以由相关技术人员进行提前设定,例如可以设定为10分钟。若是,则可以将副主分支合并至主分支,若否,则可以通过发送邮件的方式通知相应工作人员安排代码检视,或通过向流水线发送提示信息的方式,以提示流水线对相应的副主分支代码进行自动化测试。若代码检视通过,后台会生成副主分支代码检视通过的代码检视记录。其中,自动化测试可以通过插拔式触发提交级构建的流水线完成,并且可以根据不同的开发语言类型对流水线进行相应的配置。Developers can pull the sub-main branch of the current iteration of software development based on the main branch to carry the task code contained in each story in the work item; the background can monitor whether there is a code review record at regular or real-time intervals. If a scheduled monitoring method is adopted, the background can monitor whether there is a code review record within the scheduled period. The scheduled period can be set in advance by relevant technical personnel, for example, it can be set to 10 minutes. If so, the sub-main branch can be merged into the main branch. If not, the relevant staff can be notified by sending an email to arrange the code review, or by sending a prompt message to the pipeline to prompt the pipeline to perform automated testing on the corresponding sub-main branch code. If the code review passes, the background will generate a code review record of the sub-main branch code review passing. Among them, the automated test can be completed by a plug-in pipeline that triggers the submission-level build, and the pipeline can be configured accordingly according to different development language types.

将代码检视通过的各副主分支合并至主分支,并从合并后的主分支中拉取至少一个发布分支进行代码质量测试,具体可以是触发门禁式构建流水线,并根据不同的开发语言类型对流水线进行相应的配置,通过配置后的流水线完成对发布分支的代码质量的测试。若代码质量测试通过,则可以将发布分支中的代码放入提前部署的测试环境中进行测试;若代码质量测试未通过,则可以在发布分支中对代码进行修改。Merge all sub-main branches that have passed the code review into the main branch, and pull at least one release branch from the merged main branch for code quality testing. Specifically, it can trigger a gated build pipeline, and configure the pipeline accordingly according to different development language types, and complete the code quality test of the release branch through the configured pipeline. If the code quality test passes, the code in the release branch can be put into a pre-deployed test environment for testing; if the code quality test fails, the code can be modified in the release branch.

若发布分支中的代码质量测试通过,则可以配置提测级流水线,并在部署的提测级流水线的测试环境中,对发布分支中的代码进行测试验证。若测试通过,则可以将发布分支合并至主分支中,并部署到正式环境,同时可以为各发布分支创建标签,便于后续能够通过标签确定需要修改、编辑或删除的待操作发布分支,并完成对待操作发布分支的相应操作;若测试未通过,则后台发出测试未通过提示信息,以提示相应的工作人员对测试未通过的代码进行修复。相关工作人员可以将各发布分支修复后的代码重新合并至主分支,并部署到正式环境中,并为发布分支创建标签。If the code quality test in the release branch passes, you can configure the test-level pipeline, and test and verify the code in the release branch in the test environment of the deployed test-level pipeline. If the test passes, the release branch can be merged into the main branch and deployed to the formal environment. At the same time, you can create tags for each release branch, so that you can use the tags to determine the release branches to be modified, edited, or deleted, and complete the corresponding operations on the release branches to be operated. If the test fails, the background will issue a test failure prompt message to prompt the corresponding staff to repair the code that failed the test. The relevant staff can merge the repaired code of each release branch back into the main branch, deploy it to the formal environment, and create tags for the release branches.

示例性的,若在部署测试环境后,需要对生产环境中的代码进行紧急修复,具体可以是在主分支中拉取热修复分支,并在热修复分支中对待紧急修复的代码进行修复,并将修复成功的代码合并入主分支中,同时合并入发布分支。具体的,当热修复分支中的代码完成紧急修复,并且已合并至主分支之后,可以将热修复分支添加至待删除清单中。判断热修复分支是否满足第三删除条件,若满足,则可以将各热修复分支从待删除清单中删除,若不满足,则可以保留在待删除清单中,并提示工作人员该热修复主分支不满足第三删除条件。For example, if after the test environment is deployed, the code in the production environment needs to be urgently repaired, the hot repair branch can be pulled from the main branch, and the code to be urgently repaired can be repaired in the hot repair branch, and the successfully repaired code can be merged into the main branch and the release branch at the same time. Specifically, when the code in the hot repair branch has been urgently repaired and merged into the main branch, the hot repair branch can be added to the list to be deleted. Determine whether the hot repair branch meets the third deletion condition. If so, each hot repair branch can be deleted from the list to be deleted. If not, it can be retained in the list to be deleted, and the staff is prompted that the hot repair main branch does not meet the third deletion condition.

在一个可选实施例中,若目标分支模式为AoneFlow分支模式,则可以按照AoneFlow分支模式的设定规则进行分支管理。在AoneFlow分支模式下,开发人员可以基于主分支,根据工作项中的各故事所包含的不同任务自动创建特性分支。In an optional embodiment, if the target branch mode is the AoneFlow branch mode, branch management can be performed according to the setting rules of the AoneFlow branch mode. In the AoneFlow branch mode, developers can automatically create feature branches based on the main branch according to the different tasks contained in each story in the work item.

示例性的,开发人员可以根据主分支拉取软件开发的当前迭代的特性分支,用于承载工作项中各故事所包含的任务代码;后台可以定时或实时监测是否有代码检视记录,其中,代码检测可以通过可插拔式触发提交级构建的流水线进行自动检测。若是,则可以将特性分支合并至由主分支拉取的发布分支,若否,则可以通过发送邮件的方式通知相应工作人员安排代码检视,或通过向流水线发送提示信息的方式,以提示流水线对相应的特性分支代码进行代码检视。若代码检视通过,后台会生成特性分支代码检视通过的代码检视记录。For example, developers can pull the feature branch of the current iteration of software development based on the main branch to carry the task code contained in each story in the work item; the background can monitor whether there is a code review record regularly or in real time, wherein the code detection can be automatically detected by a pluggable pipeline that triggers the submission-level build. If so, the feature branch can be merged into the release branch pulled from the main branch. If not, the corresponding staff can be notified by sending an email to arrange the code review, or by sending a prompt message to the pipeline to prompt the pipeline to perform a code review on the corresponding feature branch code. If the code review passes, the background will generate a code review record of the feature branch code passing the review.

基于主分支拉取发布分支,将代码检视通过的各特性分支合并至发布分支,并对合并后的发布分支进行代码质量测试,其中,代码质量测试可以通过提测级流水线进行自动化测试。若发布分支的代码质量通过,则将发布分支部署到正式环境中,同时,将发布分支合并至主分支,并为主分支中的发布分支添加标签。Pull the release branch based on the main branch, merge the feature branches that have passed the code review into the release branch, and perform code quality testing on the merged release branch. The code quality testing can be automated through the test-level pipeline. If the code quality of the release branch passes, the release branch will be deployed to the formal environment. At the same time, the release branch will be merged into the main branch, and a label will be added to the release branch in the main branch.

示例性的,在各特性分支合并的过程中,可以将各合并完成后的特性分支添加至待删除清单中,判断各分支是否满足预设的第一删除条件;若是,则可以将各特性分支从待删除清单中删除。若否,则将特性分支保留在待删除清单中,并提示开发人员该特性分支不满足第一删除条件。For example, during the merging of feature branches, each merged feature branch can be added to the to-be-deleted list to determine whether each branch meets the preset first deletion condition; if so, each feature branch can be deleted from the to-be-deleted list. If not, the feature branch is retained in the to-be-deleted list, and the developer is prompted that the feature branch does not meet the first deletion condition.

若在部署测试环境后,需要对生产环境中的代码进行紧急修复,具体可以是在主分支中拉取热修复分支,并在热修复分支中对待紧急修复的代码进行修复,并将修复成功的代码合并入主分支中,同时合并入发布分支。具体的,当热修复分支中的代码完成紧急修复之后,可以将热修复分支添加至待删除清单中。If you need to urgently fix the code in the production environment after deploying the test environment, you can pull the hot fix branch from the main branch, fix the code to be urgently fixed in the hot fix branch, merge the successfully fixed code into the main branch, and merge it into the release branch. Specifically, after the code in the hot fix branch is urgently fixed, you can add the hot fix branch to the list to be deleted.

S250、若用户未从候选分支模式中确定目标分支模式,则响应于用户的自定义分支模式创建指令,记录当前自定义分支模式的分支管理策略。S250: If the user has not determined the target branch mode from the candidate branch modes, in response to the user's custom branch mode creation instruction, record the branch management policy of the current custom branch mode.

S260、根据预设的策略判断周期,判断当前自定义分支模式的分支管理策略是否满足预设的自定义分支稳定规则。S260: According to a preset policy judgment cycle, determine whether the branch management policy of the current custom branch mode satisfies a preset custom branch stability rule.

S270、若是,则确定当前自定义分支模式为软件开发的目标分支模式,以完成对分支模式的自定义管理。S270: If yes, determine the current customized branch mode as the target branch mode for software development to complete customized management of the branch mode.

本实施例方案通过确定用户从候选分支模式中选择的目标分支模式,并根据目标分支模式的预设管理策略,对当前迭代进行分支管理的方式,实现了用户在候选分支模式下自动化、规范化的进行分支管理,从而提高软件开发效率。This embodiment scheme determines the target branch mode selected by the user from the candidate branch modes, and manages the branches of the current iteration according to the preset management strategy of the target branch mode, thereby realizing automatic and standardized branch management by the user under the candidate branch mode, thereby improving software development efficiency.

实施例三Embodiment 3

图3为本发明实施例三提供的一种软件开发的分支管理装置的结构示意图。本发明实施例所提供的一种软件开发的分支管理装置可执行本发明任意实施例所提供的一种软件开发的分支管理方法,具备执行方法相应的功能模块和有益效果。该装置可采用软件和/或硬件的方式实现。如图4所示,该装置具体包括:FIG3 is a schematic diagram of the structure of a branch management device for software development provided in Embodiment 3 of the present invention. A branch management device for software development provided in an embodiment of the present invention can execute a branch management method for software development provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. The device can be implemented in software and/or hardware. As shown in FIG4, the device specifically includes:

目标分支模式确定模块301,用于响应于用户对软件开发的当前迭代创建指令,判断用户是否从候选分支模式中确定目标分支模式;The target branch pattern determination module 301 is used to determine whether the user determines the target branch pattern from the candidate branch patterns in response to the user's creation instruction for the current iteration of software development;

分支管理策略记录模块302,用于若用户不从候选分支模式中确定目标分支模式,则响应于用户的自定义分支模式创建指令,记录当前自定义分支模式的分支管理策略;A branch management strategy recording module 302 is used to record the branch management strategy of the current custom branch mode in response to the user's custom branch mode creation instruction if the user does not determine the target branch mode from the candidate branch modes;

分支稳定策略判断模块303,用于根据预设的策略判断周期,判断所述当前自定义分支模式的分支管理策略是否满足预设的自定义分支稳定规则;The branch stability strategy judgment module 303 is used to judge whether the branch management strategy of the current custom branch mode satisfies the preset custom branch stability rule according to the preset strategy judgment cycle;

自定义管理模块304,用于若当前自定义分支模式的分支管理策略满足预设的自定义分支稳定规则,则确定所述当前自定义分支模式为软件开发的目标分支模式,以完成对分支模式的自定义管理。The custom management module 304 is used to determine that the current custom branch mode is a target branch mode for software development if the branch management strategy of the current custom branch mode meets the preset custom branch stability rule, so as to complete the custom management of the branch mode.

本实施例方案通过响应于的用户选择的自定义分支模式创建指令,并记录当前自定义分支模式的分支管理策略;当分支管理策略满足预设的自定义分支稳定规则时,确定当前自定义分支模式为软件开发的目标分支模式,并完成对分支模式的自定义管理。上述方案实现了项目组能够根据软件开发情况形成适用于自身的自动化分支管理方案,提高了分支管理效率,从而节约了分支管理成本。This embodiment of the scheme responds to the user's selected custom branch mode creation instruction and records the branch management strategy of the current custom branch mode; when the branch management strategy meets the preset custom branch stability rule, the current custom branch mode is determined to be the target branch mode for software development, and the custom management of the branch mode is completed. The above scheme enables the project team to form an automated branch management solution suitable for itself according to the software development situation, improves the efficiency of branch management, and thus saves the cost of branch management.

可选的,所述自定义分支模式创建指令包括创建分支指令、合并分支指令、删除分支指令、代码检视指令和流水线配置指令;Optionally, the custom branch mode creation instruction includes a create branch instruction, a merge branch instruction, a delete branch instruction, a code review instruction, and a pipeline configuration instruction;

相应的,分支管理策略记录模块302,包括:Accordingly, the branch management strategy recording module 302 includes:

策略确定单元,用于根据所述自定义分支模式创建指令,确定分支创建策略、分支合并策略、分支删除策略、代码检视策略和流水线配置策略;A strategy determination unit, configured to determine a branch creation strategy, a branch merging strategy, a branch deletion strategy, a code review strategy, and a pipeline configuration strategy according to the custom branch mode creation instruction;

分支管理策略确定单元,用于根据所述分支创建策略、分支合并策略、分支删除策略、代码检视策略、流水线配置策略以及自定义分支模式创建指令的触发时间,确定当前自定义分支模式的分支管理策略。The branch management strategy determination unit is used to determine the branch management strategy of the current custom branch mode according to the branch creation strategy, branch merging strategy, branch deletion strategy, code review strategy, pipeline configuration strategy and the trigger time of the custom branch mode creation instruction.

可选的,分支稳定策略判断模块303,包括:Optionally, the branch stability strategy determination module 303 includes:

历史策略获取单元,用于获取预设策略判断周期内历史分支模式的分支管理策略;其中,所述历史分支模式为历史自定义分支模式或任一候选分支模式;A historical strategy acquisition unit, used to acquire a branch management strategy of a historical branch mode within a preset strategy judgment period; wherein the historical branch mode is a historical custom branch mode or any candidate branch mode;

策略差值确定单元,用于确定当前自定义分支模式的分支管理策略与历史分支模式的分支管理策略之间的策略差值;A policy difference determination unit, used to determine a policy difference between a branch management policy of a current custom branch mode and a branch management policy of a historical branch mode;

稳定规则确定单元,用于若所述策略差值小于预设的差值阈值,则确定所述当前自定义分支模式的分支管理策略满足预设的自定义分支稳定规则。The stability rule determination unit is used to determine whether the branch management strategy of the current custom branch mode satisfies the preset custom branch stability rule if the strategy difference is less than a preset difference threshold.

可选的,该装置还包括:Optionally, the device further comprises:

时间确定模块,用于在判断用户是否从候选分支模式中确定目标分支模式之后,若确定用户从所述候选分支模式中选择目标分支模式,则根据所述当前迭代创建指令,确定当前迭代开始时间;A time determination module, configured to determine the start time of the current iteration according to the current iteration creation instruction after determining whether the user has determined the target branch mode from the candidate branch modes, if it is determined that the user has selected the target branch mode from the candidate branch modes;

时间判断模块,用于判断当前时间是否为当前迭代开始时间;The time judgment module is used to judge whether the current time is the start time of the current iteration;

分支管理模块,用于若当前时间为当前迭代开始时间,则根据目标分支模式的预设管理策略,对当前迭代进行分支管理。The branch management module is used to perform branch management on the current iteration according to the preset management strategy of the target branch mode if the current time is the start time of the current iteration.

可选的,所述目标分支模式为GitFlow分支模式;Optionally, the target branch mode is a GitFlow branch mode;

相应的,分支管理模块,包括:Correspondingly, the branch management module includes:

第一开发分支拉取单元,用于根据主干分支拉取当前迭代的第一开发分支;A first development branch pulling unit, used to pull the first development branch of the current iteration according to the trunk branch;

特性分支拉取单元,用于根据当前迭代的工作项,基于预设的特性分支创建场景,从所述第一开发分支拉取特性分支;A feature branch pulling unit, configured to pull a feature branch from the first development branch according to a work item of a current iteration and based on a preset feature branch creation scenario;

第二开发分支确定单元,用于响应于代码提交指令,判断所述特性分支的代码是否进行代码检视,若是,则将所述特性分支合并入所述第一开发分支,得到第二开发分支;a second development branch determination unit, configured to determine, in response to a code submission instruction, whether the code of the feature branch is to be reviewed, and if so, merge the feature branch into the first development branch to obtain a second development branch;

发布分支拉取单元,用于根据所述第二开发分支拉取发布分支;A release branch pulling unit, used to pull a release branch according to the second development branch;

测试子单元,用于将所述发布分支部署至测试环境,根据预先配置的提测级流水线,对所述发布分支进行测试;A testing subunit, used to deploy the release branch to a test environment and test the release branch according to a pre-configured test-level pipeline;

分支管理单元,用于若所述发布分支测试无误,则将所述发布分支合并入所述第二开发分支,以及将所述发布分支合并入所述主干分支,以完成分支管理。The branch management unit is used to merge the release branch into the second development branch if the release branch test is correct, and merge the release branch into the trunk branch to complete branch management.

可选的,该装置还包括:Optionally, the device further comprises:

第一删除条件判断装置,用于在将所述特性分支合并入所述第一开发分支,得到第二开发分支之后,将所述特性分支添加至待删除清单中,判断所述特性分支是否满足预设的第一删除条件;A first deletion condition judging device, configured to, after merging the feature branch into the first development branch to obtain a second development branch, add the feature branch to a to-be-deleted list, and judge whether the feature branch satisfies a preset first deletion condition;

特性分支删除装置,用于若所述特性分支满足预设的第一删除条件,则将所述特性分支从所述待删除清单中删除。The characteristic branch deleting device is used to delete the characteristic branch from the to-be-deleted list if the characteristic branch meets a preset first deletion condition.

可选的,第二开发分支确定单元,具体用于:Optionally, the second development branch determination unit is specifically configured to:

根据所述第一开发分支拉取临时分支;Pull a temporary branch based on the first development branch;

将所述特性分支合并入所述临时分支,得到预合并分支;Merge the feature branch into the temporary branch to obtain a pre-merged branch;

根据预先设置的项目管理要求,对所述预合并分支的代码进行质量检测;According to the preset project management requirements, quality inspection is performed on the code of the pre-merged branch;

若检测成功,则将所述特性分支合并入所述第一开发分支,得到所述第二开发分支。If the detection is successful, the feature branch is merged into the first development branch to obtain the second development branch.

上述软件开发的分支管理装置可执行本申请任意实施例所提供的软件开发的分支管理方法,具备执行各软件开发的分支管理方法相应的功能模块和有益效果。The branch management device for software development described above can execute the branch management method for software development provided by any embodiment of the present application, and has functional modules and beneficial effects corresponding to executing each branch management method for software development.

实施例四Embodiment 4

图4是本发明实施例四提供的一种软件开发的分支管理的结构示意图。软件开发的分支管理设备是一种电子设备,图4示出了适于用来实现本发明实施方式的示例性电子设备400的框图。图4显示的电子设备400仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。FIG4 is a schematic diagram of a branch management structure of software development provided by Embodiment 4 of the present invention. The branch management device for software development is an electronic device, and FIG4 shows a block diagram of an exemplary electronic device 400 suitable for implementing the embodiment of the present invention. The electronic device 400 shown in FIG4 is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present invention.

如图4所示,电子设备400以通用计算设备的形式表现。电子设备400的组件可以包括但不限于:一个或者多个处理器或者处理单元401,系统存储器402,连接不同系统组件(包括系统存储器402和处理单元401)的总线403。As shown in Fig. 4, electronic device 400 is in the form of a general computing device. Components of electronic device 400 may include but are not limited to: one or more processors or processing units 401, system memory 402, and bus 403 connecting different system components (including system memory 402 and processing unit 401).

总线403表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线,微通道体系结构(MAC)总线,增强型ISA总线、视频电子标准协会(VESA)局域总线以及外围组件互连(PCI)总线。Bus 403 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.

电子设备400典型地包括多种计算机系统可读介质。这些介质可以是任何能够被电子设备400访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。The electronic device 400 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 400, including volatile and non-volatile media, removable and non-removable media.

系统存储器402可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(RAM)404和/或高速缓存存储器405。电子设备400可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统406可以用于读写不可移动的、非易失性磁介质(图4未显示,通常称为“硬盘驱动器”)。尽管图4中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线403相连。存储器402可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本发明各实施例的功能。The system memory 402 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 404 and/or cache memory 405. The electronic device 400 may further include other removable/non-removable, volatile/non-volatile computer system storage media. By way of example only, the storage system 406 may be used to read and write non-removable, non-volatile magnetic media (not shown in FIG. 4 , commonly referred to as a “hard drive”). Although not shown in FIG. 4 , a disk drive for reading and writing a removable non-volatile disk (such as a “floppy disk”) and an optical disk drive for reading and writing a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical media) may be provided. In these cases, each drive may be connected to the bus 403 via one or more data medium interfaces. The memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

具有一组(至少一个)程序模块407的程序/实用工具408,可以存储在例如存储器402中,这样的程序模块407包括但不限于操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块407通常执行本发明所描述的实施例中的功能和/或方法。A program/utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 407 generally perform the functions and/or methods of the embodiments described herein.

电子设备400也可以与一个或多个外部设备409(例如键盘、指向设备、显示器410等)通信,还可与一个或者多个使得用户能与该电子设备400交互的设备通信,和/或与使得该电子设备400能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口411进行。并且,电子设备400还可以通过网络适配器412与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图4所示,网络适配器412通过总线403与电子设备400的其它模块通信。应当明白,尽管图4中未示出,可以结合电子设备400使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The electronic device 400 may also communicate with one or more external devices 409 (e.g., keyboards, pointing devices, displays 410, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 400, and/or communicate with any device that enables the electronic device 400 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input/output (I/O) interface 411. Furthermore, the electronic device 400 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and/or public networks, such as the Internet) via a network adapter 412. As shown in FIG. 4 , the network adapter 412 communicates with other modules of the electronic device 400 via a bus 403. It should be understood that, although not shown in FIG. 4 , other hardware and/or software modules may be used in conjunction with the electronic device 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

处理单元401通过运行存储在系统存储器402中的程序,从而执行各种功能应用以及数据处理,例如实现本发明实施例所提供的一种软件开发的分支管理方法。The processing unit 401 executes various functional applications and data processing by running the programs stored in the system memory 402, for example, implementing a branch management method for software development provided by an embodiment of the present invention.

实施例六Embodiment 6

本发明实施例六还提供一种包含计算机可执行指令的存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本发明实施例所提供的一种软件开发的分支管理方法,包括:Embodiment 6 of the present invention further provides a storage medium containing computer executable instructions, on which a computer program is stored. When the program is executed by a processor, a branch management method for software development provided in the embodiment of the present invention is implemented, including:

响应于用户对软件开发的当前迭代创建指令,判断用户是否从候选分支模式中确定目标分支模式;In response to a user creating an instruction for a current iteration of software development, determining whether the user determines a target branching pattern from candidate branching patterns;

若否,则响应于用户的自定义分支模式创建指令,记录当前自定义分支模式的分支管理策略;If not, in response to the user's custom branch mode creation instruction, the branch management policy of the current custom branch mode is recorded;

根据预设的策略判断周期,判断所述当前自定义分支模式的分支管理策略是否满足预设的自定义分支稳定规则;According to a preset policy judgment cycle, judging whether the branch management policy of the current custom branch mode satisfies a preset custom branch stability rule;

若是,则确定所述当前自定义分支模式为软件开发的目标分支模式,以完成对分支模式的自定义管理。If so, the current customized branch mode is determined to be the target branch mode for software development to complete customized management of the branch mode.

本发明实施例的计算机存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.

计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、电线、光缆、RF等等,或者上述的任意合适的组合。The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (7)

CN202110948161.3A2021-08-182021-08-18 A branch management method, device, electronic device and medium for software developmentActiveCN113687859B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110948161.3ACN113687859B (en)2021-08-182021-08-18 A branch management method, device, electronic device and medium for software development

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110948161.3ACN113687859B (en)2021-08-182021-08-18 A branch management method, device, electronic device and medium for software development

Publications (2)

Publication NumberPublication Date
CN113687859A CN113687859A (en)2021-11-23
CN113687859Btrue CN113687859B (en)2024-04-19

Family

ID=78580806

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110948161.3AActiveCN113687859B (en)2021-08-182021-08-18 A branch management method, device, electronic device and medium for software development

Country Status (1)

CountryLink
CN (1)CN113687859B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114489617B (en)*2022-01-102025-05-06招商银行股份有限公司 Branch strategy generation method, device, terminal device and storage medium
CN115203023A (en)*2022-06-232022-10-18中国银行股份有限公司 Software development branch switching method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1838068A (en)*2004-09-292006-09-27微软公司Workflow association in a collaborative application
CN108415694A (en)*2018-02-282018-08-17山东汇贸电子口岸有限公司A kind of Android agile development system and methods based on GitFlow workflows
CN110865806A (en)*2019-11-202020-03-06腾讯科技(深圳)有限公司Code processing method, device, server and storage medium
CN112948271A (en)*2021-04-092021-06-11腾讯科技(深圳)有限公司Code testing method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1838068A (en)*2004-09-292006-09-27微软公司Workflow association in a collaborative application
CN108415694A (en)*2018-02-282018-08-17山东汇贸电子口岸有限公司A kind of Android agile development system and methods based on GitFlow workflows
CN110865806A (en)*2019-11-202020-03-06腾讯科技(深圳)有限公司Code processing method, device, server and storage medium
CN112948271A (en)*2021-04-092021-06-11腾讯科技(深圳)有限公司Code testing method, device, equipment and storage medium

Also Published As

Publication numberPublication date
CN113687859A (en)2021-11-23

Similar Documents

PublicationPublication DateTitle
US9207973B2 (en)Meta-application management in a multitasking environment
CN111651353A (en) Method, apparatus, electronic device and storage medium for fault injection
CN108763076A (en)A kind of Software Automatic Testing Method, device, equipment and medium
CN110673936B (en)Breakpoint continuous operation method and device for arrangement service, storage medium and electronic equipment
WO2018120721A1 (en)Method and system for testing user interface, electronic device, and computer readable storage medium
CN112631919B (en)Contrast test method, device, computer equipment and storage medium
CN111274154A (en)Automatic testing method, device, equipment and storage medium
CN112015654B (en) Method and apparatus for testing
CN113687859B (en) A branch management method, device, electronic device and medium for software development
CN113360144B (en)Auxiliary processing method, device, storage medium and program product for software development
CN113778849A (en)Method, apparatus, device and storage medium for testing code
US10108474B2 (en)Trace capture of successfully completed transactions for trace debugging of failed transactions
CN113360365A (en)Flow testing method and flow testing system
CN113392002A (en)Test system construction method, device, equipment and storage medium
CN110865806B (en)Code processing method, device, server and storage medium
CN113609025A (en) A software program testing method, device, medium and equipment
CN111209181A (en) Regression testing method, system, apparatus, and computer storage medium
CN114416164A (en)Software release method and device, electronic equipment and storage medium
CN113342667A (en)Data processing method, data processing device, electronic equipment and computer readable storage medium
CN118193389A (en)Test case generation method, device, equipment, storage medium and product
CN112084114A (en)Method and apparatus for testing an interface
CN113742240B (en) User interface testing method, device, storage medium and electronic device
CN111897557A (en)Method, device, equipment and storage medium for updating service system
CN111580953A (en) Method and device for making a scheduling simulation scene, storage medium and electronic device
CN112532747B (en)Method, apparatus, device and storage medium for outputting information

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp