Code review method and device, equipment and medium
By determining the call of the target element in the target code during the code merge request and sending a review request to the associated audit user, the problem of difficulty in reviewing specific code elements in the existing technology is solved, and effective review of specific code elements and pre-merge is achieved. Verification of the call method.
Patent Information
- Application Number
- CN202310546601.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2024-11-22
AI Technical Summary
The existing code review solution is difficult to perform code review for users of specific code elements, and cannot meet the requirements for re-examination of calling methods of specific code elements.
After receiving the merge request for the target code, determine the call of the target element in the target code, and send a code review request to the audit user associated with the target element, determine the call of the target element through the abstract syntax tree, and quickly associate the audit with preset annotations user.
The code review of specific code elements is implemented, so that the development user or maintenance user can review the calling method of specific code elements, thereby ensuring that the calling method when code merges is in line with the predetermined method.
Smart Images

Figure CN119003316A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the technical field of code analysis and code review, and in particular to a code review method, apparatus, device and medium. Background Art
[0002] The existing code review solution usually involves designating a reviewer to review the code in the code file or code directory after the user submits the code, so as to find possible coding problems before the code is merged into the code repository. However, in some software production scenarios, for example, for developers of specific code elements, the above code review solution at the code file and code directory level makes it difficult for these developers to review the calls of specific code elements.
[0003] Therefore, a new code review method is needed. Summary of the invention
[0004] The embodiments of the present disclosure describe a code review method, apparatus, device, and medium.
[0005] According to a first aspect, a code review method is provided, comprising:
[0006] In response to a merge request for a target code, determining a call to a target element in the target code;
[0007] According to the call to the target element, a code review request is sent to a review user associated with the target element.
[0008] According to a second aspect, a code review device is provided, comprising:
[0009] A response unit configured to, in response to a merge request for a target code, determine a call to a target element in the target code;
[0010] The review unit is configured to send a code review request to a review user associated with the target element according to the call to the target element.
[0011] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method described in the first aspect.
[0012] According to a fourth aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described in the first aspect is implemented.
[0013] According to an embodiment of the present disclosure, a code review method, apparatus, device and medium are provided. The call to the target element in the target code can be determined by responding to a merge request for the target code. Then, based on the call to the target element, a code review request is sent to the audit user associated with the target element. Using any one of the above methods, apparatuses, storage media and electronic devices, a code review request can be sent for a specific code element, so that, for example, a development user or maintenance user of the specific code element can perform a code review on the calling method of the specific code element. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 A schematic diagram of a code review scheme is shown;
[0015] Figure 2 A schematic diagram of a code review method according to an embodiment of the present disclosure is shown;
[0016] Figure 3 A schematic diagram of a code review method according to an embodiment of the present disclosure is shown;
[0017] Figure 4 A schematic diagram showing conversion of code into an abstract syntax tree according to an embodiment of the present disclosure is shown;
[0018] Figure 5 A schematic diagram showing whether to merge codes according to an embodiment of the present disclosure is shown;
[0019] Figure 6 A schematic block diagram of a code review device according to another embodiment of the present disclosure is shown;
[0020] Figure 7 A schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present disclosure is shown;
[0021] Figure 8 A schematic diagram of the structure of a storage medium suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0022] The technical solution provided in this specification is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant inventions, rather than to limit the inventions. It should also be noted that, for ease of description, only the parts related to the relevant inventions are shown in the accompanying drawings. It should be noted that, in the absence of conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other.
[0023] In the description of the implementations of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one / kind of implementation" or "the implementation" should be understood as "at least one / kind of implementation". The term "some implementations" should be understood as "at least some implementations". Other explicit and implicit definitions may also be included below.
[0024] Code review is to find coding problems in the code by designating a reviewer (Reviewer, or reviewer) to check whether the submitted code meets the coding standards. Existing code review solutions usually designate a reviewer (Reviewer) to review the code in the code file or code directory after the requesting user submits a merge request for the code, so as to find possible coding problems before the code is merged into the target code branch (such as the trunk branch). A merge request, also known as a branch merge request (Merge Request, MR, or PullRequest), means that the development user can merge the developed code into the code branch he wants to save by requesting a merge. Furthermore, the reviewer (i.e., Reviewer) can perform code review on the code that the development user requests to merge. Figure 1 A schematic diagram of a code review scheme is shown. Figure 1 As shown, for example, if a code development user (requesting user) wants to merge the code he developed into the target code branch, he can submit a code merge request and specify a review user (for example, a mentor user, a supervisor user, or other member of the requesting user's team) to review the code he submitted. After the code review user reviews the submitted code or code changes (code files / code directories), the code can be merged into the code repository or rejected based on the review results.
[0025] However, in some software production scenarios, for example, for users who develop specific code elements, the above-mentioned code review solutions at the code file and code directory levels are often difficult to meet the code review needs of these development users for specific code elements. Specifically, for example, when these development users do not want these specific code elements to be called in a non-predetermined calling manner, and then hope to review the way these specific code elements are called in the code. However, since they are only responsible for the development of specific code elements, rather than the code files or code directories corresponding to the submitted code. Therefore, the existing code review solutions at the code file and code directory levels usually do not assign review requests corresponding to code files or code directories to these development users. Therefore, the existing code review solutions at the code file and code directory levels make it difficult for these development users to conduct code reviews on, for example, the calling methods of specific code elements.
[0026] In order to solve the above technical problems, the embodiments of the present disclosure provide a code review method. In some embodiments, after receiving a merge request for a target code, the call to the target element in the target code can be determined; then, based on the call to the target element, a code review request is sent to the review user associated with the target element. Figure 2 FIG. 1 is a schematic diagram showing a code review method according to an embodiment of the present disclosure. Figure 2 As shown, for example, after receiving a code merge request submitted by a code development user (requesting user), the call to the target element can be determined from the target code submitted by the requesting user, and the audit user associated with the target element can be requested to review. After the associated user of the target element reviews the call to the target element, the code can be merged into the target code branch (e.g., the main branch) or refused to be merged into the target code branch, based on the review result. The advantage of this method is that the call to a specific code element (target element) can be determined from the target code. Then, based on the call to the target element, the audit user associated with the specific code element (e.g., the development user or the maintenance user) is requested to review. Thus, the development user or the maintenance user of the specific code element, for example, can conduct a code review on the calling method of these specific code elements.
[0027] The detailed process of this method is further described below.
[0028] Figure 3 FIG. 1 is a flow chart of a code review method according to an embodiment of the present disclosure. Figure 3 As shown, the method comprises at least the following steps:
[0029] Step S301, in response to a merge request for a target code, determining a call to a target element in the target code;
[0030] Step S303: according to the call to the target element, a code review request is sent to the review user associated with the target element.
[0031] First, in step S301, in response to a merge request for the target code, a call to a target element in the target code is determined. In this step, after receiving the merge request for the target code, the call to the target element can be determined from the target code. In different embodiments, the target code can be program code for different software products or applications, or program code for different specific purposes. In one example, for example, it is program source code. In different embodiments, the target code can also be program code written in different programming languages, which is not limited in this specification.
[0032] The target element may be a code element in the target code. In different embodiments, the target element may be different specific code elements. In one embodiment, the target element may include one or more of a class, a function, a property, an operator, an expression, a statement, a clause, and a reference package. In order to facilitate determining the call to the target element in the target code, in one embodiment, the target code may be converted into an abstract syntax tree, and the call to the target element in the target code may be determined based on the abstract syntax tree.
[0033] Abstract Syntax Tree (AST), or simply Syntax Tree, is an abstract representation of the grammatical structure of the source code. It represents the grammatical structure of the programming language in a tree-like form, and each node on the tree represents a structural element in the source code, such as a function, a variable, an expression, etc. Therefore, in a specific embodiment, the call to the target element in the target code can be determined based on the node corresponding to the target element in the abstract syntax tree. In addition, as described above, the coding language of the target code in different embodiments may be different. Therefore, in different embodiments, the abstract syntax tree obtained by conversion may be an abstract syntax tree corresponding to different coding languages, and this specification does not limit this. Figure 4 FIG. 1 is a schematic diagram showing the conversion of code into an abstract syntax tree according to an embodiment of the present disclosure. Specifically, Figure 4 The target code shown in (a) includes, for example, the following code elements: class Cat, fun meow() function, if statement / expression, conditional expression and its left and right expressions, then clause, println() function, etc. Figure 4 The code shown in (a) is converted into Figure 4(b) is an abstract syntax tree shown. Among them, each code element can be represented by a corresponding node, the edges between each node represent the nested relationship between them, and each node and the edges between them constitute the entire abstract syntax tree. As a structured abstract representation of the target code, the abstract syntax tree can be used to easily determine whether there is a call to the target element in the target code. For example, in one example, if the target element is a println() function, it can be conveniently determined whether the target element is called in the target code by traversing the abstract syntax tree and whether there is a node corresponding to the println() function in the abstract syntax tree. In different specific embodiments, the specific algorithm for traversing the abstract syntax tree to determine the node corresponding to the target element may be different, and this specification does not limit this.
[0034] As mentioned above, in different embodiments, the target element may be a different specific code element. In one embodiment, the target element may also have a preset annotation. Annotation is a special mark in the code. Annotations can be used to embed supplementary information in the source code without changing the original code and logic. As mentioned above, in different embodiments, the target code may be based on different programming languages. Therefore, in different embodiments, the preset annotation may be a user-defined annotation based on the language specifications of different specific programming languages, used to indicate that a code review is to be performed on the target element. For example, in one embodiment, a preset annotation (e.g., "@ShouldReview") may be pre-added before a code element (e.g., fun sample) to indicate that the code element is a target element. In the above manner, the target element may be quickly determined, for example, based on a code node including a preset annotation subnode in an abstract syntax tree.
[0035] Then, in step S303, according to the call to the target element, a code review request is sent to the review user associated with the target element. In this step, a code review request can be sent to the review user associated with the target element according to the call to the target element determined in step S301. In different embodiments, the review users associated with the target element may be different. In one embodiment, the review users associated with the target element may include: the development user of the target element or the maintenance user of the target element. In the above embodiment of adding preset annotations to code elements, the identifier or contact information of the associated user of the target element (for example, "xxx@xcompany.com") can also be added to the parameters of the preset identifier (for example, "@ShouldReview("xxx@xcompany.com")"). In the above manner, the target element can be conveniently associated with its, for example, development user or maintenance user in advance.
[0036] Thereafter, the audit user associated with the target element may review the calling method of the target element in the target code. In a specific embodiment, the code review result of the audit user for the calling method of the target element may include a review pass or a review fail. A review pass may, for example, indicate that the calling of the target element complies with the predetermined calling method, and a review fail may, for example, indicate that the calling of the target element does not comply with the predetermined calling method.
[0037] As described above, in different embodiments, the target element may be a different specific code element. In different embodiments, the predetermined calling method corresponding to the target element may also be different. For example Figure 4 In the illustrated embodiment, the predetermined calling mode corresponding to println() may be, for example, calling the println() function according to a predetermined output format.
[0038] In one embodiment, after receiving the code review result of the audit user, it can be determined whether to merge the target code into the target code branch according to the code review result. A code branch is a copy of the software code. Through the code branch, the "working code in progress" of different development users can be separated from, for example, the tested stable code, thereby helping different development users of the software development team to work in parallel. Usually, code branches can be managed through a version control system (Version Control System, VCS), such as the creation, merging or deletion of code branches. In different embodiments, different version control systems can be used, and this specification does not limit this. In one embodiment, if the code review result is that the review is passed, the target code can be merged into the target code branch; if the code review result is that the review is not passed, the target code can be refused to be merged into the target code branch. In different specific embodiments, the target code branch can be a different specific code branch. In a specific embodiment, the target code branch can be the main code branch (or trunk branch, baseline) in the version control system. Figure 5 FIG. 2 shows a schematic diagram of determining whether to merge codes according to an embodiment of the present disclosure. Figure 5 As shown, after the review user (e.g., development user or maintenance user) associated with the code element reviews the calling method of the code element, for example. For example, when the review result is that the review is passed, the target code can be merged into, for example, the main code branch. For example, when the review result is that the review is not passed, or the target code is refused to be merged into, for example, the main code branch. Through the above method, the calling method of the target element in the code merged into the target code branch can be made to conform to the predetermined method of the development user or maintenance user of the target element. .
[0039] In different embodiments, there may be multiple target elements in the target code. Therefore, in step S301, the calls to multiple target elements in the target code can be determined. And in step S303, a code review request is sent to multiple audit users associated with the multiple target elements. Thereafter, after receiving multiple code review results from the audit user. According to the multiple code review results, determine whether to merge the target code into the target code branch. In a specific embodiment, if the multiple code review results are all reviewed through, the target code is merged into the target code branch; if at least one of the multiple code review results is not reviewed, the target code is refused to be merged into the target code branch. Through the above method, the development users or maintenance users of different target elements in the target code can conduct code review on the calling methods of different target elements. And, the calling methods for different target elements in the code merged into the target code branch meet the predetermined methods of the development users or maintenance users of different target elements.
[0040] The embodiment of the present disclosure also provides a code generating device. Figure 6 A schematic block diagram of a code generation device according to an embodiment of the present disclosure is shown. The device is used to perform the following Figure 3 The method shown, such as Figure 6 As shown, the device 600 includes:
[0041] A response unit 601 is configured to, in response to a merge request for a target code, determine a call to a target element in the target code;
[0042] The review unit 602 is configured to send a code review request to a review user associated with the target element according to the call to the target element.
[0043] The present disclosure also provides an electronic device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the following is achieved: Figure 3 , Figure 4 The method shown.
[0044] You can also refer to the following Figure 7 , which shows a structural schematic diagram of an electronic device 800 suitable for implementing an embodiment of the present application. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0045] like Figure 7As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701. The above-mentioned processing device 701 may be a general-purpose processor, a digital signal processor (Digital Signal Processing, DSP), a microprocessor or a microcontroller, and may further include an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage device 708 to the random access memory (RAM) 703. In RAM703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, ROM702 and RAM703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0046] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 7 Each block shown in the figure may represent one device, or may represent multiple devices as required.
[0047] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the code review method provided in the embodiment of the present application are executed.
[0048] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed in a computer, the computer is caused to execute the following steps provided in the present disclosure: Figure 1 The code review method shown in . Figure 8 A schematic diagram of a storage medium for implementing an embodiment of the present application. Figure 8 As shown, the storage medium 800 may be a non-transitory computer-readable storage medium for storing non-transitory computer-executable instructions 801. When the non-transitory computer-executable instructions 801 are executed by the processor, the code review method provided in the embodiment of the present application may be implemented. For example, when the non-transitory computer-executable instructions 801 are executed by the processor, one or more steps in the code review method provided in the embodiment of the present application may be executed. For example, the storage medium 800 may be applied to the above-mentioned electronic device. For example, the storage medium 800 may include a memory in the electronic device. For the description of the storage medium 800, reference may be made to the description of the memory in the embodiment of the electronic device, and the repeated parts will not be repeated. The specific functions and technical effects of the storage medium 800 may refer to the description of the code review method provided in the embodiment of the present application, and will not be repeated here.
[0049] It should be noted that the computer-readable medium described in the embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a memory card of a smart phone, a storage component of a tablet computer, a portable computer disk, a hard disk of a personal computer, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In an embodiment of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0050] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the server, the electronic device implements the code review method provided in the embodiment of the present application.
[0051] Computer program code for performing the operations of the disclosed embodiments may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0052] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions. The units involved in the embodiments described in the present disclosure can be implemented by software or by hardware. Among them, the name of the unit does not constitute a limitation on the unit itself under certain circumstances. The functions described above in this article can be performed at least in part by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0053] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the storage medium and computing device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0054] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned public concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) to form a technical solution. In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Certain features described in the context of a single embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination.
[0055] The specific implementation methods described above further describe in detail the purpose, technical solutions and beneficial effects of the embodiments of the present invention. Although the subject matter has been described in a language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. It should be understood that the above is only a specific implementation method of the embodiments of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A code review method, comprising: In response to a merge request for a target code, determining a call to a target element in the target code; According to the call to the target element, a code review request is sent to a review user associated with the target element.
2. The method according to claim 1, wherein: The target element includes one or more of a class, a function, a property, an operator, an expression, a statement, a clause, and a reference package.
3. The method according to claim 1, wherein: Identify calls to the target element in the target code, including: The target code is converted into an abstract syntax tree, and a call to a target element in the target code is determined based on the abstract syntax tree.
4. The method according to claim 3, wherein: Determining a call to a target element in a target code based on the abstract syntax tree includes: According to the node corresponding to the target element in the abstract syntax tree, the call to the target element in the target code is determined.
5. The method according to claim 1, wherein: The review user associated with the target element includes: a development user of the target element or a maintenance user of the target element.
6. The method according to claim 1, wherein: The target element has a corresponding preset annotation.
7. The method according to claim 1, further comprising: Receive the code review result of the auditing user, and determine whether to merge the target code into the target code branch based on the code review result.
8. The method according to claim 7, wherein: The code review result includes review passed or review failed; The step of determining whether to merge the target code into the target code branch according to the code review result of the auditing user includes: If the code review result is passed, the target code is merged into the target code branch; If the code review result is that the review fails, the target code will be refused to be merged into the target code branch.
9. The method according to claim 7, wherein: Determining the call to the target element in the target code includes: determining the call to multiple target elements in the target code; Sending a code review request to the review user associated with the target element, including: sending a code review request to multiple review users associated with the multiple target elements; Receiving the code review result of the audit user, and determining whether to merge the target code into the target code branch according to the code review result, including: Receive multiple code review results from the auditing user, and determine whether to merge the target code into a target code branch based on the multiple code review results.
10. The method according to claim 9, wherein: Determining whether to merge the target code into the target code branch according to the multiple code review results includes: If the multiple code review results are all reviewed and passed, merging the target code into the target code branch; If at least one of the multiple code review results is a review failure, merging the target code into the target code branch is rejected.
11. A code review device, comprising: A response unit configured to, in response to a merge request for a target code, determine a call to a target element in the target code; The review unit is configured to send a code review request to a review user associated with the target element according to the call to the target element.
12. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 8.
13. An electronic device comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 8 is implemented.
