Continuous integration method and device, equipment, storage medium and program product

By using commit type parsing tools and task scenario determination modules in the ATE industry, the development and maintenance difficulty caused by too many code branches in traditional methods is solved, and the effect of performing different operations on different commit type codes on the same code branch is achieved, reducing the difficulty of continuous integration.

CN120196488APending Publication Date: 2025-06-24HUAFENG TEST CONTROL TECHNOLOGY TIANJIN CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510254032.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

In the ATE industry, the traditional continuous integration method requires setting up multiple tasks for each code branch, which leads to a lot of workload and difficulty in development and maintenance. The solution to establishing multiple code branches in the code warehouse is low in the case of customized requirements and numerous products, making it difficult to implement.

Method used

By determining the task scenario and using the pre-configured commit type analysis tool, the commit type is determined based on the commit information associated with the modification code, and the modified code is operated according to the operation mode corresponding to different commit types, so as to achieve the effect of performing different operations on the modified code of different commit types on the same code branch.

Benefits of technology

It reduces the number of code branches, reduces the difficulty of development and management, avoids setting up multiple tasks for different code branches, and reduces the difficulty of continuous integration development and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120196488A_ABST
    Figure CN120196488A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a continuous integration method and device, equipment, a storage medium and a program product. The method comprises the steps of determining a task scene; determining a submission type based on the submission information associated with the modification code through a pre-configured submission type analysis tool; the modification codes of different submission types and the submission information associated with the modification codes come from the same code branch in the code repository; and under the task scene, operating the modified code according to an operation mode corresponding to the submission type. According to the embodiment, the submission type is determined based on the submission information associated with the modification code through the pre-configured submission type analysis tool, and the modification code is operated according to the operation mode corresponding to the submission type, so that the effect of executing different operations on the modification codes of different submission types on the same code branch is achieved; and the working difficulty of development and maintenance of continuous integration is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a continuous integration method, apparatus, device, storage medium, and program product. Background Art

[0002] In the development and maintenance work of continuous integration, the traditional technical solution is as follows: modify the code repository structure, set multiple code branches, and set a task for each code branch, that is, each code branch corresponds to a type of code submission.

[0003] An Automatic Test Equipment (ATE) is a device that tests and inspects electronic components and circuit boards in the semiconductor equipment industry through computer software and hardware control. The equipment in this industry involves the collaborative development of software and hardware. For different hardware boards, different customers, and different products of customers, the same test software sometimes needs to be customized in multiple ways, and the specific customization requirements and quantities are usually in the hundreds. If all such modifications are split into code branches, the number of code branches in a code repository may exceed one hundred, and the implementation difficulty is great. In many cases, the code repository in the ATE industry achieves the purpose of customized products for different requirements by concentrating the main code on one branch, compiling and packaging to generate the mainline software to provide basic functions, and then installing various customized patch packages. Therefore, the solution of establishing multiple code branches in the code repository has low feasibility and is difficult to implement in the ATE industry when there are many customization requirements and products. Moreover, setting a task for each code branch, that is, adding the workload and difficulty of developing and maintaining multiple tasks are very large. Summary of the Invention

[0004] This application provides a continuous integration method, apparatus, device, storage medium, and program product, which can achieve the effect of performing different operations on the modified code of different submission types on the same code branch, and reduce the workload of development and maintenance.

[0005] In a first aspect, an embodiment of this application provides a continuous integration method, including: determining a task scenario; determining a submission type based on submission information associated with the modified code through a pre-configured submission type parsing tool; wherein, the modified code of different submission types and the submission information associated with the modified code are from the same code branch in the code repository; in the task scenario, operate on the modified code according to the operation method corresponding to the submission type; wherein, different submission types correspond to different operation methods.

[0006] Second aspect, an embodiment of the present application further provides a continuous integration device, including: a task scenario determination module, configured to determine a task scenario; a submission type determination module, configured to determine a submission type based on submission information associated with modified code through a pre-configured submission type parsing tool; wherein, the modified code of different submission types and the submission information associated with the modified code are from the same code branch in a code repository; an operation module, configured to operate on the modified code according to an operation method corresponding to the submission type in the task scenario; wherein, different submission types correspond to different operation methods.

[0007] Third aspect, an embodiment of the present application further provides an electronic device, the electronic device including: one or more processors; a storage device, configured to store one or more programs, when the one or more programs are executed by the one or more processors, enabling the one or more processors to implement a continuous integration method as described in an embodiment of the present application.

[0008] Fourth aspect, an embodiment of the present application further provides a storage medium containing computer-executable instructions, the computer-executable instructions being used to execute a continuous integration method as described in an embodiment of the present application when executed by a computer processor.

[0009] Fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program, the computer program implementing a continuous integration method as described in an embodiment of the present application when executed by a processor.

[0010] The technical solution of the embodiment of the present application determines a task scenario; determines a submission type based on submission information associated with modified code through a pre-configured submission type parsing tool; wherein, the modified code of different submission types and the submission information associated with the modified code are from the same code branch in a code repository; in the task scenario, operates on the modified code according to an operation method corresponding to the submission type; wherein, different submission types correspond to different operation methods. In the embodiment of the present application, by using a pre-configured submission type parsing tool to determine the submission type based on the submission information associated with the modified code and operating on the modified code according to the operation method corresponding to the submission type, the effect of performing different operations on the modified code of different submission types on the same code branch is achieved. Compared with the prior art, there is no need to set multiple code branches in the code repository, nor to submit the corresponding modified code to the corresponding code branches, reducing the number of code branches, lowering the work difficulty of development and management, and at the same time avoiding the occurrence of setting multiple tasks for different code branches, reducing the work difficulty of development and maintenance of continuous integration. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In conjunction with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic and that the elements and components are not necessarily drawn to scale.

[0012] Figure 1 Schematic diagram of a continuous integration method provided by an embodiment of the present application;

[0013] Figure 2 Schematic diagram of another continuous integration method provided by an embodiment of the present application;

[0014] Figure 3 Schematic diagram of another continuous integration method provided by an embodiment of the present invention;

[0015] Figure 4 Schematic diagram of yet another continuous integration method provided by an embodiment of the present application;

[0016] Figure 5 Schematic diagram of yet another continuous integration method provided by an embodiment of the present invention;

[0017] Figure 6 Schematic diagram of the structure of a continuous integration device provided by an embodiment of the present application;

[0018] Figure 7 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed Description of the Embodiments

[0019] The embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0020] It should be understood that the various steps described in the method embodiments of the present disclosure can be executed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard. The term "including" and its variations used herein are open-ended, that is, "including but not limited to". It should be noted that the concepts such as "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. It should be noted that the modifiers "a" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly stated in the context, it should be understood as "one or more". It can be understood that the data involved in the technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of the corresponding laws, regulations and related regulations.

[0021] Figure 1 The figure is a schematic flowchart of a continuous integration method provided by an embodiment of the present application. The embodiment of the present application is applicable to the ATE industry for continuous integration development and maintenance scenarios, such as scenarios of using the Jenkins tool for continuous integration development and maintenance. Among them, the Jenkins tool is an open-source continuous integration and continuous delivery software tool, mainly used for automating the construction, testing and deployment of software projects. This method can be executed by a continuous integration device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, and the electronic device can be a mobile terminal, a PC or a server, etc. As Figure 1 shown, the method includes:

[0022] S110. Determine the task scenario.

[0023] In this embodiment, there is no limitation on the way to determine the task scenario. For example, it can be determined according to the specific requirements or rules of the company, organization, project, development group or business. The task scenario can include a simple task scenario and a complex task scenario. Among them, the simple task scenario can be a task scenario with a small number of submission types and a simple workflow branch (that is, fewer branches). Among them, the complex task scenario can be a task scenario with a large number of submission types, a complex workflow branch (that is, more branches, such as the number of nested layers of conditional judgment statements in the workflow is greater than 3, or the cyclomatic complexity is greater than 10), or the size of the parsing file output by the submission type parsing tool is too large (such as exceeding 100MB) or the parsing file cannot be read. It should be noted that the determination of the task scenario is not limited to the above methods, and in other embodiments, it can be determined by other determination methods.

[0024] S120. Based on the commit information associated with the modified code, determine the commit type through a pre-configured commit type parsing tool.

[0025] In this embodiment, for different task scenarios, the configuration of the commit type parsing tool can be different or the same. Exemplarily, in a simple task scenario, the configuration of the commit type parsing tool can include a code repository interface, a parsing module, and a parsing result export module. In a complex task scenario, the configuration of the commit type parsing tool can include a code repository interface, a parsing module, and a task startup module.

[0026] Among them, the commit type parsing tool can be an independent tool developed and compiled through any programming language, or a script designed based on any scripting language (such as python / perl / lua) that can be directly executed without compilation.

[0027] Exemplarily, in a simple task scenario, determine the commit type based on the commit information associated with the modified code through the commit type parsing tool corresponding to the simple task scenario. In a complex task scenario, determine the commit type based on the commit information associated with the modified code through the commit type parsing tool corresponding to the complex task scenario.

[0028] Among them, the modified code of different commit types and the commit information associated with the modified code come from the same code branch in the code repository. The modified code is the code after any modification to the code in the code repository.

[0029] It should be noted that the commit type refers to "classifying what kind of continuous integration work needs to be performed according to the commit of the modified code" for the current code commit. Any modification to the code in the code repository is called modified code.

[0030] In this embodiment, there is no restriction on the commit information, which can be determined according to the specific requirements of the company, organization, project, development team or business. For example, it can include a list of modified files, committer information, commit note information, and commit time, etc. The list of modified files can include any information, such as the reason for modifying the code and the problems solved, etc. The committer information can be any identity identifier of the committer who modified the code, such as an account. The commit note information can include any information, such as the modified content, the reason for modification, the modification format, etc. The commit time is the time when the modified code is committed.

[0031] In this embodiment, there is no restriction on the commit type, which can be determined according to the specific requirements of the company, organization, project, development team or business. For example, it can include compilation, packaging, testing, doing nothing, etc.

[0032] S130. In the task scenario, operate on the modified code according to the operation method corresponding to the commit type.

[0033] It should be noted that in a simple task scenario, there is only one task, and this task includes the workflows to be executed for various different submission types. In a complex task scenario, a complex task can be split into multiple simple tasks. That is, a task with multiple workflows is split into multiple tasks, and each split task can include one or more workflows. That is, the number of workflows included in the split task is less than the number of workflows included in the task before splitting. In this embodiment, there is no restriction on the workflow, which can be determined according to the actual situation. For example, obtaining modified code (i.e., downloading modified code), compiling modified code, packaging modified code, testing modified code, etc.

[0034] In this embodiment, in a simple task scenario, the corresponding workflow can be determined according to the submission type, and the modified code is operated according to the corresponding workflow to execute the corresponding workflow. Different submission types correspond to different workflows, that is, different submission types correspond to different operation methods.

[0035] In this embodiment, in a complex task scenario, the corresponding task can be determined according to the submission type, and the modified code is operated according to the corresponding task to execute the corresponding task. Different submission types correspond to different tasks, that is, different submission types correspond to different operation methods.

[0036] The technical solution of the embodiment of the present application determines the task scenario; through a pre-configured submission type parsing tool, the submission type is determined based on the submission information associated with the modified code; wherein, the modified code of different submission types and the submission information associated with the modified code come from the same code branch in the code repository; in the task scenario, the modified code is operated according to the operation method corresponding to the submission type; wherein, different submission types correspond to different operation methods. In the embodiment of the present application, by using a pre-configured submission type parsing tool to determine the submission type based on the submission information associated with the modified code and operating the modified code according to the operation method corresponding to the submission type, the effect of performing different operations on the modified code of different submission types on the same code branch is achieved. Compared with the prior art, there is no need to set multiple code branches in the code repository, nor to submit the corresponding modified code to the corresponding code branch, reducing the number of code branches, reducing the work difficulty of development and management, and at the same time avoiding the occurrence of setting multiple tasks for different code branches, reducing the work difficulty of continuous integration development and maintenance.

[0037] Figure 2 This is a schematic diagram of another continuous integration method process provided by the embodiment of the present application. The embodiment of the present application is a concretization based on the above-mentioned invention embodiment, and the task scenario takes a simple scenario as an example. Refer to Figure 2, the method provided by the embodiments of the present application specifically includes the following steps:

[0038] S201. Determine the task scenario.

[0039] S202. If the task scenario is a simple task scenario, when the trigger is triggered, start the first task.

[0040] Among them, the first task includes the first common workflow and the workflow corresponding to the submission type.

[0041] In this embodiment, there is no limit to the way of triggering the trigger. It can be manually triggered, triggered by interface call (that is, through the hook function in the code repository, automatically triggered when it is monitored that the code has been modified), triggered periodically at regular intervals, triggered by tool polling (that is, automatically triggered when it is polled and monitored that the code in the code repository has been modified), etc.

[0042] S203. Execute the first common workflow.

[0043] Among them, the first common workflow at least includes obtaining the modified code. The first common workflow can be understood as the workflow that needs to be executed regardless of the submission type of the modified code. In this embodiment, there is no limit to the first common workflow. For example, it can be any work that needs to be executed for any submission type, such as downloading the modified code in the code repository on the server side to the local, cleaning the disk space of the local computer, etc.

[0044] It should be noted that in special cases, the first common workflow may not be required, and it may not be necessary to perform any operations on the modified code. For example, after the modified code is submitted to the code repository, the trigger is triggered and the first task is started. This task can be to send an email notification to the project manager to schedule a review meeting in the company's relevant system, etc.

[0045] It should be noted that the modified code and the associated submission information in the code repository on the server side originate from the code repository on the client side, and the modified code and the associated submission information in the code repository on the client side are submitted by the submitter.

[0046] S204. Through a pre-configured submission type parsing tool, determine the submission type based on the submission information associated with the modified code.

[0047] In this embodiment, the commit type can be determined by submitting a type parsing tool to obtain the commit information associated with the modified code from the code repository of the server, extracting the key information from the commit information, and determining the commit type based on the key information. Alternatively, a template for the commit information can be created in advance by means of git / svn hook, etc. In the template, the format of the commit information is restricted, and keywords such as "purpose", "scenario", and "whether to compile" that need to be filled in can be set. In this way, it will be more convenient to parse according to the commit information through the pre-configured commit type parsing tool.

[0048] Optionally, determining the commit type based on the commit information associated with the modified code through a pre-configured commit type parsing tool includes: obtaining the commit information through the code repository interface; extracting information from the commit information through the parsing module to obtain at least one key information; matching the at least one key information with at least one corresponding preset commit information to obtain at least one corresponding matching result; where the matching result includes successful matching and failed matching; if at least one of the matching results is at least one successful matching, then determine the commit type based on the preset commit type associated with the at least one corresponding preset commit information and the set rules.

[0049] In this embodiment, there is no restriction on the set rules. For example, if the number of successfully matched preset commit information is one, the preset commit type associated with the corresponding preset commit information can be directly used as the commit type corresponding to the commit information. If the number of successfully matched preset commit information is multiple, priorities can be configured for the corresponding multiple preset commit information, and the preset commit type associated with the preset commit information with the highest priority can be used as the commit type corresponding to the commit information.

[0050] Among them, the commit type parsing tool includes a code repository interface and a parsing module. In this embodiment, the code repository interface can be called to obtain the commit information from the code repository of the server, and the parsing module can be used to extract information from the commit information, match the extracted key information with the preset commit information, and determine the commit type based on the preset commit type associated with the matched preset commit information and the set rules. In this embodiment, there is no restriction on the information extraction method, such as keyword / phrase matching, regular expression matching, etc. In this embodiment, there is no restriction on the number and specific key information of the key information. The key information can be a list of modified files, committer information, commit comment information, and commit time, etc.

[0051] Specifically, at least one preset submission information and at least one preset submission type associated with the preset submission information are pre-stored. If at least one key information is a single key information, the key information is matched with all the preset submission information to obtain a matching result. If the matching result is a successful match, the submission type can be determined according to the set rules. For example, the preset submission type associated with the preset submission information that matches the key information is used as the submission type. In this embodiment, if the matching result is a failed match, the subsequent workflow is not triggered. Compared with the prior art, the method of triggering the workflow only according to the trigger is more flexible and has a finer granularity.

[0052] Specifically, if at least one key information is multiple key information, the multiple key information are respectively matched with all the preset submission information to obtain the matching result corresponding to each key information. If the number of successful matches is one, the submission type can be determined according to the set rules. For example, the preset submission type associated with the preset submission information that matches the key information can be directly used as the submission type. If the number of successful matches is multiple, the submission type can be determined according to the set rules. For example, the preset submission type associated with the preset submission information that is successfully matched and has the highest priority is used as the submission type. In this embodiment, if the number of successful matches is 0, the subsequent workflow is not triggered. Compared with the prior art, the method of triggering the workflow only according to the trigger is more flexible and has a finer granularity.

[0053] In this embodiment, there are no restrictions on the preset submission information and the associated preset submission type, which can be determined according to the specific requirements of the company, organization, project, development team or business. Exemplarily, the preset submission information is the code of developer A, and the associated preset submission type is compilation; the preset submission information is developer B, and the associated preset submission type is compilation and packaging; the preset submission information is that there are modifications in the test folder in the code repository, and the associated preset submission type is testing; the preset submission information is that there are modifications in the src (abbreviation for source code file) folder, and the associated preset submission type is compilation; the preset submission information is the code from Monday to Thursday, and the associated preset submission type is compilation; the preset submission information is the code on Friday, and the associated preset submission type is compilation, packaging and testing, etc.

[0054] Exemplarily, taking the key information in the submission information as an example of the submitter information and the submission time, the submitter information is Researcher A, and the submission time is Friday. It matches successfully with the preset submission information of "Researcher A" and also matches successfully with the preset submission information of "Friday". The setting rule can be: when the submitter information is "Researcher A", its priority is higher than any submission time. Since the priority of the preset submission information of "Researcher A" is higher than that of the preset submission information of "Friday", the preset submission type associated with "Researcher A" (i.e., compilation) can be used as the submission type corresponding to the submission information.

[0055] It should be noted that for the method of determining the submission type based on the submission information, the corresponding implementation logic can be written into the submission type parsing tool. It can also be written in a configuration file, and the submission type parsing tool obtains the submission type by reading the configuration file during operation.

[0056] In this embodiment, the submission information is obtained through the code repository interface, the key information is extracted by the parsing module, and the key information is matched with the preset submission information. By combining the preset submission type associated with the successfully matched preset submission information with the setting rule to determine the submission type, the submission information can be accurately classified, that is, the accuracy of determining the submission type is improved.

[0057] S205. Through the parsing result export module, at least one key information, at least one preset submission information, at least one matching result, at least one preset submission type associated with the preset submission information, the setting rule, and the submission type are saved as a parsing file.

[0058] In this embodiment, the pre-configured submission type parsing tool further includes a parsing result export module. Any information during the parsing process by the parsing module can be saved through the parsing result export module, or any other arbitrary information can be saved. This embodiment does not limit this. Exemplarily, at least one key information, at least one preset submission information that matches successfully and / or unsuccessfully, at least one matching result, at least one preset submission type associated with the preset submission information that matches successfully and / or unsuccessfully, the setting rule, and the submission type can be saved as a parsing file.

[0059] In this embodiment, there is no limit to the format of the saved parsing file, which can be txt, Toml, ini, etc. In this embodiment, by saving at least one key information, at least one preset submission information, at least one matching result, at least one preset submission type associated with the preset submission information, the setting rule, and the submission type as a parsing file through the parsing result export module, it is convenient for traceability, query, and debugging.

[0060] S206. If the task scenario is a simple task scenario, determine the submission type based on the parsed file.

[0061] In this embodiment, any recognition method can be used to recognize the submission type from the parsed file. Among them, the simple task scenario is a scenario where the number of workflows is less than the first set quantity threshold. In this embodiment, the first set quantity threshold is not limited. For example, it can be 2.

[0062] It should be noted that in the simple task scenario, it is also possible not to save at least one key information, at least one preset submission information, at least one matching result, the preset submission type associated with at least one preset submission information, the setting rules, and the submission type as the parsed file. That is, it is possible not to obtain the submission type from the parsed file and directly obtain the submission type through the parsing module.

[0063] S207. Determine the target workflow from multiple first workflows according to the submission type.

[0064] Among them, the first task also includes multiple first workflows. In this embodiment, the workflow corresponding to the submission type, that is, the target workflow, can be determined from multiple first workflows.

[0065] S208. Operate on the modified code according to the target workflow.

[0066] Exemplarily, if the submission type is compilation and the target workflow is to compile the modified code, the modified code can be compiled according to the target workflow.

[0067] In this embodiment, the method of performing different operations according to the submission type is equivalent to modifying the workflow of continuous integration in the prior art and also modifying the triggering method of continuous integration. Instead of relying only on the trigger to trigger, it judges the submission type of the submission information and triggers the corresponding workflow according to the submission type, improving the flexibility, automation degree, and efficiency of continuous integration development.

[0068] Exemplarily, taking the operation on the code using the Jenkins tool as an example. Figure 3 It is another schematic diagram of the continuous integration method flow provided by the embodiment of the present invention. As Figure 3As shown in the figure, the developer submits the modified code to the code repository (from the code repository of the client to the code repository of the server). The Jenkins tool monitors that there are changes to the code on the code branch, the trigger is activated, and the first task (including the trigger itself) is started: execute the first common workflow; identify the commit type; based on the commit type, select the target workflow from the first workflow 1 and the first workflow 2, and on the execution machine, operate on the modified code according to the target workflow. Among them, if the commit type is compilation, the first workflow 1 is used as the target workflow, and if the commit type is packaging, the first workflow 2 is used as the target workflow.

[0069] It should be noted that in the simple task scenario, since there is only one code branch, if the common part of multiple first workflows, that is, the first common workflow, changes, only the first common workflow needs to be modified, which can reduce the workload of development and maintenance and improve the efficiency of development and maintenance. In the prior art, each task of each code branch needs to be modified, resulting in a large workload of development and maintenance and low development and maintenance efficiency.

[0070] Figure 4 It is a schematic diagram of another continuous integration method flow provided by the embodiment of the present application. The embodiment of the present application is a specific implementation based on the above-mentioned invention embodiment, and the task scenario takes the complex task scenario as an example. Refer to Figure 4 , the method provided by the embodiment of the present application specifically includes the following steps:

[0071] S401. Determine the task scenario;

[0072] S402. If the task scenario is a complex task scenario, when the trigger is activated, start the first task.

[0073] S403. Execute the first common workflow.

[0074] Among them, the first common workflow at least includes obtaining the modified code. The first common workflow can also be understood as the workflow that needs to be executed regardless of the commit type of the modified code. For example, it can be a workflow such as downloading the modified code to the local area and cleaning up the computer disk space. In special cases, the first common workflow may not be required, and no operation may be required on the modified code.

[0075] S404. Through a pre-configured commit type parsing tool, determine the commit type based on the commit information associated with the modified code.

[0076] In this embodiment, the commit information associated with the modified code can be obtained from the code repository of the server through a commit type parsing tool, the key information in the commit information can be extracted, and the commit type can be determined based on the key information. Alternatively, a template for the commit information can be created in advance by means of git / svn hook, etc. In the template, the format of the commit information is restricted, and keywords such as "purpose", "scenario", and "whether to compile" that need to be filled in can be set. In this way, when parsing according to the commit information through a pre-configured commit type parsing tool, it will be more convenient.

[0077] Optionally, the commit type parsing tool includes a code repository interface and a parsing module; determining the commit type based on the commit information associated with the modified code through a pre-configured commit type parsing tool includes: obtaining the commit information through the code repository interface; extracting information from the commit information through the parsing module to obtain at least one key information; matching the at least one key information with at least one corresponding preset commit information to obtain at least one corresponding matching result; where the matching result includes successful match and failed match; if at least one of the at least one matching results is at least one successful match, then determine the commit type based on the preset commit type associated with the corresponding at least one preset commit information and the set rules.

[0078] In this embodiment, the method for determining the commit type based on the commit information associated with the modified code through a pre-configured commit type parsing tool is similar to the embodiment of the simple task scenario described above, and will not be elaborated in detail. Among them, the preset commit information, the preset commit type associated with the preset commit information, and the set rules in the complex task scenario can be the same as or different from the preset commit information, the preset commit type associated with the preset commit information, and the set rules in the simple task scenario, and can be specifically determined according to the specific requirements of the company, organization, project, development team or business.

[0079] It should be noted that during the process of matching the key information with all the preset commit information, if the number of successful matches in the matching result is 0, the subsequent tasks will not be triggered.

[0080] In this embodiment, in the prior art, the triggering conditions of triggers are usually fixed and cannot be adjusted dynamically. For example, a timing trigger can only trigger a task at a specific time point. In this way, regardless of the situation, subsequent tasks will be triggered. In this technical solution, whether a task is triggered depends on the matching result between key information and preset information, which can dynamically adapt to different scenarios. Compared with the prior art, the method of triggering tasks only according to triggers is more flexible. Further, in the prior art, triggers usually trigger tasks based on a single condition (such as time, event) and cannot handle complex logic. In this technical solution, the matching process can be based on multiple preset submission information for matching, and the logical judgment is complex. Compared with the prior art, the method of triggering tasks only according to triggers has a finer granularity and can adapt to diverse requirements.

[0081] S405. If the task scenario is a complex task scenario, then through the task startup module, start the corresponding second task based on the submission type.

[0082] Among them, the complex task scenario is a scenario where the number of workflows is greater than or equal to the first set quantity threshold.

[0083] Among them, the second task is different from the first task; the second task includes at least one second workflow.

[0084] Among them, the pre-configured submission type parsing tool also includes a task startup module.

[0085] In this embodiment, through the task startup module, determine the second task corresponding to the submission type from multiple second tasks.

[0086] It should be noted that in a complex task scenario, at least one key information, at least one preset submission information, at least one matching result, at least one preset submission type associated with the preset submission information, a setting rule, and a submission type can also be saved as a parsing file, that is, the submission type can be obtained from the parsing file.

[0087] S406. Operate on the modified code according to the second task corresponding to the submission type.

[0088] Exemplarily, if the submission type takes compilation as an example and the second task corresponding to the submission type takes compiling the modified code as an example, then the modified code can be compiled according to the second task corresponding to the submission type.

[0089] In this embodiment, the method of performing different operations according to the submission type is equivalent to making certain modifications to the workflow of continuous integration in the prior art, and at the same time making certain modifications to the triggering method of continuous integration. It is no longer triggered only by a trigger, but judges the submission type of the submission information and triggers the corresponding task according to the submission type, which improves the flexibility, automation degree and efficiency of continuous integration development.

[0090] Exemplarily, take the operation of code using the Jenkins tool as an example. Figure 5 This is another schematic diagram of the continuous integration method provided by the embodiments of the present invention. As Figure 5 shown, developers submit the modified code to the code repository (from the code repository of the client to the code repository of the server). The Jenkins tool monitors that there are changes in the code on the code branch, the trigger is triggered, and the first task (including the trigger itself) is started: execute the first common workflow; identify the submission type; according to the submission type, select the second task corresponding to the submission type from the second task 1 and the second task 2, and on the execution machine, operate on the modified code according to the second task corresponding to the submission type. Among them, if the submission type is compilation, the second task 1 is used as the second task corresponding to the submission type, and if the submission type is packaging, the second task 2 is used as the second task corresponding to the submission type.

[0091] Exemplarily, for complex task scenarios, it will be difficult to manage if too much logical processing is written in the first task. The situation of the development engineer submitting code in the following embodiments can be handed over to the second task 1, and the situation of the development supervisor submitting code can be handed over to the second task 2, so that the cyclomatic complexity and branch judgment within each task are not many, which is convenient for management.

[0092]

[0093]

[0094] It should be noted that in complex task scenarios, since there is only one code branch, if the common part of multiple second tasks, that is, the first common workflow, changes, only this first common workflow needs to be modified, which can reduce the workload of development and maintenance and improve the efficiency of development and maintenance. In the prior art, each task of each code branch needs to be modified, with a large workload of development and maintenance and low development and maintenance efficiency.

[0095] Figure 6 This is a schematic diagram of the structure of a continuous integration device provided by the embodiments of the present application. As Figure 6 shown, the device includes: a task scenario determination module 610, a submission type determination module 620, and an operation module 630;

[0096] The task scenario determination module 610 is used to determine the task scenario;

[0097] A submission type determination module 620, configured to determine a submission type based on submission information associated with modified code through a pre-configured submission type parsing tool; wherein, the modified code of different submission types and the submission information associated with the modified code are from the same code branch in the code repository;

[0098] An operation module 630, configured to operate on the modified code according to an operation method corresponding to the submission type in the task scenario; wherein, different submission types correspond to different operation methods.

[0099] The technical solution of the embodiment of the present application determines a task scenario through a task scenario determination module; the submission type determination module determines a submission type based on submission information associated with modified code through a pre-configured submission type parsing tool; wherein, the modified code of different submission types and the submission information associated with the modified code are from the same code branch in the code repository; the operation module operates on the modified code according to an operation method corresponding to the submission type in the task scenario; wherein, different submission types correspond to different operation methods. In the embodiment of the present application, by using a pre-configured submission type parsing tool to determine the submission type based on the submission information associated with the modified code and operating on the modified code according to the operation method corresponding to the submission type, the effect of performing different operations on the modified code of different submission types on the same code branch is achieved. Compared with the prior art, there is no need to set multiple code branches in the code repository, nor to submit the corresponding modified code to the corresponding code branches, reducing the number of code branches, lowering the work difficulty of development and management, and at the same time avoiding the occurrence of setting multiple tasks for different code branches, reducing the work difficulty of continuous integration development and maintenance.

[0100] Optionally, the submission type determination module is specifically configured to: when the trigger is triggered, start a first task; wherein, the first task includes a first common workflow; execute the first common workflow; wherein, the first common workflow at least includes obtaining the modified code.

[0101] Wherein, the submission type parsing tool includes a code repository interface and a parsing module. Optionally, the submission type determination module is further configured to: obtain the submission information through the code repository interface; extract information from the submission information through the parsing module to obtain at least one key information; match the at least one key information with at least one corresponding preset submission information to obtain at least one corresponding matching result; wherein, the matching result includes a successful match and a failed match; if the at least one matching result is at least one successful match, determine the submission type based on the preset submission type associated with the at least one corresponding preset submission information and a set rule.

[0102] Among them, the pre-configured submission type parsing tool further includes a parsing result export module.

[0103] Optionally, the above device further includes a saving module, configured to, after determining the submission type based on the submission information associated with the modified code, save, through the parsing result export module, the at least one key information, the at least one preset submission information, the at least one matching result, the preset submission type associated with the at least one preset submission information, the setting rule, and the submission type as a parsing file.

[0104] Among them, the first task further includes a plurality of first workflows.

[0105] Optionally, the operation module is specifically configured to: if the task scenario is a simple task scenario, determine the submission type based on the parsing file; the simple task scenario is a scenario where the number of workflows is less than a first set number threshold; according to the submission type, determine a target workflow from the plurality of first workflows; and operate on the modified code according to the target workflow.

[0106] Among them, the pre-configured submission type parsing tool further includes a task start module.

[0107] Optionally, the operation module is specifically configured to: if the task scenario is a complex task scenario, start a corresponding second task based on the submission type through the task start module; where the second task is different from the first task; the second task includes at least one second workflow; the complex task scenario is a scenario where the number of workflows is greater than or equal to a first set number threshold; and operate on the modified code according to the second task corresponding to the submission type.

[0108] The continuous integration device provided by the embodiments of the present application can execute a continuous integration method provided by any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the method.

[0109] Figure 7 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present application. The electronic device is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device (such as a helmet, glasses, a watch, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.

[0110] AsFigure 7 As shown, the electronic device 10 includes at least one processor 11 and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the random access memory (RAM) 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the read-only memory (ROM) 12, and the random access memory (RAM) 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0111] Multiple components in the electronic device 10 are connected to the input / output (I / O) interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0112] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as method code operations.

[0113] In some embodiments, the method code operations can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the read-only memory (ROM) 12 and / or the communication unit 19. When the computer program is loaded into the random access memory (RAM) 13 and executed by the processor 11, one or more steps of the method code operations described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the method code operations in any other appropriate manner (e.g., by means of firmware).

[0114] The various embodiments of the systems and techniques described above in this specification can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.

[0115] The computer programs for implementing the methods of this application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.

[0116] In the context of this application, a computer-readable storage medium can be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0117] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0118] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.

[0119] The computing system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.

[0120] The embodiment of the present application also provides a computer program product, including a computer program which, when executed by a processor, implements a continuous integration method provided in any embodiment of the present application.

[0121] In the process of implementing the computer program product, computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network - including a local area network (LAN) or a wide area network (WAN) - or, it can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).

[0122] Note that the above is only a preferred embodiment of this application and the technical principles applied. Those skilled in the art will understand that this application is not limited to the specific embodiments here. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of this application. Therefore, although this application has been described in more detail through the above embodiments, this application is not limited to the above embodiments. Without departing from the concept of this application, more other equivalent embodiments can be included, and the scope of this application is determined by the scope of the appended claims.

Claims

1. A continuous integration method, characterized in that: include: Determine the mission scenario; Determine the submission type based on the submission information associated with the modified code by using a pre-configured submission type parsing tool; wherein the modified codes of different submission types and the submission information associated with the modified codes are from the same code branch in the code repository; In the task scenario, the modification code is operated according to the operation mode corresponding to the submission type; wherein different submission types correspond to different operation modes.

2. The method according to claim 1, characterized in that Before the commit type is determined based on the commit information associated with the modified code through the pre-configured commit type resolution tool, it includes: When the trigger is triggered, a first task is started; wherein the first task includes a first common workflow; Execute the first common workflow; wherein the first common workflow at least includes obtaining the modification code.

3. The method according to claim 2, characterized in that in, The submission type parsing tool includes a code repository interface and a parsing module; Determining the submission type based on the submission information associated with the modified code by using a pre-configured submission type parsing tool includes: Obtaining the submission information through the code repository interface; Extracting information from the submitted information through the parsing module to obtain at least one key information; Matching the at least one key information with the corresponding at least one preset submission information to obtain at least one corresponding matching result; wherein the matching result includes a matching success and a matching failure; If the at least one matching result is at least one successful match, the submission type is determined based on the preset submission type associated with the corresponding at least one preset submission information and the set rules.

4. The method according to claim 3, characterized in that in, The pre-configured submission type parsing tool also includes a parsing result export module; After determining the submission type based on the submission information associated with the modified code, the method further includes: Through the analysis result export module, the at least one key information, the at least one preset submission information, the at least one matching result, the preset submission type associated with the at least one preset submission information, the setting rule, and the submission type are saved as a analysis file.

5. The method according to claim 4, characterized in that in, The first task also includes a plurality of first workflows; in the task scenario, the modification code is operated according to the operation mode corresponding to the submission type, including: If the task scenario is a simple task scenario, determining the submission type based on the parsed file; wherein the simple task scenario is a scenario in which the number of workflows is less than a first set number threshold; Determining a target workflow from the plurality of first workflows according to the submission type; The modified code is operated according to the target workflow.

6. The method according to claim 3, characterized in that in, The pre-configured submission type parsing tool also includes a task initiation module; In the task scenario, the modification code is operated according to the operation mode corresponding to the submission type, including: If the task scenario is a complex task scenario, the corresponding second task is started based on the submission type through the task start module; wherein the second task is different from the first task; the second task includes at least one second workflow; the complex task scenario is a scenario in which the number of workflows is greater than or equal to a first set number threshold; The modification code is operated according to a second task corresponding to the submission type.

7. A continuous integration device, characterized in that: include: A task scenario determination module, used to determine the task scenario; A submission type determination module, used to determine the submission type based on the submission information associated with the modified code by using a pre-configured submission type parsing tool; wherein the modified codes of different submission types and the submission information associated with the modified codes are derived from the same code branch in the code repository; An operation module is used to operate the modification code in the task scenario according to the operation mode corresponding to the submission type; wherein different submission types correspond to different operation modes.

8. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement a continuous integration method as described in any one of claims 1-6.

9. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform a continuous integration method as claimed in any one of claims 1 to 6 when executed by a computer processor.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements a continuous integration method according to any one of claims 1 to 6.