Code branch management method and device, electronic equipment and readable storage medium

By merging the code of multiple target function branches into the development branch, test branch, pre-production branch, and finally the main branch, the risk of pre-launch code splitting caused by simultaneous iteration of multiple versions is solved, and the on-time launch requirements are achieved. Precision and cleanliness of delivery and code.

CN118760468APending Publication Date: 2024-10-11GREAT WALL MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410800727.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

When the existing code branch management strategy is iterated on multiple versions at the same time, the risk of code splitting before going online is high, and it is difficult to ensure the accuracy and cleanliness of the code, which may lead to functional rollback or failure to go online.

Method used

The code of multiple target function branches is merged into the development branch for joint debugging testing. If it passes, it is merged into the test branch for integration testing. If it passes, it is merged into the pre-production branch for functional verification. Finally, it is merged into the main branch for online release. Manage code integration in multi-version parallel development through clear branch merge strategies to avoid code splits.

Benefits of technology

Ensure that all online requirements are online as scheduled, maintain the accuracy and cleanliness of online code, effectively manage code integration in multi-version parallel development, and ensure software quality and on-time delivery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760468A_ABST
    Figure CN118760468A_ABST
Patent Text Reader

Abstract

The invention provides a code branch management method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of code management.The method comprises the steps that codes of multiple target function branches are combined to a development branch, and joint debugging testing is conducted on the development branch; if the joint debugging test passes, combining the codes of the plurality of target function branches to a test branch, and performing an integration test on the test branch; if the integration test passes, combining the codes of the plurality of target function branches to a pre-production branch, and performing function verification about development requirements on the pre-production branch; and if the function verification is passed, combining the codes of the plurality of target function branches to the main branch, and issuing the codes of the main branch on line. According to the method, the existing code branch management strategy is improved to cope with the risk of code splitting before online caused by simultaneous iteration of multiple versions, and code splitting is not involved in the process of coping with simultaneous iteration of multiple versions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of code management, and more specifically, to a code branch management method, device, electronic device and computer-readable storage medium in the technical field of code management. Background Art

[0002] The code branch management strategy plays a vital role in the subsequent launch of project iterations. The current code branch management strategy merges the code of the test branch into the pre-production branch for testing after the code of each functional branch merged into the test branch passes the test. After the test passes, the code of the pre-production branch is merged into the main branch, so as to realize the launch of the function required by the development. However, in some special cases, the code that has been merged into the test environment or pre-production environment needs to be separated. Due to multiple complex operations, splitting the merged code is a high-risk and time-consuming task. If the splitting is wrong, it is very likely to cause the function rollback of the development requirement, online problems, or the failure of the function to be launched successfully. Summary of the invention

[0003] The present application provides a code branch management method, device, electronic device and computer-readable storage medium. The present application improves the existing code branch management strategy to cope with the risk of splitting the code before going online due to the simultaneous iteration of multiple versions. In the process of coping with the simultaneous iteration of multiple versions, code splitting will not be involved, which can not only ensure that all online requirements can be launched as scheduled, but also maintain the accuracy and neatness of the online code.

[0004] In a first aspect, a code branch management method is provided, which includes: merging the codes of multiple target function branches into a development branch, and performing joint debugging tests on the development branch; wherein each target function branch corresponds to different development requirements; if the joint debugging test passes, merging the codes of the multiple target function branches into a test branch, and performing integration testing on the test branch; if the integration test passes, merging the codes of the multiple target function branches into a pre-production branch, and performing functional verification on the pre-production branch regarding development requirements; if the functional verification passes, merging the codes of the multiple target function branches into a main branch, and releasing the codes of the main branch online.

[0005] In the above technical scheme, the embodiment of the present application adopts the method of merging the codes of multiple target functional branches into the development branch, performing joint debugging test on the development branch, if the joint debugging test passes, merging the codes of multiple target functional branches into the test branch, performing integration test on the test branch, if the integration test passes, merging the codes of multiple target functional branches into the pre-production branch, performing functional verification on the pre-production branch regarding development requirements, if the functional verification passes, merging the codes of multiple target functional branches into the main branch, and releasing the codes of the main branch online. In the development process, a separate Feature branch is established for all development requirements, and all subsequent ones related to the development requirements are All code adjustments are placed on the corresponding Feature branch, and the corresponding Feature branch is merged into the Test branch during integration testing; if functional verification of development requirements is required through pre-production, the corresponding Feature branch is merged into the Release branch; when it is time to release the product online, the corresponding Feature branch is still merged into the Master branch, which ensures that all requirements can be released on schedule without code splitting. This not only copes with the risk of code splitting before release due to simultaneous iteration of multiple versions, but also maintains the accuracy and neatness of the code. In addition, through a clear branch merge strategy, code integration in parallel development of multiple versions can be effectively managed to ensure software quality and on-time delivery.

[0006] In combination with the first aspect, in some possible implementations, the code branch management method also includes: obtaining multiple new functional branches from the main branch; wherein the number of the multiple new functional branches is greater than or equal to the number of the multiple target functional branches; performing functional development on each of the multiple new functional branches to obtain functional branches to be screened; wherein the functional branches to be screened include the multiple new functional branches that have been developed; screening the functional branches in the functional branches to be screened to obtain functional branches with the same version; and determining the functional branches with the same version as the multiple target functional branches.

[0007] In the above technical solution, since multiple target Feature branches are obtained from feature branches with the same version screened out from the feature branches to be screened, each time the multiple target Feature branches are merged into any one of the Dev branch, Test branch, Release branch and Master branch, the compatibility of the code merge can be ensured to avoid errors introduced by the merge operation.

[0008] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the screening of functional branches in the functional branches to be screened to obtain functional branches with the same version includes: obtaining version labels of each functional branch in the functional branches to be screened; comparing the version labels of each functional branch; and determining the functional branches with the same version labels in the functional branches as the functional branches with the same version.

[0009] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, after the pre-production branch is functionally verified with respect to development requirements, the code branch management method further includes: if the functional verification fails, determining a code error existing in the code of the pre-production branch; adjusting the code of at least one of the multiple target functional branches to eliminate the code error; re-merging the multiple target functional branches into the pre-production branch, and executing the step of performing functional verification on the pre-production branch with respect to development requirements.

[0010] In the above technical solution, when testing the code of the Release branch in a pre-production environment, if it is necessary to eliminate code errors in the code of the Release branch, there is no need to split the code of the Release branch. Any code modifications and adjustments related to specific requirements in the code of the Release branch are limited to the corresponding Feature branch, which can ensure the independence and traceability of the requirements, avoid the problem of splitting the code of the Release branch, and maintain the accuracy and neatness of the code of the Release branch.

[0011] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, after the code of the main branch is released online, the code branch management method also includes: after the online release, if there is a code error in the code of the main branch; adjust the code of at least one of the multiple target functional branches to eliminate the code error; re-merge the multiple target functional branches into the main branch, and execute the step of releasing the code of the main branch online.

[0012] In the above technical solution, in the production environment, if there are code errors in the code of the Master branch, when it is necessary to eliminate the code errors in the code of the Master branch, there is no need to split the code of the Master branch. Any code modifications and adjustments related to specific requirements in the code of the Master branch are limited to the corresponding Feature branch. This can ensure the independence and traceability of the requirements, avoid the problem of splitting the code of the Master branch, and maintain the accuracy and neatness of the code of the Master branch.

[0013] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the code branch management method also includes: reviewing the codes of the multiple target functional branches; if the review is passed, merging the codes of the multiple target functional branches into the target branch; wherein the target branch is any one of the development branch, the test branch, the pre-production branch and the main branch.

[0014] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, after merging the codes of the multiple target functional branches into the target branch, the code branch management method also includes: recording merging information about the codes of the multiple target functional branches.

[0015] In a second aspect, a code branch management device is provided, the code branch management device comprising:

[0016] A first management module is used to merge the codes of multiple target functional branches into a development branch and perform joint debugging tests on the development branch; wherein each target functional branch corresponds to different development requirements;

[0017] A second management module is used to merge the codes of the multiple target function branches into a test branch if the joint debugging test passes, and perform an integration test on the test branch;

[0018] A third management module is used to merge the codes of the multiple target functional branches into a pre-production branch if the integration test passes, and perform functional verification on the pre-production branch regarding development requirements;

[0019] The fourth management module is used to merge the codes of the multiple target functional branches into the main branch if the functional verification is passed, and release the code of the main branch online.

[0020] In conjunction with the second aspect, in some possible implementations, the code branch management device further includes:

[0021] An acquisition unit, configured to acquire a plurality of new functional branches from the main branch; wherein the number of the plurality of new functional branches is greater than or equal to the number of the plurality of target functional branches;

[0022] A development unit, configured to perform functional development on each of the plurality of new functional branches to obtain functional branches to be screened; wherein the functional branches to be screened include the plurality of new functional branches that have been developed;

[0023] A screening unit, used for screening the functional branches in the functional branches to be screened, and obtaining functional branches with the same version;

[0024] The determining unit is used to determine the functional branches with the same version as the multiple target functional branches.

[0025] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the screening unit is specifically used to obtain the version labels of each functional branch in the functional branches to be screened; compare the version labels of each functional branch; and determine the functional branches with the same version labels in the functional branches as the functional branches with the same version.

[0026] In combination with the second aspect and the above implementation, in some possible implementations, the code branch management device further includes:

[0027] The first adjustment unit is used to determine the code error existing in the code of the pre-production branch if the functional verification fails; adjust the code of at least one of the multiple target functional branches to eliminate the code error; merge the multiple target functional branches into the pre-production branch again, and execute the step of performing functional verification on the pre-production branch regarding development requirements.

[0028] In combination with the second aspect and the above implementation, in some possible implementations, the code branch management device further includes:

[0029] The second adjustment unit is used to adjust the code of at least one of the multiple target functional branches to eliminate the code error if there is a code error in the code of the main branch after the online release; merge the multiple target functional branches into the main branch again, and execute the step of releasing the code of the main branch online.

[0030] In combination with the second aspect and the above implementation, in some possible implementations, the code branch management device further includes:

[0031] A review unit is used to review the codes of the multiple target functional branches; if the review is passed, the codes of the multiple target functional branches are merged into a target branch; wherein the target branch is any one of the development branch, the test branch, the pre-production branch and the main branch.

[0032] In combination with the second aspect and the above implementation, in some possible implementations, the code branch management device further includes:

[0033] The recording unit is used to record the merge information of the codes of the multiple target functional branches.

[0034] In a third aspect, an electronic device is provided, comprising a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the electronic device executes the code branch management method in the first aspect or any possible implementation of the first aspect.

[0035] In a fourth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the code branch management method in the first aspect or any possible implementation of the first aspect.

[0036] In a fifth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the code branch management method in the above-mentioned first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 The schematic diagram of the process of developing demand testing online in the prior art is shown;

[0038] Figure 2 A schematic flow chart of a code branch management method provided in an embodiment of the present application is shown;

[0039] Figure 3 The following is a flow chart showing the improved development requirement test process of this application;

[0040] Figure 4 A schematic diagram of the structure of a code branch management device provided in an embodiment of the present application is shown;

[0041] Figure 5 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0042] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0043] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0044] The following is an explanation of the professional terms involved in this application.

[0045] Feature branch, i.e. functional branch: the code branch corresponding to the demand development;

[0046] Development branch, referred to as Dev branch, that is, development branch: the code branch corresponding to the development environment

[0047] Test branch, that is, test branch: the code branch corresponding to the test environment;

[0048] Release branch, also known as pre-production branch: the code branch corresponding to the pre-production environment;

[0049] Master branch, that is, the main branch: the code branch corresponding to the production environment.

[0050] like Figure 1 As shown, Figure 1 The following is a flow chart of the development requirement test launch in the prior art. The code branch management strategy plays a vital role in the subsequent launch of the project iteration. For the fixed iteration version in the current related technology, the development requirement pre-launch test can be carried out according to the existing iteration strategy. The overall process is as follows:

[0051] 1. New requirements need to be pulled from the Master branch to the Feature branch and developed on the Feature branch. Figure 1 Feature1 and Feature2.

[0052] 2. After the developers have completed the development of their respective functions, they need to perform joint debugging and testing in the development environment. At this time, the code is merged from the respective Feature branch to the Dev branch, and the service is released in the development environment. After the release is successful, joint debugging and testing are performed in the development environment.

[0053] 3. After the joint debugging test of the development environment is passed, the branches are merged from their respective Feature branches to the Test branch for testing, i.e., integration testing. Due to the complexity of the development environment, it is not possible to directly merge from the Dev branch to the Test branch. After the merger is successful, the service is released to the test environment, and the test begins to formally intervene and execute test cases.

[0054] 4. After the integration test is passed in the test environment, it needs to be released to the pre-production environment for the final test before production, that is, to perform functional verification on development requirements, that is, merge the code directly from the Test branch to the Release branch, and then release it to the pre-production environment again for a second functional verification.

[0055] 5. After the pre-production environment passes the functional verification of development requirements, it can be released to the production environment, which is the final online environment. At this time, the Release branch is merged into the Master branch to achieve the purpose of full launch of the current functions, that is, to realize the online release of the Master branch code.

[0056] The above existing process has the following problems: On the one hand, in some special cases, the code that has been merged into the test environment or pre-production environment may need to be separated. Due to multiple complex operations, splitting the merged code is a high-risk and time-consuming task. If the splitting is wrong, it is very likely to cause function regression, online problems, or the failure of the function to be launched successfully. On the other hand, there are special cases, such as: temporarily adjusting a certain requirement to the requirement to be launched in the next period, or there is a requirement in the current pre-production that needs to occupy the pre-production environment for a long time, and the launch time is unknown, but other requirements need to be launched normally. In this case, the existing branch management strategy is obviously unable to meet the needs.

[0057] In order to solve the problems existing in the above-mentioned prior art, the present application provides a code branch management method, device, electronic device and computer-readable storage medium, which improves the existing code branch management strategy to cope with the risk of splitting the code before going online due to the simultaneous iteration of multiple versions. In the process of coping with the simultaneous iteration of multiple versions, code splitting will not be involved, which can not only ensure that all online requirements can be launched as scheduled, but also maintain the accuracy and neatness of the online code.

[0058] The following is an embodiment of a code branch management method provided in an embodiment of the present application.

[0059] Figure 2 FIG. 1 is a schematic flow chart of a code branch management method provided by an embodiment of the present application. Figure 2 As shown, the code branch management method provided in the embodiment of the present application is applied to an electronic device, such as a computer, and the code branch management method includes the following schemes:

[0060] S110: Merge the codes of multiple target functional branches into a development branch, and perform joint debugging and testing on the development branch;

[0061] In an exemplary embodiment, the target functional branch is called the target Feature branch, and the number of multiple target Feature branches is greater than or equal to 2. According to new development requirements, multiple new functional branches are pulled from the Master branch, and the new functional branches are called new Feature branches. The corresponding functional requirements are developed for each new Feature branch. After the corresponding functional development of all new Feature branches is completed, multiple target Feature branches are obtained, that is, each target Feature branch corresponds to a different development requirement. Figure 3 As shown, Figure 3 The following is a flow chart showing the improved development requirement test process of this application. Figure 3 After pulling new Feature branches from the Master branch and developing functional requirements, the target Feature branches obtained are Feature1 and Feature2.

[0062] After obtaining multiple target Feature branches, merge the codes of multiple target Feature branches into the Dev branch, such as Figure 3 As shown, for example, the code of Feature1 and the code of Feature2 are merged into the Dev branch, and then the service is released in the development environment. After the release is successful, the Dev branch is jointly debugged and tested in the development environment.

[0063] S120: If the joint debugging test passes, the codes of the multiple target functional branches are merged into the test branch, and the test branch is subjected to integration testing.

[0064] If the joint debugging test of the Dev branch passes, merge the codes of multiple target Feature branches into the Test branch, such as Figure 3 As shown, for example, the code of Feature1 and the code of Feature2 are merged into the Test branch. After the merger is successful, the service is released to the test environment, and the test environment begins to formally intervene in the execution of test cases, thereby performing integration testing on the Test branch.

[0065] S130: If the integration test passes, the codes of the multiple target functional branches are merged into a pre-production branch, and functional verification of the pre-production branch is performed on the development requirements.

[0066] If the integration test of the Test branch passes, merge the codes of multiple target Feature branches into the Release branch, such as Figure 3As shown, for example, the code of Feature1 and the code of Feature2 are merged into the Release branch. After the merger is successful, they are released to the pre-production environment. The pre-production environment performs functional verification on the Release branch regarding development requirements, that is, the last test before the online release to test whether there are bugs (errors or defects) in the merged code.

[0067] S140: If the function verification passes, the codes of the multiple target function branches are merged into the main branch, and the code of the main branch is released online.

[0068] If the function verification of the development requirements for the Release branch is passed, merge the codes of multiple target Feature branches into the Master branch, such as Figure 3 As shown in the figure, for example, the code of Feature1 and the code of Feature2 are merged into the Master branch, the code of the Master branch is released to the production environment (that is, the final online environment), and the code of the Master branch is released online through the production environment, thereby achieving the full online release of the functions required for this development period.

[0069] The embodiment of the present application adopts a technical solution of merging the codes of multiple target function branches into a development branch, performing a joint debugging test on the development branch, merging the codes of multiple target function branches into a test branch if the joint debugging test passes, performing an integration test on the test branch, merging the codes of multiple target function branches into a pre-production branch if the integration test passes, performing functional verification on the pre-production branch regarding the development requirements, merging the codes of multiple target function branches into a main branch if the functional verification passes, and releasing the codes of the main branch online. During the development process, a Feature branch is established separately for all development requirements, and all subsequent adjustments to the code related to the development requirements are placed on the corresponding Feature branch. When performing the integration test, the corresponding Feature branch is merged into the Test branch; if the functional verification of the development requirements needs to be performed through pre-production, the corresponding Feature branch continues to be merged into the Release branch; when it is necessary to release it online, the corresponding Feature branch is still merged into the Master branch, so that it can be ensured that all online requirements can be launched on schedule, and the problem of code splitting will not be involved. It can not only deal with the risk of code splitting before going online due to the simultaneous iteration of multiple versions, but also maintain the accuracy and neatness of the online code. In addition, through a clear branch merging strategy, code integration in parallel development of multiple versions can be effectively managed to ensure software quality and on-time delivery.

[0070] The following Figure 1 The specific implementation methods of each step in the illustrated embodiment are described as follows:

[0071] In a possible implementation, the above code branch management method includes the following solutions:

[0072] Acquire multiple new functional branches from the main branch; wherein the number of the multiple new functional branches is greater than or equal to the number of the multiple target functional branches;

[0073] Performing functional development on each of the multiple new functional branches to obtain functional branches to be screened; wherein the functional branches to be screened include the multiple new functional branches that have been developed;

[0074] Screening the functional branches in the functional branches to be screened to obtain functional branches with the same version;

[0075] The functional branches with the same version are determined as the multiple target functional branches.

[0076] For the acquisition of multiple target Feature branches, multiple new feature branches are pulled from the Master branch according to new development requirements, and after the corresponding function development of all new Feature branches is completed, the feature branches to be screened are obtained, that is, the feature branches to be screened include multiple new feature branches that have been developed; then, the feature branches with the same version in the feature branches to be screened are screened out, and the screened feature branches with the same version are the multiple target Feature branches, among which the feature branches with the same version can also be understood as feature branches belonging to the same version.

[0077] Since multiple target Feature branches are obtained from the feature branches with the same version selected from the feature branches to be selected, each time the multiple target Feature branches are merged into any one of the Dev branch, Test branch, Release branch and Master branch, the compatibility of the code merge can be ensured to avoid errors introduced by the merge operation.

[0078] In a possible implementation, the above screening of the functional branches in the functional branches to be screened to obtain functional branches with the same version includes the following schemes:

[0079] Obtaining the version label of each functional branch in the functional branches to be screened;

[0080] Compare the version tags of the functional branches;

[0081] The functional branches with the same version tags among the functional branches are determined as the functional branches with the same version.

[0082] After the development of each new functional branch is completed, the version label is marked. New functional branches carrying the same version label indicate that these new functional branches belong to the same version. Therefore, after obtaining the functional branches to be screened, the version labels of each functional branch in the functional branches to be screened can be obtained, and then the version labels of each functional branch can be compared to obtain the functional branches with the same version labels in each functional branch, and then the functional branches with the same version labels in each functional branch can be determined as functional branches with the same version. Among them, determining the functional branches with the same version by version labels can improve the efficiency of obtaining the target functional branches.

[0083] In a possible implementation, after the pre-production branch is functionally verified with respect to development requirements, the code branch management method further includes the following solutions:

[0084] If the functional verification fails, determining a code error in the code of the pre-production branch;

[0085] Adjusting the code of at least one of the multiple target functional branches to eliminate the code error;

[0086] The multiple target function branches are merged into the pre-production branch again, and the step of performing functional verification on the pre-production branch with respect to development requirements is performed.

[0087] After performing functional verification on the Release branch for development requirements, if it is determined that the functional verification has not passed, it means that there is a code error in the code of the pre-production branch, that is, the existing code error is determined from the code of the pre-production branch, and then the code of at least one of the multiple target Feature branches is adjusted according to the code error to eliminate the existing code error, and then the multiple target Feature branches are merged into the Release branch again, and then the functional verification on the Release branch for development requirements is re-performed. If the functional verification still fails, repeat the above operation until the functional verification passes.

[0088] When testing the code of the Release branch in a pre-production environment, if you need to eliminate code errors in the Release branch code, there is no need to split the code of the Release branch. Any code modifications and adjustments related to specific requirements in the Release branch code are limited to the corresponding Feature branch. This can ensure the independence and traceability of the requirements, avoid the problem of splitting the Release branch code, and maintain the accuracy and neatness of the Release branch code.

[0089] In a possible implementation, after the main branch code is released online, the code branch management method further includes the following solutions:

[0090] After the release, if there are code errors in the main branch code;

[0091] Adjusting the code of at least one of the multiple target functional branches to eliminate the code error;

[0092] The multiple target function branches are merged into the main branch again, and the step of releasing the code of the main branch online is executed.

[0093] After the code of the Master branch is released online in the production environment, if a code error is detected in the code of the Master branch, the code of at least one of the multiple target Feature branches is adjusted according to the code error to eliminate the code error in the code of the Master branch, and then the multiple target Feature branches are merged into the Master branch again, and then the code of the Master branch is released online again.

[0094] In a production environment, if there are code errors in the Master branch code, when it is necessary to eliminate the code errors in the Master branch code, there is no need to split the Master branch code. Any code modifications and adjustments related to specific requirements in the Master branch code are limited to the corresponding Feature branch. This can ensure the independence and traceability of the requirements, avoid the problem of splitting the Master branch code, and maintain the accuracy and neatness of the Master branch code.

[0095] In a possible implementation, the above code branch management method also includes the following scheme:

[0096] Reviewing the codes of the multiple target functional branches;

[0097] If the review is passed, the codes of the multiple target functional branches are merged into the target branch; wherein the target branch is any one of the development branch, the test branch, the pre-production branch and the main branch.

[0098] Before merging the codes of multiple target Feature branches into any of the Dev branches, Test branches, Release branches, and Master branches, you need to conduct a strict code review on the codes of multiple target Feature branches. If the code review passes, you can then merge the codes of multiple target Feature branches into any of the Dev branches, Test branches, Release branches, and Master branches, which can improve code quality and team collaboration efficiency during demand development.

[0099] In a possible implementation, after merging the codes of the multiple target functional branches into the target branch, the code branch management method further includes the following solutions:

[0100] The merge information about the codes of the multiple target functional branches is recorded.

[0101] After merging the codes of multiple target Feature branches into any one of the Dev branch, Test branch, Release branch, and Master branch, record the merge information of each code merge of multiple target Feature branches. For example, if the codes of multiple target Feature branches are merged into the Release branch, the merge information recorded includes the information of multiple target Feature branches, the merged branch is the Release branch, etc. Recording the merge information facilitates the backtracking of development requirements, problem location, and version management.

[0102] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0103] Figure 4 A schematic diagram of the structure of a code branch management device provided in an embodiment of the present application is shown. Figure 4 As shown, the code branch management device 400 includes:

[0104] The first management module 410 is used to merge the codes of multiple target functional branches into a development branch and perform joint debugging tests on the development branch; wherein each target functional branch corresponds to different development requirements;

[0105] The second management module 420 is used to merge the codes of the multiple target functional branches into the test branch if the joint debugging test passes, and perform integration testing on the test branch;

[0106] The third management module 430 is used to merge the codes of the multiple target functional branches into the pre-production branch if the integration test passes, and perform functional verification on the pre-production branch in relation to development requirements;

[0107] The fourth management module 440 is used to merge the codes of the multiple target functional branches into the main branch if the functional verification passes, and release the code of the main branch online.

[0108] In a possible implementation, the code branch management device 400 further includes:

[0109] An acquisition unit, configured to acquire a plurality of new functional branches from the main branch; wherein the number of the plurality of new functional branches is greater than or equal to the number of the plurality of target functional branches;

[0110] A development unit, configured to perform functional development on each of the plurality of new functional branches to obtain functional branches to be screened; wherein the functional branches to be screened include the plurality of new functional branches that have been developed;

[0111] A screening unit, used for screening the functional branches in the functional branches to be screened, and obtaining functional branches with the same version;

[0112] The determining unit is used to determine the functional branches with the same version as the multiple target functional branches.

[0113] In a possible implementation, the screening unit is specifically used to obtain the version label of each functional branch in the functional branches to be screened; compare the version labels of the each functional branch; and determine the functional branches with the same version labels in the each functional branch as the functional branches with the same version.

[0114] In a possible implementation, the code branch management device 400 further includes:

[0115] The first adjustment unit is used to determine the code error existing in the code of the pre-production branch if the functional verification fails; adjust the code of at least one of the multiple target functional branches to eliminate the code error; merge the multiple target functional branches into the pre-production branch again, and execute the step of performing functional verification on the pre-production branch regarding development requirements.

[0116] In a possible implementation, the code branch management device 400 further includes:

[0117] The second adjustment unit is used to adjust the code of at least one of the multiple target functional branches to eliminate the code error if there is a code error in the code of the main branch after the online release; merge the multiple target functional branches into the main branch again, and execute the step of releasing the code of the main branch online.

[0118] In a possible implementation, the code branch management device 400 further includes:

[0119] A review unit is used to review the codes of the multiple target functional branches; if the review is passed, the codes of the multiple target functional branches are merged into a target branch; wherein the target branch is any one of the development branch, the test branch, the pre-production branch and the main branch.

[0120] In a possible implementation, the code branch management device 400 further includes:

[0121] The recording unit is used to record the merge information of the codes of the multiple target functional branches.

[0122] It should be noted that the code branch management device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when executing the code branch management method. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the code branch management device provided in the above embodiment belongs to the same concept as the code branch management method embodiment. Therefore, for details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the code branch management method of the present application, which will not be repeated here.

[0123] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0124] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. Figure 5 As shown, the electronic device 500 includes: a memory 501 and a processor 502, wherein the memory 501 stores an executable program code 5011, and the processor 502 is used to call and execute the executable program code 5011 to perform a code branch management method.

[0125] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be corresponded to, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0126] In the case of dividing each functional module according to each function, the electronic device may include: a first management module, a second management module, a third management module, a fourth management module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.

[0127] The electronic device provided in this embodiment is used to execute the above-mentioned code branch management method, and thus can achieve the same effect as the above-mentioned implementation method.

[0128] In the case of an integrated unit, the electronic device may include a processing module and a storage module. The processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device in executing related program codes and data.

[0129] The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module may be a memory.

[0130] This embodiment also provides a computer-readable storage medium, in which a computer program code is stored. When the computer program code is executed on a computer, the computer executes the above-mentioned related method steps to implement a code branch management method in the above-mentioned embodiment.

[0131] This embodiment also provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the above-mentioned related steps to implement a code branch management method in the above-mentioned embodiment.

[0132] In addition, the electronic device provided in the embodiments of the present application may specifically be a chip, a component or a module, and the electronic device may include a connected processor and a memory; wherein the memory is used to store instructions, and when the electronic device is running, the processor may call and execute instructions so that the chip executes a code branch management method in the above-mentioned embodiment.

[0133] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding code branch management method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding code branch management method provided above, and will not be repeated here.

[0134] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0135] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0136] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A code branch management method, characterized in that: The code branch management method comprises: Merge the codes of multiple target functional branches into the development branch, and perform joint debugging and testing on the development branch; wherein each target functional branch corresponds to different development requirements; If the joint debugging test passes, the codes of the multiple target function branches are merged into the test branch, and the test branch is integrated tested; If the integration test passes, the codes of the multiple target functional branches are merged into the pre-production branch, and the pre-production branch is functionally verified with respect to the development requirements; If the function verification passes, the codes of the multiple target function branches are merged into the main branch, and the code of the main branch is released online.

2. The code branch management method according to claim 1, characterized in that: The code branch management method also includes: Acquire multiple new functional branches from the main branch; wherein the number of the multiple new functional branches is greater than or equal to the number of the multiple target functional branches; Performing functional development on each of the multiple new functional branches to obtain functional branches to be screened; wherein the functional branches to be screened include the multiple new functional branches that have been developed; Screening the functional branches in the functional branches to be screened to obtain functional branches with the same version; The functional branches with the same version are determined as the multiple target functional branches.

3. The code branch management method according to claim 2, characterized in that: The screening of the functional branches in the functional branches to be screened to obtain functional branches with the same version includes: Obtaining the version label of each functional branch in the functional branches to be screened; Compare the version tags of the functional branches; The functional branches with the same version tags among the functional branches are determined as the functional branches with the same version.

4. The code branch management method according to claim 1, characterized in that: After performing functional verification on the pre-production branch regarding development requirements, the code branch management method further includes: If the functional verification fails, determining a code error in the code of the pre-production branch; Adjusting the code of at least one of the multiple target functional branches to eliminate the code error; The multiple target function branches are merged into the pre-production branch again, and the step of performing functional verification on the pre-production branch with respect to development requirements is performed.

5. The code branch management method according to claim 1, characterized in that: After the code of the main branch is released online, the code branch management method further includes: After the release, if there are code errors in the main branch code; Adjusting the code of at least one of the multiple target functional branches to eliminate the code error; The multiple target function branches are merged into the main branch again, and the step of releasing the code of the main branch online is executed.

6. The code branch management method according to claim 1, characterized in that: The code branch management method also includes: Reviewing the codes of the multiple target functional branches; If the review is passed, the codes of the multiple target functional branches are merged into the target branch; wherein the target branch is any one of the development branch, the test branch, the pre-production branch and the main branch.

7. The code branch management method according to claim 6, characterized in that: After merging the codes of the multiple target functional branches into the target branch, the code branch management method further includes: The merge information about the codes of the multiple target functional branches is recorded.

8. A code branch management device, characterized in that: The code branch management device comprises: A first management module is used to merge the codes of multiple target functional branches into a development branch and perform joint debugging tests on the development branch; wherein each target functional branch corresponds to different development requirements; A second management module is used to merge the codes of the multiple target function branches into a test branch if the joint debugging test passes, and perform an integration test on the test branch; A third management module is used to merge the codes of the multiple target functional branches into a pre-production branch if the integration test passes, and perform functional verification on the pre-production branch regarding development requirements; The fourth management module is used to merge the codes of the multiple target functional branches into the main branch if the functional verification is passed, and release the code of the main branch online.

9. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable program codes; A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the code branch management method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the code branch management method according to any one of claims 1 to 7 is implemented.