WO2023273164A1 - Code integrated verification method and device - Google Patents

Code integrated verification method and device Download PDF

Info

Publication number
WO2023273164A1
WO2023273164A1 PCT/CN2021/135869 CN2021135869W WO2023273164A1 WO 2023273164 A1 WO2023273164 A1 WO 2023273164A1 CN 2021135869 W CN2021135869 W CN 2021135869W WO 2023273164 A1 WO2023273164 A1 WO 2023273164A1
Authority
WO
WIPO (PCT)
Prior art keywords
code
change
change order
order group
orders
Prior art date
Application number
PCT/CN2021/135869
Other languages
French (fr)
Chinese (zh)
Inventor
梁正斌
杨扬
曲建伟
薛明忠
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2023273164A1 publication Critical patent/WO2023273164A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management

Definitions

  • the embodiments of the present application relate to the technical field of software engineering, and in particular, to a code integration verification method and device.
  • each developer submits the code to the code review system after completing local development, and triggers an automated continuous integration pipeline for automated construction, such as compilation, release, and automated testing, to test and verify the changed code .
  • each person's verification only has their own changes, and the purpose of integration cannot be achieved.
  • the current general practice is that each change is verified separately and merged in separately. If a build verification fails, it will be repaired. In this way, the continuity of code integration may be affected, resulting in phased versions being unavailable. That is, the construction verification of the change of the current software code is only for the verification of a change order, and there is a lack of a solution for simultaneous change verification of multiple changes to the software.
  • the embodiment of the present application provides a code integration verification method and device to at least solve one of the related technical problems to a certain extent, including the forced integration of a single change order when multiple change orders have dependencies. Problems will lead to staged unsustainable integration of the entire software/subsystem, thereby blocking the reintegration of the entire system, resulting in blocking waiting and waste.
  • a method for code integration verification including: combining multiple change orders for code changes received from the code hosting system into a change order group; according to the multiple change orders Determine the code merging sequence of each change order in the change order group according to the dependency relationship between orders; perform code merging on each change order in the change order group according to the code merging order; call the code integration system to The code after the change order group is merged undergoes integration verification.
  • a code integration verification device including: a composition module configured to compose a plurality of change orders for code changes received from a code hosting system with an association relationship into a change order group ;
  • the determination module is configured to determine the code merging sequence of each change order in the change order group according to the dependency relationship between the multiple change orders;
  • the merging module is configured to perform the changes according to the code merging sequence
  • the codes of the change orders in the single group are merged separately; the calling module is set to call the code integration system to perform integration verification on the code after the merged change order group.
  • a computer-readable storage medium is also provided, and a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to perform any one of the above-mentioned methods when running Steps in the examples.
  • an electronic device including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to perform any of the above Steps in the method examples.
  • FIG. 1 is a block diagram of a hardware structure of a computer terminal according to an embodiment of the present application
  • Fig. 2 is a flow chart of the code integration verification method according to the embodiment of the present application.
  • Fig. 3 is a flowchart of a code integration verification device according to an embodiment of the present application.
  • FIG. 4 is a flowchart of a code integration verification device according to another embodiment of the present application.
  • Fig. 5 is a schematic diagram of a code gating system according to an embodiment of the present application.
  • Fig. 6 is a flow chart of simultaneous construction verification of multiple change orders according to an embodiment of the present application.
  • Fig. 7 is a flow chart of code integration verification of multiple change orders in a single code warehouse according to an embodiment of the present application
  • Fig. 8 is a flowchart of code integration verification of multiple change orders of multiple code warehouses according to an embodiment of the present application
  • Fig. 9 is a flow chart of code integration verification for dynamically adjusting and changing odd numbers according to an embodiment of the present application.
  • Fig. 10 is a flow chart of code integration verification with a preceding change order or a group of preceding change orders according to an embodiment of the present application.
  • FIG. 1 is a block diagram of the hardware structure of a computer terminal in a code integration verification method according to an embodiment of the present application.
  • the computer terminal may include one or more (only one is shown in Figure 1) processors 102 (processors 102 may include but not limited to processing devices such as microprocessor MCU or programmable logic device FPGA, etc.) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions.
  • processors 102 may include but not limited to processing devices such as microprocessor MCU or programmable logic device FPGA, etc.
  • a memory 104 for storing data
  • the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions.
  • the structure shown in FIG. 1 is only for illustration, and it does not limit the structure of the above computer terminal.
  • the computer terminal may also include more or fewer components than shown in FIG. 1 ,
  • the memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the code integration verification method in the embodiment of the present application, and the processor 102 executes the computer program stored in the memory 104 by running the computer program.
  • the memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 104 may further include memory located remotely relative to the processor 102, and these remote memories may be connected to a computer terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the transmission device 106 is used to receive or transmit data via a network.
  • the specific example of the above-mentioned network may include a wireless network provided by the communication provider of the computer terminal.
  • the transmission device 106 includes a network interface controller (NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet.
  • the transmission device 106 may be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet in a wireless manner.
  • RF Radio Frequency
  • Change order The software developer submits the local code changes to the code hosting system, and the code hosting system generates a change record, that is, a change order, such as but not limited to Gerrit's change.
  • Change order information includes, but is not limited to: one-way dependency information, change group information (hash code, group size, etc.), change information (code project name, branch), etc.
  • One-way change order A change order associated through the one-way change order message format. Its characteristics are: this change order indicates that it depends on other change orders, and other change orders do not depend on this change order. The so-called not relying on other change orders means that code integration will not fail in the absence of other change orders.
  • One-way change order group multiple related one-way change orders, called one-way change order group.
  • Bidirectional Change Order A series of Change Orders linked through the Bidirectional Change Order message format. Its characteristics are: one or more of multiple change orders may cause code integration failure when other change orders are missing.
  • Bidirectional change order group multiple related bidirectional change orders, called bidirectional change order group
  • Pre-sequence change order When one or more change orders are not completed, the unfinished change is called the previous change order.
  • Pre-sequence change order group When one or more change order groups are incomplete and a new change order group meets the merge condition, the unfinished change order group is called the previous change order group.
  • a code integration verification method is provided.
  • a local pre-merge method is used to merge multiple related change orders into a change order group to ensure its atomicity. Then conduct continuous integration verification, and integrate or not integrate the same group of change orders at the same time according to the verification results. In this way, the continuous integration of products is guaranteed to be available, thereby improving the efficiency of software development and verification.
  • FIG. 2 is a flowchart of a code integration verification method according to an embodiment of the present application, and the method can be applied to the hardware structure shown in FIG. 1 . As shown in Figure 2, the process includes the following steps:
  • Step S202 combining multiple associated change orders received from the code hosting system for code change into a change order group
  • Step S204 determining the code merging order of each change order in the change order group according to the dependencies among the plurality of change orders;
  • Step S206 perform code merging on each change order in the change order group according to the code merging sequence
  • Step S208 calling the code integration system to perform integration verification on the merged code of the change order group.
  • the change order group may be one of the following: a one-way change order group, a two-way change order group, and a preceding change order group.
  • combining multiple change orders with associated relationships received from the code hosting system into a change order group may include: obtaining all associated change orders according to the identification query of the dependency information of the multiple change orders the plurality of change orders; forming the plurality of change orders into the change order group.
  • step S202 of this embodiment may also include: receiving multiple requests for changing the hosted code submitted by the user through the code hosting system, and generating multiple change orders and corresponding change order information, wherein,
  • the change order information is at least one of the following: one-way dependency information, change order group information, and change information.
  • determining the code merging order of each change order in the change order group according to the dependency relationship between the plurality of change orders may include: the change order group is a one-way change order group , determining the code merging sequence of each change order according to the dependency sequence of each change order in the one-way change order group.
  • performing code merging on each change order in the change order group according to the code merging sequence may include: downloading each change order in the change order group from the code hosting system The code corresponding to the order is downloaded locally, such as downloaded to the local storage or server; according to the code merging sequence, the code change of each change order is merged with the code corresponding to the change order downloaded from the code hosting system, and marked with Label information for the change order group.
  • invoking the code integration system to perform integration verification on the merged code of the change order group may include: transferring the label information of the change order group to the code integration system, so that the The code integration system downloads the corresponding code according to the label information of the change order group, and performs integration verification.
  • step S208 of this embodiment may also include: receiving the verification result of the code integration of the change order group fed back by the code integration system; All change order feedback code changes in the change order group can be integrated, and the code integration of the change order group is completed; if the verification result is that the code integration is unsuccessful, all change order feedback code changes in the change order group cannot be integrated .
  • the method may further include: merging multiple preceding change order groups being verified with the change order group into a first A change order group; determine the code merging of each preceding change order group in the first change order group according to the dependency relationship between the multiple preceding change order groups (if there is no dependency, follow the order of submission time of the change order) Sequence: according to the code merging sequence, perform code merging for each preceding change order group in the first change order group; call the code integration system to perform integration verification on the code after the first change order group is merged. That is, in the embodiment, when there is a previous change order group in the change order group, multiple previous change order groups with associated relationships can be further merged into one large change order group, so that the merged Code verification and integration is performed in units of large change order groups.
  • multiple associated change orders are merged into one change order group to ensure its atomicity, which solves the problem that the construction verification of software code changes only supports single change verification and that multiple change orders are forcibly merged into a single change order.
  • the blocking waiting and waste are caused, which improves the efficiency of software development and verification.
  • the method according to the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation.
  • the technical solution of the present application can be embodied in the form of a software product in essence or the part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to enable a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application.
  • a code integration verification device is also provided, which is used to implement the above embodiments and other implementation modes, and what has been described will not be repeated.
  • the term “module” or “unit” may be a combination of software and/or hardware that realizes a predetermined function.
  • the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
  • Fig. 3 is a structural block diagram of a code integration verification device according to an embodiment of the present application. As shown in Fig. 3 , the device includes a composition module 10, a determination module 20, a combination module 30 and a calling module 40
  • the composition module 10 is configured to compose a plurality of change orders for code change received from the code escrow system and having an association relationship into a change order group.
  • the determining module 20 is configured to determine the code merging sequence of each change order in the change order group according to the dependency relationship among the plurality of change orders.
  • the merging module 30 is configured to perform code merging on each change order in the change order group according to the code merging sequence.
  • the calling module 40 is configured to call the code integration system to perform integration verification on the merged code of the change order group.
  • multiple associated change orders can be merged into a change order group to ensure its atomicity, which solves the problem that the construction verification of software code changes only supports single change verification and the When multiple change orders with dependencies are forcibly merged, the blocking waiting and waste caused, which improves the efficiency of software development and verification.
  • Fig. 4 is a structural block diagram of a code integration verification device according to another embodiment of the present application. As shown in Fig. 4, the device includes all the modules in the above-mentioned embodiments, in this embodiment, the component module 10 can be It further includes a query unit 11 and a composition unit 12 .
  • the query unit 11 is configured to query and obtain the multiple change orders with an association relationship according to the dependency information identification query of the multiple change orders.
  • the composition unit 12 is configured to compose the plurality of change orders into the change order group.
  • the merging module 20 may further include a download unit 21 and a merging unit 22 .
  • the downloading unit 21 is configured to download the code corresponding to each change order in the change order group from the code escrow system to a local, for example, to a memory or a server of a code integration verification device.
  • the merging unit 22 is configured to merge the code changes of each change order with the code corresponding to the change order downloaded from the code escrow system according to the code merging sequence, and add the tag information of the change order group.
  • the code integration verification device may further include a receiving module 50 , a first feedback module 60 and a second feedback module 70 .
  • the receiving module 50 is configured to receive the code integration verification result of the change order group fed back by the code integration system.
  • the first feedback module 60 is configured to feedback that code changes can be integrated for all change orders in the change order group when the verification result is that the code integration is successful, and complete the code integration of the change order group.
  • the second feedback module 70 is configured to, when the verification result is that the code integration is unsuccessful, feedback that the code change cannot be integrated for all change orders in the change order group.
  • the above-mentioned modules can be realized by software or hardware. For the latter, it can be realized by the following methods, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules can be combined in any combination The forms of are located in different processors.
  • this embodiment provides a code gating system. As shown in Figure 5, the systems and modules involved in this embodiment are as follows:
  • Code hosting system a system for code hosting and review.
  • the code hosting system may include but not limited to: Gerrit, Gitlab, etc.
  • the code hosting system is used to host the user's code, receive the user's code changes, and generate change order.
  • the code gating system 200 may include a scheduling module 201 , a combining module 202 and an executing module 203 .
  • Scheduling module 201 receives and stores the change information from the upstream code hosting system 100, and when there are multiple change orders, combines the multiple change orders into a change order group and sends it to the merge module.
  • the merging module 202 receives the change order group request from the scheduling module 201, pulls the change order codes and change information one by one from the code hosting system 100 in units of change order groups, and performs local merging.
  • Execution module 203 receives the execution request from the scheduling module 201 , and transmits the merged change order group information to the continuous integration system 300 .
  • Continuous integration system 300 a system capable of obtaining a change order and performing build verification based on the change order.
  • the continuous integration system 300 may include but not limited to: Jenkins, GoCD, etc.
  • this embodiment provides a code integration verification method.
  • the user submits multiple changes in the code hosting system, and enters the associated information of multiple change orders into the information of multiple change orders middle.
  • the method includes the following steps:
  • Step S601 submitting changes.
  • the code hosting system receive multiple changes from one user, or multiple changes from multiple users, and generate multiple change orders.
  • Step S602 cache modification.
  • the scheduling module receives the change order from the code hosting system in real time, and the scheduling module queries the code hosting system for the information of the dependent order.
  • the specific processing method is as follows:
  • Dependency information identification of a one-way change order For example, the depends (depends) identification in the change information, but not limited to this identification, and multiple change orders that depend on this identification are called a one-way change order group.
  • dependent change order information According to the dependent change order ID identified by the change order, it can be obtained by querying the cached change order information. For example, it can be obtained by querying the code hosting system, or querying other change order caches to obtain dependency information.
  • Obtain one-way change order group form the queried related one-way change order into one-way change order group.
  • the scheduling module collects all change order information of the change order group from the code hosting system.
  • the identification method of the two-way change order can be, but not limited to, identified by information such as group identification and group size.
  • the dependent change order ID identified by the change order it can be obtained by querying the cached change order information. For example, it can be obtained by querying the code hosting system, or querying other change order caches to obtain dependency information.
  • Obtain bidirectional change order group convert the queried related bidirectional change order group into a bidirectional change order group.
  • Completing the collection of two-way change order groups After the scheduling module receives each change submission event, it can query all dependent change order information according to the above method, wherein the number of two-way change order groups in the two-way change order group can be changed from Obtained from the description under the group of single information.
  • Step S603 determining the pre-merging order of the change order.
  • the scheduling module After the scheduling module completes the information collection of the change order group, it enters the link of determining the order of the change order:
  • a For a one-way change order group, determine the pre-merging order of each one-way change order in the one-way change order group according to the order of depends.
  • the change combination merge request is then submitted. That is, submit the complete set of change orders to the merge module.
  • Step S604 merging change order groups.
  • the merging module after the merging module receives the merging request of the change order group, it performs the following operations:
  • the change order code can be downloaded to the code escrow system to the local, for example, the change order code can be downloaded to the storage or server of the code gating system 200 .
  • the change group code can be merged through a distributed code management system provided locally, which can be but not limited to git.
  • Code base merged for the first time Merge the code changes of each change order with the latest code in the code hosting system of the change order, and label the code.
  • the code label can be but not limited to:
  • Step S605 scheduling change order groups. After the scheduling module receives the label information of the change order group, it notifies the execution module to schedule the code integration of the change group, and specifically performs the following operations:
  • Transfer change order group labels After receiving the change order group label information, the execution module calls the code integration system for integration verification, and at the same time transmits the change order group label information to the code integration system; the code integration system downloads the corresponding code according to the code label, Perform integration verification.
  • Collect change order code integration results After the code integration system completes the integration verification, the execution module obtains the verification results and transmits them to the scheduling module.
  • Step S606 change order group integration. After the scheduling module receives the code integration result, it does the following:
  • the feedback method can be but not limited to: scoring the corresponding code integration results.
  • the embodiment of this application provides a code integration verification method for multiple change order scenarios in a single code warehouse. As shown in Figure 7, this implementation includes the following steps:
  • Step S701 submit and update.
  • multiple code changes submitted by a single person or multiple people are all aimed at the same code warehouse, and the change orders are identified as a one-way change order group through the change order information.
  • the rest of the process is the same as the above-mentioned embodiment shown in FIG. 6 .
  • Step S702 cache changes, and form multiple submitted changes into a one-way change order group.
  • the specific process is the same as the embodiment shown above.
  • Step S703 determining the pre-merging sequence of the one-way change order group.
  • the specific process is the same as the embodiment shown above.
  • Step S704 merging the one-way change order groups. If there is a conflict between change orders, report the error to the scheduling module and transfer to the processing flow. The rest of the flow process is the same as the embodiment shown above.
  • Step S705 scheduling the one-way change order group.
  • the specific process is the same as the embodiment shown above.
  • Step S706 integrating the one-way change order group.
  • the specific process is the same as the embodiment shown above.
  • the embodiment of this application also provides a code integration verification method for multiple change order scenarios in multiple code warehouses, as shown in Figure 8, this implementation includes the following steps:
  • Step S801 submit and update.
  • multiple code changes submitted by a single person or multiple people are aimed at the same multiple code warehouses, and the change orders are identified as two-way change order groups through change order information.
  • the rest of the flow process is the same as the embodiment shown in Fig. 6 .
  • Step S802 cache the change order, and form a two-way change order group.
  • the specific process is the same as the embodiment shown above.
  • Step S803 determining the pre-merging order of the change order group.
  • the specific process is the same as the embodiment shown above.
  • Step S804 merging change order groups. If there is a conflict between change orders, report the error to the scheduling module and transfer to the error handling process. The rest of the flow process is the same as the embodiment shown above.
  • Step S805 scheduling change order groups.
  • the specific process is the same as the embodiment shown above.
  • Step S806 integrating the change orders into groups.
  • the specific process is the same as the embodiment shown above.
  • the embodiment of this application also provides a code integration verification method for multiple change order scenarios in multiple code warehouses that dynamically adjust the number of change orders. As shown in Figure 9, this implementation includes the following steps:
  • Step S901 submit and update.
  • multiple code changes submitted by a single person or multiple people are aimed at the same multiple code warehouses, and the change orders are identified as two-way change order groups through change order information.
  • the scheduling module receives the change order information, it takes all the change order information The largest value of the group size is used as the group size of this change order. The rest of the flow process is the same as the embodiment shown in Fig. 6 .
  • Step S902 cache modification.
  • the specific process is the same as the embodiment shown above.
  • Step S903 determining the pre-merging order of the change order group.
  • the specific process is the same as the embodiment shown above.
  • Step S904 merging change order groups. If there is a conflict between change orders, report the error to the scheduling module and transfer to the error handling process. The rest of the flow process is the same as the embodiment shown above.
  • Step S905 scheduling change order groups.
  • the specific process is the same as the embodiment shown above.
  • Step S906 change order group integration.
  • the specific process is the same as the embodiment shown above.
  • the embodiment of this application also provides a code integration verification method for multiple change order scenarios in multiple code warehouses, that is, for multiple change order group parallel scenarios, as shown in Figure 10, this implementation includes the following steps:
  • Step S1001 submit and update.
  • the scheduler receives a new change order group, that is, when there is a previous change order or a previous change order group.
  • the rest of the flow process is the same as the embodiment shown above.
  • Step S1002 cache modification.
  • the scheduling module inquires about a change order group that has not completed integration verification, it will transfer the code labels or change order information of one or more uncompleted change order groups to the new change order group, that is, there is a previous change order group or a previous change order group.
  • the order is changed, all the other processes are the same as the above-mentioned embodiment.
  • Step S1003 determining the pre-merging sequence of the change order.
  • the previous change order group is taken as the first in the pre-merging order of the new change order, and the rest of the process is the same as that shown in Figure 6 Example.
  • Step S1004 merging change order groups. If there is a conflict between change orders, report the error to the scheduling module and transfer to the error handling process. The rest of the flow process is the same as the embodiment shown above.
  • Step S1005 scheduling change order groups.
  • the specific process is the same as the embodiment shown above.
  • Step S1006 change the single group integration.
  • the specific process is the same as the embodiment shown above.
  • Embodiments of the present application also provide a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to perform the steps in any one of the above method embodiments when running.
  • the above-mentioned computer-readable storage medium may include but not limited to: U disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), mobile Various media that can store computer programs, such as hard disks, magnetic disks, or optical disks.
  • An embodiment of the present application also provides an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps in any one of the above method embodiments.
  • the electronic device may further include a transmission device and an input and output device, wherein the transmission device is connected to the processor, and the input and output device is connected to the processor.
  • each module or each step of the above-mentioned application can be realized by a general-purpose computing device, and they can be concentrated on a single computing device, or distributed in a network composed of multiple computing devices In fact, they can be implemented in program code executable by a computing device, and thus, they can be stored in a storage device to be executed by a computing device, and in some cases, can be executed in an order different from that shown here. Or described steps, or they are fabricated into individual integrated circuit modules, or multiple modules or steps among them are fabricated into a single integrated circuit module for implementation. As such, the present application is not limited to any specific combination of hardware and software.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

A code integrated verification method and device. The method comprises: constituting, into a change order group, a plurality of change orders received from a code hosting system, having an association relation, and used for code change (S202); determining a code merging order of each change order in the change order group according to the dependency among the plurality of change orders (S204); respectively performing code merging on the change orders in the change order group according to the code merging order (S206); and invoking a code integration system to perform integrated verification on the merged code in the change order group (S208).

Description

代码集成验证方法及装置Code integration verification method and device
相关申请的交叉引用Cross References to Related Applications
本申请基于申请号为202110743930.6、申请日为2021年6月30日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on a Chinese patent application with application number 202110743930.6 and a filing date of June 30, 2021, and claims the priority of this Chinese patent application. The entire content of this Chinese patent application is hereby incorporated by reference into this application.
技术领域technical field
本申请实施例涉及软件工程技术领域,具体而言,涉及一种代码集成验证方法及装置。The embodiments of the present application relate to the technical field of software engineering, and in particular, to a code integration verification method and device.
背景技术Background technique
软件研发团队的成员经常需要集成他们的代码编写工作,通常每个成员每天至少集成一次,也就意味着每天可能会发生多次集成。一般流程为开发人员在本地完成开发,之后提交到代码管理系统,由代码管理系统和代码集成系统,完成代码的预集成检查,待检查通过后,再合入到对应的代码集成分支,完成本地开发代码的集成。Members of a software development team often need to integrate their code writing work, and usually each member integrates at least once a day, which means that integration may occur multiple times a day. The general process is that the developer completes the development locally, and then submits it to the code management system. The code management system and the code integration system complete the pre-integration check of the code. After the check is passed, it is merged into the corresponding code integration branch to complete the local Integration of development code.
当前通用做法是,每个开发人员完成本地开发后,将代码提交到代码评审系统,并触发自动化的持续集成流水线进行自动化构建,如编译、发布和自动化测试等,来测试验证本次变更的代码。The current general practice is that each developer submits the code to the code review system after completing local development, and triggers an automated continuous integration pipeline for automated construction, such as compilation, release, and automated testing, to test and verify the changed code .
随着代码规模增大,需要多人同时提交代码评审系统并触发构建时,每人的验证都只有自己的变更,而无法达到一起集成的目的。目前的通用做法是,每个变更各自验证,各自分别合入,如果有构建验证失败,则再修复,这样代码集成的持续性可能受影响,从而导致阶段性的版本不可用。即当前软件代码的变更的构建验证,仅是针对一个变更单的验证,缺少对软件的多个变更同时进行变更验证的方案。As the size of the code increases, when multiple people need to submit the code review system at the same time and trigger the build, each person's verification only has their own changes, and the purpose of integration cannot be achieved. The current general practice is that each change is verified separately and merged in separately. If a build verification fails, it will be repaired. In this way, the continuity of code integration may be affected, resulting in phased versions being unavailable. That is, the construction verification of the change of the current software code is only for the verification of a change order, and there is a lack of a solution for simultaneous change verification of multiple changes to the software.
发明内容Contents of the invention
本申请实施例提供了一种代码集成验证方法及装置,以至少在一定程度上解决相关的技术问题之一,包括多个变更单有依赖关系时,单个变更单的强行合入,如果集成有问题,将导致整个软件/子系统阶段性不可持续集成,从而对整个系统的再集成造成阻塞,出现阻塞性等待和浪费的问题。The embodiment of the present application provides a code integration verification method and device to at least solve one of the related technical problems to a certain extent, including the forced integration of a single change order when multiple change orders have dependencies. Problems will lead to staged unsustainable integration of the entire software/subsystem, thereby blocking the reintegration of the entire system, resulting in blocking waiting and waste.
根据本申请的一个实施例,提供了一种代码集成验证方法,包括:将从代码托管系统接收的多个具有关联关系的用于代码变更的变更单组成变更单组;根据所述多个变更单之间的依赖关系确定所述变更单组内各变更单的代码合并顺序;按照所述代码合并顺序对所述变更单组内的各变更单分别进行代码合并;调用代码集成系统对所述变更单组合并后的代码进行集成验证。According to one embodiment of the present application, a method for code integration verification is provided, including: combining multiple change orders for code changes received from the code hosting system into a change order group; according to the multiple change orders Determine the code merging sequence of each change order in the change order group according to the dependency relationship between orders; perform code merging on each change order in the change order group according to the code merging order; call the code integration system to The code after the change order group is merged undergoes integration verification.
根据本申请的另一个实施例,提供了一种代码集成验证装置,包括:组成模块,被设置成将从代码托管系统接收的具有关联关系的多个用于代码变更的变更单组成变更单组;确定模块,被设置成根据所述多个变更单之间的依赖关系确定所述变更单组内各变更单的代码合并顺序;合并模块,被设置成按照所述代码合并顺序对所述变更单组内的各变更单分别进行 代码合并;调用模块,被设置成调用代码集成系统对所述变更单组合并后的代码进行集成验证。According to another embodiment of the present application, a code integration verification device is provided, including: a composition module configured to compose a plurality of change orders for code changes received from a code hosting system with an association relationship into a change order group ; The determination module is configured to determine the code merging sequence of each change order in the change order group according to the dependency relationship between the multiple change orders; the merging module is configured to perform the changes according to the code merging sequence The codes of the change orders in the single group are merged separately; the calling module is set to call the code integration system to perform integration verification on the code after the merged change order group.
根据本申请的又一个实施例,还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present application, a computer-readable storage medium is also provided, and a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to perform any one of the above-mentioned methods when running Steps in the examples.
根据本申请的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present application, there is also provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to perform any of the above Steps in the method examples.
附图说明Description of drawings
图1是根据本申请实施例的计算机终端的硬件结构框图;FIG. 1 is a block diagram of a hardware structure of a computer terminal according to an embodiment of the present application;
图2是根据本申请实施例的代码集成验证方法的流程图;Fig. 2 is a flow chart of the code integration verification method according to the embodiment of the present application;
图3是根据本申请实施例的代码集成验证装置的流程图;Fig. 3 is a flowchart of a code integration verification device according to an embodiment of the present application;
图4是根据本申请另一实施例的代码集成验证装置的流程图;FIG. 4 is a flowchart of a code integration verification device according to another embodiment of the present application;
图5是根据本申请实施例的一种代码门控系统示意图;Fig. 5 is a schematic diagram of a code gating system according to an embodiment of the present application;
图6是根据本申请实施例的多个变更单同时进行构建验证的流程图;Fig. 6 is a flow chart of simultaneous construction verification of multiple change orders according to an embodiment of the present application;
图7是根据本申请实施例的单个代码仓库的多变更单的代码集成验证流程图;Fig. 7 is a flow chart of code integration verification of multiple change orders in a single code warehouse according to an embodiment of the present application;
图8是根据本申请实施例的多个代码仓库的多变更单的代码集成验证流程图;Fig. 8 is a flowchart of code integration verification of multiple change orders of multiple code warehouses according to an embodiment of the present application;
图9是根据本申请实施例的动态调整变更单数的代码集成验证流程图;Fig. 9 is a flow chart of code integration verification for dynamically adjusting and changing odd numbers according to an embodiment of the present application;
图10是根据本申请实施例的存在前序变更单或前序变更单组的代码集成验证流程图。Fig. 10 is a flow chart of code integration verification with a preceding change order or a group of preceding change orders according to an embodiment of the present application.
具体实施方式detailed description
下文中将参考附图并结合实施例来详细说明本申请的实施例。Embodiments of the present application will be described in detail below with reference to the drawings and in combination with the embodiments.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first" and "second" in the description and claims of the present application and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence.
本申请实施例中所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在计算机终端上为例,图1是本申请实施例的一种代码集成验证方法的计算机终端的硬件结构框图。如图1所示,计算机终端可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器104,其中,上述计算机终端还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述计算机终端的结构造成限定。例如,计算机终端还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiments provided in the embodiments of the present application may be executed in mobile terminals, computer terminals or similar computing devices. Taking running on a computer terminal as an example, FIG. 1 is a block diagram of the hardware structure of a computer terminal in a code integration verification method according to an embodiment of the present application. As shown in Figure 1, the computer terminal may include one or more (only one is shown in Figure 1) processors 102 (processors 102 may include but not limited to processing devices such as microprocessor MCU or programmable logic device FPGA, etc.) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. Those skilled in the art can understand that the structure shown in FIG. 1 is only for illustration, and it does not limit the structure of the above computer terminal. For example, the computer terminal may also include more or fewer components than shown in FIG. 1 , or have a different configuration than that shown in FIG. 1 .
存储器104可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本申请实施例中的代码集成验证方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设 置的存储器,这些远程存储器可以通过网络连接至计算机终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the code integration verification method in the embodiment of the present application, and the processor 102 executes the computer program stored in the memory 104 by running the computer program. Various functional applications and data processing are to realize the above-mentioned method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory located remotely relative to the processor 102, and these remote memories may be connected to a computer terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。The transmission device 106 is used to receive or transmit data via a network. The specific example of the above-mentioned network may include a wireless network provided by the communication provider of the computer terminal. In one example, the transmission device 106 includes a network interface controller (NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet in a wireless manner.
下面对本申请实施例中涉及到如下软件持续集成术语进行简要说明。The following briefly describes the following software continuous integration terms involved in the embodiments of the present application.
变更单:软件开发人员将本地的代码更改,提交到代码托管系统,由代码托管系统生成变更记录,即变更单,例如但不限于Gerrit的change。Change order: The software developer submits the local code changes to the code hosting system, and the code hosting system generates a change record, that is, a change order, such as but not limited to Gerrit's change.
变更单信息:变更单信息包含但不限于:单向依赖信息、变更组组别信息(哈希码、组大小等)、变更信息(代码工程名、分支)等。Change order information: Change order information includes, but is not limited to: one-way dependency information, change group information (hash code, group size, etc.), change information (code project name, branch), etc.
例如,如下的一种单向变更单组别信息格式,但不局限于此格式:For example, the following one-way change order group information format, but not limited to this format:
comment:this is a commentcomment: this is a comment
depends:other-change-iddepends: other-change-id
change-id:my-change-idchange-id:my-change-id
例如,如下的一种双向变更单组别信息及变更信息格式,但不局限于此格式:For example, the following two-way change order group information and change information format, but not limited to this format:
comment:this is a commentcomment: this is a comment
goup-id:my-group-change-idgroup-id:my-group-change-id
goup-size:2goup-size: 2
change-id:my-change-idchange-id:my-change-id
单向变更单:通过单向变更单信息格式关联的一个变更单。其特征为:本变更单指明依赖其他变更单,其他变更单不依赖本变更单。所谓不依赖其他变更单,即在缺少其他变更单时,不会导致代码集成失败。One-way change order: A change order associated through the one-way change order message format. Its characteristics are: this change order indicates that it depends on other change orders, and other change orders do not depend on this change order. The so-called not relying on other change orders means that code integration will not fail in the absence of other change orders.
单向变更单组:多个相关的单向变更单,称之为单向变更单组。One-way change order group: multiple related one-way change orders, called one-way change order group.
双向变更单:通过双向变更单信息格式关联的一系列变更单。其特征为:多个变更单中的一单或多单,在缺少其他变更单时,可能导致代码集成失败。Bidirectional Change Order: A series of Change Orders linked through the Bidirectional Change Order message format. Its characteristics are: one or more of multiple change orders may cause code integration failure when other change orders are missing.
双向变更单组:多个相关的双向变更单,称之为双向变更单组Bidirectional change order group: multiple related bidirectional change orders, called bidirectional change order group
前序变更单:在有一个或多个变更单未完成时,那么未完成的变更,就称之为前序变更单。Pre-sequence change order: When one or more change orders are not completed, the unfinished change is called the previous change order.
前序变更单组:在有一个或多个变更单组未完成时,有新变更单组满足合并条件,那么未完成的变更组,就称之为前序变更单组。Pre-sequence change order group: When one or more change order groups are incomplete and a new change order group meets the merge condition, the unfinished change order group is called the previous change order group.
在本实施例中提供了一种代码集成验证方法。在单个变更单强行合入多个有依赖关系的多个变更单时,通过一种本地预合并的方法,将多个有关联的多个变更单合并为一个变更单组,保证其原子性,再进行持续集成验证,根据验证结果对同组的变更单同时集成或同时不集成。以此保证产品的持续集成可用,从而提高软件开发验证效率。In this embodiment, a code integration verification method is provided. When a single change order is forcibly merged into multiple change orders with dependencies, a local pre-merge method is used to merge multiple related change orders into a change order group to ensure its atomicity. Then conduct continuous integration verification, and integrate or not integrate the same group of change orders at the same time according to the verification results. In this way, the continuous integration of products is guaranteed to be available, thereby improving the efficiency of software development and verification.
图2是根据本申请实施例的代码集成验证方法的流程图,该方法可运用在图1所示的硬件结构中。如图2所示,该流程包括如下步骤:FIG. 2 is a flowchart of a code integration verification method according to an embodiment of the present application, and the method can be applied to the hardware structure shown in FIG. 1 . As shown in Figure 2, the process includes the following steps:
步骤S202,将从代码托管系统接收的多个具有关联关系的用于代码变更的变更单组成变 更单组;Step S202, combining multiple associated change orders received from the code hosting system for code change into a change order group;
步骤S204,根据所述多个变更单之间的依赖关系确定所述变更单组内各变更单的代码合并顺序;Step S204, determining the code merging order of each change order in the change order group according to the dependencies among the plurality of change orders;
步骤S206,按照所述代码合并顺序对所述变更单组内的各变更单分别进行代码合并;Step S206, perform code merging on each change order in the change order group according to the code merging sequence;
步骤S208,调用代码集成系统对所述变更单组合并后的代码进行集成验证。Step S208, calling the code integration system to perform integration verification on the merged code of the change order group.
在本实施例的中,所述变更单组可以为以下之一:单向变更单组、双向变更单组、前序变更单组。In this embodiment, the change order group may be one of the following: a one-way change order group, a two-way change order group, and a preceding change order group.
在本实施例的步骤S202中,将从代码托管系统接收的多个具有关联关系的变更单组成变更单组,可以包括:根据所述多个变更单的依赖信息标识查询获得具有关联关系的所述多个变更单;将所述多个变更单组成所述变更单组。In step S202 of this embodiment, combining multiple change orders with associated relationships received from the code hosting system into a change order group may include: obtaining all associated change orders according to the identification query of the dependency information of the multiple change orders the plurality of change orders; forming the plurality of change orders into the change order group.
在本实施例的步骤S202之前,还可以包括:通过所述代码托管系统接收用户提交的对所托管的代码进行变更的多个请求,并生成多个变更单以及对应的变更单信息,其中,所述变更单信息至少以下之一:单向依赖信息、变更单组组别信息、变更信息。Before step S202 of this embodiment, it may also include: receiving multiple requests for changing the hosted code submitted by the user through the code hosting system, and generating multiple change orders and corresponding change order information, wherein, The change order information is at least one of the following: one-way dependency information, change order group information, and change information.
在本实施例的步骤S204中,根据所述多个变更单之间的依赖关系确定所述变更单组内各变更单的代码合并顺序,可以包括:所述变更单组为单向变更单组,根据所述单向变更单组中各变更单的依赖顺序确定所述各变更单的代码合并顺序。In step S204 of this embodiment, determining the code merging order of each change order in the change order group according to the dependency relationship between the plurality of change orders may include: the change order group is a one-way change order group , determining the code merging sequence of each change order according to the dependency sequence of each change order in the one-way change order group.
在本实施例的步骤S206中,按照所述代码合并顺序对所述变更单组内的各变更单分别进行代码合并,可以包括:从所述代码托管系统下载所述变更单组内的各变更单对应的代码到本地,例如下载到本地的存储器或服务器;按照所述代码合并顺序,将各个变更单的代码变更与从所述代码托管系统下载的该变更单对应的代码进行合并,并打上所述变更单组的标签信息。In step S206 of this embodiment, performing code merging on each change order in the change order group according to the code merging sequence may include: downloading each change order in the change order group from the code hosting system The code corresponding to the order is downloaded locally, such as downloaded to the local storage or server; according to the code merging sequence, the code change of each change order is merged with the code corresponding to the change order downloaded from the code hosting system, and marked with Label information for the change order group.
在本实施例的步骤S208中,调用代码集成系统对所述变更单组合并后的代码进行集成验证,可以包括:将所述变更单组的标签信息传递到所述代码集成系统,以便所述代码集成系统根据所述变更单组的标签信息下载对应的代码,并进行集成验证。In step S208 of this embodiment, invoking the code integration system to perform integration verification on the merged code of the change order group may include: transferring the label information of the change order group to the code integration system, so that the The code integration system downloads the corresponding code according to the label information of the change order group, and performs integration verification.
在本实施例的步骤S208之后,还可以包括:接收所述代码集成系统反馈的所述变更单组的代码集成的验证结果;如果所述验证结果为代码集成成功,则对所述变更单组内的所有变更单反馈代码变更可集成,并完成所述变更单组的代码集成;如果所述验证结果为代码集成不成功,则对所述变更单组内的所有变更单反馈代码变更不可集成。After step S208 of this embodiment, it may also include: receiving the verification result of the code integration of the change order group fed back by the code integration system; All change order feedback code changes in the change order group can be integrated, and the code integration of the change order group is completed; if the verification result is that the code integration is unsuccessful, all change order feedback code changes in the change order group cannot be integrated .
在本实施例中,当所述变更单组包含前序变更单组时,所述方法还可包括:将正在进行验证的多个前序变更单组,与所述变更单组,合并为第一变更单组;根据所述多个前序变更单组之间的依赖关系(无依赖时,按照变更单提交时间顺序)确定所述第一变更单组内各前序变更单组的代码合并顺序;按照所述代码合并顺序对所述第一变更单组内的各前序变更单组分别进行代码合并;调用代码集成系统对所述第一变更单组合并后的代码进行集成验证。即,在实施例中,当所述变更单组存在前序变更单组时,可进一步将具有关联关系的多个前序变更单组合并为一个大的变更单组,从而以该合并后的大的变更单组为单位进行代码的验证和集成。In this embodiment, when the change order group includes a preceding change order group, the method may further include: merging multiple preceding change order groups being verified with the change order group into a first A change order group; determine the code merging of each preceding change order group in the first change order group according to the dependency relationship between the multiple preceding change order groups (if there is no dependency, follow the order of submission time of the change order) Sequence: according to the code merging sequence, perform code merging for each preceding change order group in the first change order group; call the code integration system to perform integration verification on the code after the first change order group is merged. That is, in the embodiment, when there is a previous change order group in the change order group, multiple previous change order groups with associated relationships can be further merged into one large change order group, so that the merged Code verification and integration is performed in units of large change order groups.
通过本实施例的上述步骤,将有关联的多个变更单合并为一个变更单组,保证其原子性,解决了软件代码变更的构建验证仅支持单变更验证以及在单个变更单强行合入多个有依赖关 系的多个变更单时,造成的阻塞性等待和浪费,提高了软件开发验证效率。Through the above-mentioned steps of this embodiment, multiple associated change orders are merged into one change order group to ensure its atomicity, which solves the problem that the construction verification of software code changes only supports single change verification and that multiple change orders are forcibly merged into a single change order. When there are multiple change orders with dependencies, the blocking waiting and waste are caused, which improves the efficiency of software development and verification.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product in essence or the part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to enable a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application.
在本实施例中还提供了一种代码集成验证装置,该装置用于实现上述实施例及其他实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”或“单元”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a code integration verification device is also provided, which is used to implement the above embodiments and other implementation modes, and what has been described will not be repeated. As used below, the term "module" or "unit" may be a combination of software and/or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
图3是根据本申请实施例的代码集成验证装置的结构框图,如图3所示,该装置包括组成模块10、确定模块20、合并模块30和调用模块40Fig. 3 is a structural block diagram of a code integration verification device according to an embodiment of the present application. As shown in Fig. 3 , the device includes a composition module 10, a determination module 20, a combination module 30 and a calling module 40
组成模块10,被设置成将从代码托管系统接收的具有关联关系的多个用于代码变更的变更单组成变更单组。The composition module 10 is configured to compose a plurality of change orders for code change received from the code escrow system and having an association relationship into a change order group.
确定模块20,被设置成根据所述多个变更单之间的依赖关系确定所述变更单组内各变更单的代码合并顺序。The determining module 20 is configured to determine the code merging sequence of each change order in the change order group according to the dependency relationship among the plurality of change orders.
合并模块30,被设置成按照所述代码合并顺序对所述变更单组内的各变更单分别进行代码合并。The merging module 30 is configured to perform code merging on each change order in the change order group according to the code merging sequence.
调用模块40,被设置成调用代码集成系统对所述变更单组合并后的代码进行集成验证。The calling module 40 is configured to call the code integration system to perform integration verification on the merged code of the change order group.
通过本实施例提供的代码集成验证装置,可将相关联的多个变更单合并为一个变更单组,保证其原子性,解决了软件代码变更的构建验证仅支持单变更验证以及在单个变更单强行合入多个有依赖关系的多个变更单时,造成的阻塞性等待和浪费,提高了软件开发验证效率。Through the code integration verification device provided in this embodiment, multiple associated change orders can be merged into a change order group to ensure its atomicity, which solves the problem that the construction verification of software code changes only supports single change verification and the When multiple change orders with dependencies are forcibly merged, the blocking waiting and waste caused, which improves the efficiency of software development and verification.
图4是根据本申请另一实施例的代码集成验证装置的结构框图,如图4所示,该装置除包括上述实施例中的所有模块外,在本实施例中,所述组成模块10可进一步包括查询单元11和组成单元12。Fig. 4 is a structural block diagram of a code integration verification device according to another embodiment of the present application. As shown in Fig. 4, the device includes all the modules in the above-mentioned embodiments, in this embodiment, the component module 10 can be It further includes a query unit 11 and a composition unit 12 .
查询单元11,被设置成根据所述多个变更单的依赖信息标识查询获得具有关联关系的所述多个变更单。The query unit 11 is configured to query and obtain the multiple change orders with an association relationship according to the dependency information identification query of the multiple change orders.
组成单元12,被设置成将所述多个变更单组成所述变更单组。The composition unit 12 is configured to compose the plurality of change orders into the change order group.
在本实施例中,所述合并模块20可进一步包括下载单元21和合并单元22。In this embodiment, the merging module 20 may further include a download unit 21 and a merging unit 22 .
下载单元21,被设置成从所述代码托管系统下载所述变更单组内的各变更单对应的代码到本地,例如,下载到代码集成验证装置的存储器或服务器内。The downloading unit 21 is configured to download the code corresponding to each change order in the change order group from the code escrow system to a local, for example, to a memory or a server of a code integration verification device.
合并单元22,被设置成按照所述代码合并顺序,将各个变更单的代码变更与从所述代码托管系统下载的该变更单对应的代码进行合并,并打上所述变更单组的标签信息。The merging unit 22 is configured to merge the code changes of each change order with the code corresponding to the change order downloaded from the code escrow system according to the code merging sequence, and add the tag information of the change order group.
在本实施例中,所述代码集成验证装置还可包括接收模块50、第一反馈模块60和第二反馈模块70。In this embodiment, the code integration verification device may further include a receiving module 50 , a first feedback module 60 and a second feedback module 70 .
接收模块50,被设置成接收所述代码集成系统反馈的所述变更单组的代码集成的验证结果。The receiving module 50 is configured to receive the code integration verification result of the change order group fed back by the code integration system.
第一反馈模块60,被设置成在所述验证结果为代码集成成功的情况下,对所述变更单组 内的所有变更单反馈代码变更可集成,并完成所述变更单组的代码集成。The first feedback module 60 is configured to feedback that code changes can be integrated for all change orders in the change order group when the verification result is that the code integration is successful, and complete the code integration of the change order group.
第二反馈模块70,被设置成在所述验证结果为代码集成不成功,对所述变更单组内的所有变更单反馈代码变更不可集成。The second feedback module 70 is configured to, when the verification result is that the code integration is unsuccessful, feedback that the code change cannot be integrated for all change orders in the change order group.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above-mentioned modules can be realized by software or hardware. For the latter, it can be realized by the following methods, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules can be combined in any combination The forms of are located in different processors.
为了便于对本申请所提供的技术方案的理解,下面将结合具体场景的实施例进行详细描述。In order to facilitate the understanding of the technical solutions provided by the present application, the following will describe in detail in conjunction with embodiments of specific scenarios.
针对软件开发中,当存在多个变更单,尤其是多个变更单有依赖关系的场景,本实施例提供了一种代码门控系统。如图5所示,本实施例涉及的系统和模块如下:In software development, when there are multiple change orders, especially the scenario where multiple change orders have dependencies, this embodiment provides a code gating system. As shown in Figure 5, the systems and modules involved in this embodiment are as follows:
代码托管系统:用于代码托管和评审的系统,在本实施例中代码托管系统可包含但不限于:Gerrit、Gitlab等,代码托管系统用于托管用户的代码,接收用户的代码变更,并产生变更单。Code hosting system: a system for code hosting and review. In this embodiment, the code hosting system may include but not limited to: Gerrit, Gitlab, etc. The code hosting system is used to host the user's code, receive the user's code changes, and generate change order.
本实施例提供的代码门控系统200,需说明的是,本实施例中的模块功能的划分与前文中实施例中的模块划分不相同。如图5所示,本实施例中的代码门控系统200可包含调度模块201、合并模块202和执行模块203。For the code gating system 200 provided in this embodiment, it should be noted that the division of module functions in this embodiment is different from the division of modules in the foregoing embodiments. As shown in FIG. 5 , the code gating system 200 in this embodiment may include a scheduling module 201 , a combining module 202 and an executing module 203 .
调度模块201:接收上游代码托管系统100的变更信息并存储,当有多个变更单时,组合多个变更单为一个变更单组,下发给合并模块。Scheduling module 201: receives and stores the change information from the upstream code hosting system 100, and when there are multiple change orders, combines the multiple change orders into a change order group and sends it to the merge module.
合并模块202:接收调度模块201的变更单组请求,以变更单组为单位,向代码托管系统100逐个拉取变更单代码及变更信息,并进行本地合并。The merging module 202: receives the change order group request from the scheduling module 201, pulls the change order codes and change information one by one from the code hosting system 100 in units of change order groups, and performs local merging.
执行模块203:接收调度模块201的执行请求,将合并后的变更单组信息,传递到持续集成系统300。Execution module 203 : receives the execution request from the scheduling module 201 , and transmits the merged change order group information to the continuous integration system 300 .
持续集成系统300:能够获取变更单,并基于变更单进行构建验证的系统,在本实施例中持续集成系统300可包含但不限于:Jenkins、GoCD等。Continuous integration system 300: a system capable of obtaining a change order and performing build verification based on the change order. In this embodiment, the continuous integration system 300 may include but not limited to: Jenkins, GoCD, etc.
基于上述的系统,本实施例提供了一种代码集成验证方法,在本实施例中,用户在代码托管系统提交多个变更,并将多个变更单的关联信息,录入到多个变更单信息中。Based on the above system, this embodiment provides a code integration verification method. In this embodiment, the user submits multiple changes in the code hosting system, and enters the associated information of multiple change orders into the information of multiple change orders middle.
如图6所示,该方法包括如下步骤:As shown in Figure 6, the method includes the following steps:
步骤S601,提交变更。通过代码托管系统,接收一个用户的多个变更,或多个用户的多个变更,并产生多个变更单。Step S601, submitting changes. Through the code hosting system, receive multiple changes from one user, or multiple changes from multiple users, and generate multiple change orders.
步骤S602,缓存变更。调度模块实时地从代码托管系统接收到变更单,调度模块向代码托管系统,查询被依赖单的信息,具体处理方式如下:Step S602, cache modification. The scheduling module receives the change order from the code hosting system in real time, and the scheduling module queries the code hosting system for the information of the dependent order. The specific processing method is as follows:
a.对于单向变更单a. For one-way change orders
单向变更单的依赖信息标识:例如,变更信息中的依赖(depends)标识,但不限于该标识,通过此标识依赖的多个变更单,称之为单向变更单组。Dependency information identification of a one-way change order: For example, the depends (depends) identification in the change information, but not limited to this identification, and multiple change orders that depend on this identification are called a one-way change order group.
获得依赖变更单信息:根据变更单标识的被依赖变更单标识,通过查询缓存的变更单信息获得,例如,可通过代码托管系统查询得到,或查询其他变更单缓存,获得依赖信息。Obtain dependent change order information: According to the dependent change order ID identified by the change order, it can be obtained by querying the cached change order information. For example, it can be obtained by querying the code hosting system, or querying other change order caches to obtain dependency information.
获得单向变更单组:将查询到的相关单向变更单组建为单向变更单组。Obtain one-way change order group: form the queried related one-way change order into one-way change order group.
完成变更单组收集:在调度模块收到每一个变更提交事件后,按照上述方法,查询到所有依赖变更单信息。Complete the collection of change order groups: After the scheduling module receives each change submission event, follow the above method to query all dependent change order information.
b.对于双向变更单b. For two-way change orders
根据组标识和组大小,调度模块向代码托管系统收集变更单组的所有变更单信息。According to the group ID and group size, the scheduling module collects all change order information of the change order group from the code hosting system.
双向变更单的标识方式:可以但不限于通过组标识、组大小等信息进行标识。The identification method of the two-way change order: it can be, but not limited to, identified by information such as group identification and group size.
获得双向变更单信息:根据变更单标识的被依赖变更单标识,通过查询缓存的变更单信息获得,例如,可通过代码托管系统查询得到,或查询其他变更单缓存,获得依赖信息。Obtain bidirectional change order information: According to the dependent change order ID identified by the change order, it can be obtained by querying the cached change order information. For example, it can be obtained by querying the code hosting system, or querying other change order caches to obtain dependency information.
获得双向变更单组:将查询到相关双向变更单组建为双向变更单组。Obtain bidirectional change order group: convert the queried related bidirectional change order group into a bidirectional change order group.
完成双向变更单组收集:在调度模块收到每一个变更提交事件后,按照上述方法,查询到所有依赖变更单信息,其中,该双向变更单组中的双向变更单组的个数可从变更单信息的组打下的描述中获得。Completing the collection of two-way change order groups: After the scheduling module receives each change submission event, it can query all dependent change order information according to the above method, wherein the number of two-way change order groups in the two-way change order group can be changed from Obtained from the description under the group of single information.
步骤S603,确定变更单预合并顺序。Step S603, determining the pre-merging order of the change order.
在本实施例中,需先确定变更单组内顺序。调度模块在完成变更单组信息收集后,进入变更单顺序确定环节:In this embodiment, it is first necessary to determine the sequence within the change order group. After the scheduling module completes the information collection of the change order group, it enters the link of determining the order of the change order:
a.对于单向变更单组,按照依赖(depends)顺序,确定单向变更单组内各单向变更单预合并顺序。a. For a one-way change order group, determine the pre-merging order of each one-way change order in the one-way change order group according to the order of depends.
b.对于双向变更单组,无顺序要求,只要双向变更单组的所有变更单,已提交到代码托管系统即可。b. For the two-way change order group, there is no order requirement, as long as all the change orders of the two-way change order group have been submitted to the code hosting system.
在本实施例中,然后再提交变更组合并请求。即,将完整的变更单组提交到合并模块。In this embodiment, the change combination merge request is then submitted. That is, submit the complete set of change orders to the merge module.
步骤S604,合并变更单组。Step S604, merging change order groups.
在本实施例中,合并模块收到变更单组合并请求后,执行以下操作:In this embodiment, after the merging module receives the merging request of the change order group, it performs the following operations:
下载变更单代码:Download the change order code:
可根据变更单组信息和顺序,向代码托管系统下载变更单代码到本地,例如,将变更单代码下载到代码门控系统200的存储器或服务器内。According to the change order group information and sequence, the change order code can be downloaded to the code escrow system to the local, for example, the change order code can be downloaded to the storage or server of the code gating system 200 .
合并变更组代码:Merge change group code:
可通过本地提供的分布式代码管理系统合并变更组代码,可以是但不局限于git。The change group code can be merged through a distributed code management system provided locally, which can be but not limited to git.
遍历变更单组的每一个变更单:Iterate over each change order in a change order group:
首次合并的代码库:将每个变更单的代码变更与该变更单的代码托管系统中的最新代码进行合并,并打代码标签,代码标签可以但不局限于:Code base merged for the first time: Merge the code changes of each change order with the latest code in the code hosting system of the change order, and label the code. The code label can be but not limited to:
refs/service/.../denpends-idrefs/service/.../denpends-id
refs/service/.../groups-id。refs/service/.../groups-id.
在本实施例中,如果变更单之间有冲突,报告错误到调度模块,转入处理流程。步骤S605,调度变更单组。调度模块收到变更单组标签信息后,通知执行模块,调度变更组的代码集成,具体执行以下操作:In this embodiment, if there is a conflict between the change orders, an error is reported to the scheduling module, and the processing flow is transferred. Step S605, scheduling change order groups. After the scheduling module receives the label information of the change order group, it notifies the execution module to schedule the code integration of the change group, and specifically performs the following operations:
传递变更单组标签:执行模块收到变更单组标签信息后,调用代码集成系统,进行集成验证,同时将变更单组标签信息传递到代码集成系统;代码集成系统根据代码标签下载对应的代码,进行集成验证。Transfer change order group labels: After receiving the change order group label information, the execution module calls the code integration system for integration verification, and at the same time transmits the change order group label information to the code integration system; the code integration system downloads the corresponding code according to the code label, Perform integration verification.
收集变更单组代码集成结果:代码集成系统完成集成验证后,执行模块获得验证结果,传递到调度模块。Collect change order code integration results: After the code integration system completes the integration verification, the execution module obtains the verification results and transmits them to the scheduling module.
步骤S606,变更单组集成。调度模块收到代码集成结果后,做如下处理:Step S606, change order group integration. After the scheduling module receives the code integration result, it does the following:
对于代码集成成功的代码变更组:对变更单组内的所有变更单,反馈此代码变更可集成, 并完成代码自动集成。反馈方式可以是但不局限于:打对应的代码集成结果评分、自动合入变更单等方式。For code change groups with successful code integration: For all change orders in the change order group, feedback that the code change can be integrated, and complete the automatic code integration. Feedback methods can be, but are not limited to: scoring the corresponding code integration results, automatically incorporating change orders, etc.
对于代码集成失败的代码变更组:对变更单组内的所有变更单,反馈此代码变更不可集成。反馈方式可以是但不局限于:打对应的代码集成结果评分。For code change groups whose code integration fails: For all change orders in the change order group, feedback that the code change cannot be integrated. The feedback method can be but not limited to: scoring the corresponding code integration results.
下面将结合具体场景对本申请所提供的技术方案进行说明。The technical solutions provided by this application will be described below in conjunction with specific scenarios.
本申请实施例提供了针对单个代码仓库的多变更单场景的代码集成验证方法,如图7所示,本实施包括如下步骤:The embodiment of this application provides a code integration verification method for multiple change order scenarios in a single code warehouse. As shown in Figure 7, this implementation includes the following steps:
步骤S701,提交并更。在本实施例中,单个人或多个人提交的多个代码变更都是针对同一个代码仓库,变更单之间通过变更单信息,标识为单向变更单组。其余流程同上述图6所示的实施例。Step S701, submit and update. In this embodiment, multiple code changes submitted by a single person or multiple people are all aimed at the same code warehouse, and the change orders are identified as a one-way change order group through the change order information. The rest of the process is the same as the above-mentioned embodiment shown in FIG. 6 .
步骤S702,缓存变更,将所提交的多个变更组成单向变更单组。具体流程同上述所示的实施例。Step S702, cache changes, and form multiple submitted changes into a one-way change order group. The specific process is the same as the embodiment shown above.
步骤S703,确定所述单向变更单组的预合并顺序。具体流程同上述所示的实施例。Step S703, determining the pre-merging sequence of the one-way change order group. The specific process is the same as the embodiment shown above.
步骤S704,合并所述单向变更单组。如果变更单之间有冲突,报告错误到调度模块,转入处理流程。其余流程同上述所示的实施例。Step S704, merging the one-way change order groups. If there is a conflict between change orders, report the error to the scheduling module and transfer to the processing flow. The rest of the flow process is the same as the embodiment shown above.
步骤S705,调度所述单向变更单组。具体流程同上述所示的实施例。Step S705, scheduling the one-way change order group. The specific process is the same as the embodiment shown above.
步骤S706,将所述单向变更单组集成。具体流程同上述所示的实施例。Step S706, integrating the one-way change order group. The specific process is the same as the embodiment shown above.
本申请实施例还提供了针对多个代码仓库的多变更单场景的代码集成验证方法,如图8所示,本实施包括如下步骤:The embodiment of this application also provides a code integration verification method for multiple change order scenarios in multiple code warehouses, as shown in Figure 8, this implementation includes the following steps:
步骤S801,提交并更。在本实施例中,单个人或多个人提交的多个代码变更都是针对相同的多个代码仓库,变更单之间通过变更单信息,标识为双向变更单组。其余流程同图6所示的实施例。Step S801, submit and update. In this embodiment, multiple code changes submitted by a single person or multiple people are aimed at the same multiple code warehouses, and the change orders are identified as two-way change order groups through change order information. The rest of the flow process is the same as the embodiment shown in Fig. 6 .
步骤S802,缓存变更单,组成双向变更单组。具体流程同上述所示的实施例。Step S802, cache the change order, and form a two-way change order group. The specific process is the same as the embodiment shown above.
步骤S803,确定变更单组预合并顺序。具体流程同上述所示的实施例。Step S803, determining the pre-merging order of the change order group. The specific process is the same as the embodiment shown above.
步骤S804,合并变更单组。如果变更单之间有冲突,报告错误到调度模块,转入错误处理流程。其余流程同上述所示的实施例。Step S804, merging change order groups. If there is a conflict between change orders, report the error to the scheduling module and transfer to the error handling process. The rest of the flow process is the same as the embodiment shown above.
步骤S805,调度变更单组。具体流程同上述所示的实施例。Step S805, scheduling change order groups. The specific process is the same as the embodiment shown above.
步骤S806,将变更单组集成。具体流程同上述所示的实施例。Step S806, integrating the change orders into groups. The specific process is the same as the embodiment shown above.
本申请实施例还提供了一种针对动态调整变更单数的多个代码仓库的多变更单场景的代码集成验证方法,如图9所示,本实施包括如下步骤:The embodiment of this application also provides a code integration verification method for multiple change order scenarios in multiple code warehouses that dynamically adjust the number of change orders. As shown in Figure 9, this implementation includes the following steps:
步骤S901,提交并更。在本实施例中,单个人或多个人提交的多个代码变更都是针对同多个代码仓库,变更单之间通过变更单信息,标识为双向变更单组。当有新的变更单,需要加入到双向变更组中时,只需要在变更单信息中的标识组大小的信息做指示即可,调度模块在收到变更单信息时,取所有变更单信息中组大小最大的值作为本变更单组的大小。其余流程同图6所示的实施例。Step S901, submit and update. In this embodiment, multiple code changes submitted by a single person or multiple people are aimed at the same multiple code warehouses, and the change orders are identified as two-way change order groups through change order information. When there is a new change order that needs to be added to the two-way change group, it is only necessary to indicate the group size information in the change order information. When the scheduling module receives the change order information, it takes all the change order information The largest value of the group size is used as the group size of this change order. The rest of the flow process is the same as the embodiment shown in Fig. 6 .
步骤S902,缓存变更。具体流程同上述所示的实施例。Step S902, cache modification. The specific process is the same as the embodiment shown above.
步骤S903,确定变更单组预合并顺序。具体流程同上述所示的实施例。Step S903, determining the pre-merging order of the change order group. The specific process is the same as the embodiment shown above.
步骤S904,合并变更单组。如果变更单之间有冲突,报告错误到调度模块,转入错误处理流程。其余流程同上述所示的实施例。Step S904, merging change order groups. If there is a conflict between change orders, report the error to the scheduling module and transfer to the error handling process. The rest of the flow process is the same as the embodiment shown above.
步骤S905,调度变更单组。具体流程同上述所示的实施例。Step S905, scheduling change order groups. The specific process is the same as the embodiment shown above.
步骤S906,变更单组集成。具体流程同上述所示的实施例。Step S906, change order group integration. The specific process is the same as the embodiment shown above.
本申请实施例还提供了一种针对多个代码仓库的多变更单场景的代码集成验证方法,即针对多变更单组并行场景,如图10所示,本实施包括如下步骤:The embodiment of this application also provides a code integration verification method for multiple change order scenarios in multiple code warehouses, that is, for multiple change order group parallel scenarios, as shown in Figure 10, this implementation includes the following steps:
步骤S1001,提交并更。在本实施例中,在一个变更单组已完成代码预合并,未完成集成验证时,调度收到新的变更单组,即存在前序变更单或前序变更单组时。其余流程同上述所示的实施例。Step S1001, submit and update. In this embodiment, when a change order group has completed code pre-merging but has not completed integration verification, the scheduler receives a new change order group, that is, when there is a previous change order or a previous change order group. The rest of the flow process is the same as the embodiment shown above.
步骤S1002,缓存变更。调度模块查询到有未完成集成验证的变更单组时,将未完成的一个或多个变更单组的代码标签或变更单信息,传递到新变更单组,即存在前序变更单组或前序变更单时,其余流程同上述所示的实施例。Step S1002, cache modification. When the scheduling module inquires about a change order group that has not completed integration verification, it will transfer the code labels or change order information of one or more uncompleted change order groups to the new change order group, that is, there is a previous change order group or a previous change order group. When the order is changed, all the other processes are the same as the above-mentioned embodiment.
步骤S1003,确定变更单组预合并顺序。在本实施例中,当新变更单组,存在前序变更单组或前序变更单时,将前序变更单组作为新变更单的预合并顺序的首位,其余流程同图6所示的实施例。Step S1003, determining the pre-merging sequence of the change order. In this embodiment, when the new change order group has a previous change order group or a previous change order group, the previous change order group is taken as the first in the pre-merging order of the new change order, and the rest of the process is the same as that shown in Figure 6 Example.
步骤S1004,合并变更单组。如果变更单之间有冲突,报告错误到调度模块,转入错误处理流程。其余流程同上述所示的实施例。Step S1004, merging change order groups. If there is a conflict between change orders, report the error to the scheduling module and transfer to the error handling process. The rest of the flow process is the same as the embodiment shown above.
步骤S1005,调度变更单组。具体流程同上述所示的实施例。Step S1005, scheduling change order groups. The specific process is the same as the embodiment shown above.
步骤S1006,变更单组集成。具体流程同上述所示的实施例。Step S1006, change the single group integration. The specific process is the same as the embodiment shown above.
本申请的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。Embodiments of the present application also provide a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to perform the steps in any one of the above method embodiments when running.
在一个实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。In one embodiment, the above-mentioned computer-readable storage medium may include but not limited to: U disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), mobile Various media that can store computer programs, such as hard disks, magnetic disks, or optical disks.
本申请的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。An embodiment of the present application also provides an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps in any one of the above method embodiments.
在一个实施例中,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。In an embodiment, the electronic device may further include a transmission device and an input and output device, wherein the transmission device is connected to the processor, and the input and output device is connected to the processor.
本实施例中的具体示例可以参考上述实施例及其他实施方式中所描述的示例,本实施例在此不再赘述。For specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and other implementation manners, and details will not be repeated here in this embodiment.
通过本申请上述实施例,可将有关联的多个变更单合并为一个变更单组,保证其原子性,之后再进行持续集成的验证。从而解决了当单个变更单的强行合入有依赖关系的多个变更单有时,导致阶段性不可持续集成,造成阻塞性等待和浪费的问题,达到多个变更单同时进行变更验证的效果。Through the above-mentioned embodiments of the present application, multiple associated change orders can be combined into one change order group to ensure its atomicity, and then continuous integration verification is performed. This solves the problem that when a single change order is forcibly merged into multiple change orders with dependencies, it sometimes leads to unsustainable integration in stages, resulting in blocking waiting and waste, and achieves the effect of simultaneous change verification of multiple change orders.
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that each module or each step of the above-mentioned application can be realized by a general-purpose computing device, and they can be concentrated on a single computing device, or distributed in a network composed of multiple computing devices In fact, they can be implemented in program code executable by a computing device, and thus, they can be stored in a storage device to be executed by a computing device, and in some cases, can be executed in an order different from that shown here. Or described steps, or they are fabricated into individual integrated circuit modules, or multiple modules or steps among them are fabricated into a single integrated circuit module for implementation. As such, the present application is not limited to any specific combination of hardware and software.
以上所述仅为本申请的一些实施例而已,并不用于限制本申请,对于本领域的技术人员 来说,本申请可以有各种更改和变化。凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only some embodiments of the present application, and are not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the principles of this application shall be included within the scope of protection of this application.

Claims (15)

  1. 一种代码集成验证方法,包括:A code integration verification method comprising:
    将从代码托管系统接收的多个具有关联关系的用于代码变更的变更单组成变更单组;Combine multiple associated change orders received from the code hosting system for code changes into a change order group;
    根据所述多个变更单之间的依赖关系确定所述变更单组内各变更单的代码合并顺序;determining the code merging sequence of each change order in the change order group according to the dependency relationship among the plurality of change orders;
    按照所述代码合并顺序对所述变更单组内的各变更单分别进行代码合并;Perform code merging for each change order in the change order group according to the code merging sequence;
    调用代码集成系统对所述变更单组合并后的代码进行集成验证。Invoke the code integration system to perform integration verification on the merged code of the change order group.
  2. 根据权利要求1所述的方法,其中,所述变更单组为以下之一:单向变更单组、双向变更单组、前序变更单组。The method according to claim 1, wherein the change order group is one of the following: a one-way change order group, a two-way change order group, and a preceding change order group.
  3. 根据权利要求1所述的方法,其中,将从代码托管系统接收的多个具有关联关系的变更单组成变更单组包括:The method according to claim 1, wherein forming a plurality of change orders received from the code hosting system with associated relationships into a change order group comprises:
    根据所述多个变更单的依赖信息标识查询获得具有关联关系的所述多个变更单;Obtaining the plurality of change orders with an association relationship according to the dependency information identification query of the plurality of change orders;
    将所述多个变更单组成所述变更单组。Composing the plurality of change orders into the change order group.
  4. 根据权利要求1所述的方法,其中,将从代码托管系统接收的多个具有关联关系的变更单组成变更单组之前,还包括:The method according to claim 1, wherein, before composing a plurality of change orders with associated relationships received from the code hosting system into a change order group, further comprising:
    通过所述代码托管系统接收用户提交的对所托管的代码进行变更的多个请求,并生成多个变更单以及对应的变更单信息,其中,所述变更单信息至少以下之一:单向依赖信息、变更单组组别信息、变更信息。Multiple requests for changes to the hosted code submitted by users are received through the code hosting system, and multiple change orders and corresponding change order information are generated, wherein the change order information is at least one of the following: one-way dependency information, change order group information, change information.
  5. 根据权利要求2所述的方法,其中,根据所述多个变更单之间的依赖关系确定所述变更单组内各变更单的代码合并顺序,包括:The method according to claim 2, wherein determining the code merging order of each change order in the change order group according to the dependency relationship among the plurality of change orders comprises:
    所述变更单组为单向变更单组,根据所述单向变更单组中各变更单的依赖顺序确定所述各变更单的代码合并顺序。The change order group is a one-way change order group, and the code merging sequence of each change order is determined according to the dependency sequence of each change order in the one-way change order group.
  6. 根据权利要求1所述的方法,其中,按照所述代码合并顺序对所述变更单组内的各变更单分别进行代码合并,包括:The method according to claim 1, wherein code merging is performed on each change order in the change order group according to the code merging sequence, including:
    从所述代码托管系统下载所述变更单组内的各变更单对应的代码到本地;Download the code corresponding to each change order in the change order group from the code hosting system to the local;
    按照所述代码合并顺序,将各个变更单的代码变更与从所述代码托管系统下载的该变更单对应的代码进行合并,并打上所述变更单组的标签信息。According to the code merging sequence, the code change of each change order is merged with the code corresponding to the change order downloaded from the code escrow system, and the label information of the change order group is marked.
  7. 根据权利要求6所述的方法,其中,调用代码集成系统对所述变更单组合并后的代码进行集成验证,包括:The method according to claim 6, wherein calling the code integration system to perform integration verification on the code after the change order group is merged includes:
    将所述变更单组的标签信息传递到所述代码集成系统,以便所述代码集成系统根据所述变更单组的标签信息下载对应的代码,并进行集成验证。The label information of the change order group is transmitted to the code integration system, so that the code integration system downloads the corresponding code according to the label information of the change order group, and performs integration verification.
  8. 根据权利要求7所述的方法,其中,调用代码集成系统对所述变更单组合并后的代码进行集成验证之后,还包括:The method according to claim 7, wherein, after invoking the code integration system to perform integration verification on the code after the change order group is merged, further comprising:
    接收所述代码集成系统反馈的所述变更单组的代码集成的验证结果;receiving the code integration verification result of the change order group fed back by the code integration system;
    如果所述验证结果为代码集成成功,则对所述变更单组内的所有变更单反馈代码变更可 集成,并完成所述变更单组的代码集成;If the verification result shows that the code integration is successful, feedback code changes for all change orders in the change order group can be integrated, and complete the code integration of the change order group;
    如果所述验证结果为代码集成不成功,则对所述变更单组内的所有变更单反馈代码变更不可集成。If the verification result is that the code integration is unsuccessful, all change orders in the change order group are fed back that the code changes cannot be integrated.
  9. 根据权利要求2所述的方法,其中,当所述变更单组存在未完成集成验证的前序变更单和/或前序变更单组时,所述方法还包括:The method according to claim 2, wherein, when there is a previous change order and/or a group of previous change orders that have not completed integration verification in the change order group, the method further comprises:
    将所述前序变更单和/或所述前序变更单组与所述变更单组组合为第一变更单组;combining the preceding change order and/or the set of preceding change orders with the set of change orders into a first set of change orders;
    对于所述第一变更单组组内,有依赖关系的变更单,按照依赖关系确定合并顺序,对于无依赖关系的变更单,根据提交顺序确定合并顺序;For the change orders with dependencies in the first change order group, determine the merge order according to the dependencies, and determine the merge order according to the submission order for the change orders without dependencies;
    按照所述合并顺序对所述第一变更单组内的各变更单进行代码合并;Perform code merging of each change order in the first change order group according to the merging sequence;
    调用代码集成系统对所述第一变更单组合并后的代码进行集成验证。The code integration system is invoked to perform integration verification on the merged code of the first change order group.
  10. 一种代码集成验证装置,包括:A code integration verification device, comprising:
    组成模块,被设置成将从代码托管系统接收的具有关联关系的多个用于代码变更的变更单组成变更单组;A composition module, configured to compose a plurality of change orders for code change received from the code hosting system with an associated relationship into a change order group;
    确定模块,被设置成根据所述多个变更单之间的依赖关系确定所述变更单组内各变更单的代码合并顺序;The determination module is configured to determine the code merging sequence of each change order in the change order group according to the dependency relationship among the plurality of change orders;
    合并模块,被设置成按照所述代码合并顺序对所述变更单组内的各变更单分别进行代码合并;The merging module is configured to perform code merging on each change order in the change order group according to the code merging sequence;
    调用模块,被设置成调用代码集成系统对所述变更单组合并后的代码进行集成验证。The calling module is configured to call the code integration system to perform integration verification on the code after the change order group is merged.
  11. 根据权利要求10所述的装置,其中,所述组成模块包括:The apparatus according to claim 10, wherein said constituent modules comprise:
    查询单元,被设置成根据所述多个变更单的依赖信息标识查询获得具有关联关系的所述多个变更单;The query unit is configured to query and obtain the multiple change orders with an association relationship according to the identification of the dependency information of the multiple change orders;
    组成单元,被设置成将所述多个变更单组成所述变更单组。A composing unit configured to compose the plurality of change orders into the change order group.
  12. 根据权利要求10所述的装置,其中,所述合并模块包括:The apparatus according to claim 10, wherein the merging module comprises:
    下载单元,被设置成从所述代码托管系统下载所述变更单组内的各变更单对应的代码到本地;The download unit is configured to download the code corresponding to each change order in the change order group from the code hosting system to the local;
    合并单元,被设置成按照所述代码合并顺序,将各个变更单的代码变更与从所述代码托管系统下载的该变更单对应的代码进行合并,并打上所述变更单组的标签信息。The merging unit is configured to merge the code changes of each change order with the code corresponding to the change order downloaded from the code escrow system according to the code merging sequence, and add the label information of the change order group.
  13. 根据权利要求10所述的装置,还包括:The apparatus of claim 10, further comprising:
    接收模块,被设置成接收所述代码集成系统反馈的所述变更单组的代码集成的验证结果;The receiving module is configured to receive the code integration verification result of the change order group fed back by the code integration system;
    第一反馈模块,被设置成在所述验证结果为代码集成成功的情况下,对所述变更单组内的所有变更单反馈代码变更可集成,并完成所述变更单组的代码集成;The first feedback module is configured to, when the verification result indicates that the code integration is successful, feedback that code changes can be integrated for all change orders in the change order group, and complete the code integration of the change order group;
    第二反馈模块,被设置成在所述验证结果为代码集成不成功,对所述变更单组内的所有变更单反馈代码变更不可集成。The second feedback module is configured to feedback that code changes cannot be integrated for all change orders in the change order group when the verification result is code integration failure.
  14. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现所述权利要求1至9任一项中所述的方法的步骤。A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 9 are realized.
  15. 一种电子装置,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上 运行的计算机程序,其中,所述处理器执行所述计算机程序时实现所述权利要求1至9任一项中所述的方法的步骤。An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements claims 1 to 9 when executing the computer program The step of the method described in any one.
PCT/CN2021/135869 2021-06-30 2021-12-06 Code integrated verification method and device WO2023273164A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110743930.6 2021-06-30
CN202110743930.6A CN115543277A (en) 2021-06-30 2021-06-30 Code integration verification method and device

Publications (1)

Publication Number Publication Date
WO2023273164A1 true WO2023273164A1 (en) 2023-01-05

Family

ID=84691022

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/135869 WO2023273164A1 (en) 2021-06-30 2021-12-06 Code integrated verification method and device

Country Status (2)

Country Link
CN (1) CN115543277A (en)
WO (1) WO2023273164A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150067647A1 (en) * 2013-08-29 2015-03-05 International Business Machines Corporation Testing of combined code changesets in a software product
US20170123963A1 (en) * 2015-11-04 2017-05-04 Sap Portals Israel Ltd. Source code change resolver
CN106843820A (en) * 2015-12-04 2017-06-13 阿里巴巴集团控股有限公司 Code process method and apparatus
CN107085555A (en) * 2017-04-19 2017-08-22 广州视源电子科技股份有限公司 Code test method, device, terminal and storage medium
CN108073501A (en) * 2016-11-14 2018-05-25 阿里巴巴集团控股有限公司 A kind of code conflicts detection method and equipment
CN110780897A (en) * 2019-08-26 2020-02-11 华为技术有限公司 Code changing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150067647A1 (en) * 2013-08-29 2015-03-05 International Business Machines Corporation Testing of combined code changesets in a software product
US20170123963A1 (en) * 2015-11-04 2017-05-04 Sap Portals Israel Ltd. Source code change resolver
CN106843820A (en) * 2015-12-04 2017-06-13 阿里巴巴集团控股有限公司 Code process method and apparatus
CN108073501A (en) * 2016-11-14 2018-05-25 阿里巴巴集团控股有限公司 A kind of code conflicts detection method and equipment
CN107085555A (en) * 2017-04-19 2017-08-22 广州视源电子科技股份有限公司 Code test method, device, terminal and storage medium
CN110780897A (en) * 2019-08-26 2020-02-11 华为技术有限公司 Code changing method and device

Also Published As

Publication number Publication date
CN115543277A (en) 2022-12-30

Similar Documents

Publication Publication Date Title
US10776171B2 (en) Endpoint management system and virtual compute system
CN105593817B (en) Method and system for flexible node composition on local or distributed computer system
CN112000348A (en) Control method and device for service gray release and computer equipment
US9852220B1 (en) Distributed workflow management system
CN109460841B (en) User account opening method, system and storage medium
KR20140047580A (en) Method and system for synchronization mechanism on multi-server reservation system
CN108984567B (en) Service data management system and method
CN110673933A (en) ZooKeeper-based distributed asynchronous queue implementation method, device, equipment and medium
CN111598650A (en) Resource request transaction method based on block chain network and related device
CN113448837A (en) Development and test environment deployment method, system, electronic device, and medium
CN111258723A (en) Transaction processing method, device, system, medium and equipment of distributed system
CN107797849B (en) Method, device and system for distributed transaction processing
CN111031135A (en) Message transmission method and device and electronic equipment
US20210149709A1 (en) Method and apparatus for processing transaction
WO2023273164A1 (en) Code integrated verification method and device
CN104735134B (en) A kind of method and apparatus serviced for providing calculating
CN111597200A (en) Data processing method, device and storage medium
CN113032477B (en) Long-distance data synchronization method and device based on GTID and computing equipment
CN111367634A (en) Information processing method, information processing device and terminal equipment
CN111061576A (en) Method and system for creating entity object
CN110677497A (en) Network medium distribution method and device
CN110321250B (en) Disaster recovery method and device for application
PETRESCU Leader Election in a Cluster using Zookeeper
CN117354321A (en) Service data mirroring method and device, storage medium and electronic device
CN117273177A (en) Service processing method, device, electronic equipment and computer readable medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21948090

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE