Method and device for submitting code

By merging and compiling test code in the local code repository and promptly sending review notifications to reviewers after approval, the problem of code review tools failing to provide timely notifications has been solved, thus improving code submission efficiency and reducing merge conflicts.

CN119271536APending Publication Date: 2025-01-07SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411375408.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

In existing technologies, code review tools cannot promptly notify reviewers to merge and revise code, resulting in inefficiency for developers when submitting code to remote code repositories and the potential for merge conflicts.

Method used

The target code is obtained from the code review tool, merged into the local code tree, and compiled and tested. If it passes, the revision verification mark is marked as certified and the daemon process is invoked to send a review prompt message to the reviewer for timely review.

Benefits of technology

It improves the efficiency of developers submitting code to remote code repositories, reduces merge conflicts, and enhances the efficiency of developer operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271536A_ABST
    Figure CN119271536A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a method for submitting a code, and the method comprises the steps: obtaining a target code corresponding to a code auditing task in a code auditing tool; combining the target code into a code tree of a local code warehouse to obtain a target code tree; compiling and testing the target code tree to obtain a compiling and testing result; when the compiling test result indicates that the compiling test is passed and the target branch of combining and revising the target code to the local code warehouse by using the code review tool is passed, revision identification of the target code in the revised code review tool is authentication passing; and calling the daemon process to execute the following steps: when it is monitored that the verification identifier of the target code in the code review tool is authentication passing, sending prompt information of logging in the code review tool to review the target code to a reviewer. According to the invention, the submission efficiency of a developer in submitting the target code to the remote code warehouse is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method and device for submitting code. Background Art

[0002] In the related art, code review tools allow developers to conduct peer reviews before submitting target code (including new code or modified code) to the remote code repository of the distributed version control system. Through this model, team members can check the quality, functionality and correctness of the submitted target code before the code is merged, thereby improving the overall project quality.

[0003] Currently, code review tools and code developers are usually in the local area network of the company's intranet. Code developers submit target codes to code review tools. However, since code review tools cannot access the external network, after the target code is merged and revised with the code tree in the local code repository, the reviewer cannot be notified, so the target code cannot be reviewed and merged into the remote code repository in time.

[0004] When multiple developers have submitted target codes based on the code in the remote code repository, since multiple developers may have modified the same part of the content in the same code file and the modified values ​​are inconsistent, it is easy to cause conflicts when the target code is merged and revised locally and then merged and revised into the remote code repository. The developer needs to modify the target code and update the local code tree and the target branch in the local code repository before resubmitting it, which reduces the developer's efficiency in submitting the target code to the remote code repository. Summary of the invention

[0005] In view of this, the present disclosure provides a method and apparatus for submitting code to solve the problem of low submission efficiency of developers when submitting target code to a remote code repository.

[0006] In a first aspect, the present disclosure provides a method for submitting code, the method comprising: obtaining a target code corresponding to a code review task in a code review tool; merging the target code into a code tree in a local code repository to obtain a target code tree; performing a compile test on the target code tree to obtain a compile test result; when the compile test result indicates that the compile test has passed and the code review tool is used to merge and revise the target code into a target branch of the local code repository, revising the revision mark of the target code in the code review tool to pass the authentication; calling a daemon process to perform the following steps: when it is monitored that the verification mark of the target code in the code review tool is passed, sending a prompt message to the reviewer to log in to the code review tool to review the target code.

[0007] In a second aspect, the present disclosure provides a device for submitting code, the device comprising: a code acquisition module, used to acquire the target code corresponding to the code review task in the code review tool; a code merging module, used to merge the target code into the local code tree to obtain the target code tree; a compilation test module, used to perform compilation test on the target code tree to obtain compilation test results; an identification revision module, used to revise the revision identification of the target code in the code review tool to be certified passed when the compilation test result indicates that the compilation test has passed and the target code has been merged and revised into the target branch of the local code repository using the code review tool; an information sending module, used to call a daemon process to perform the following steps: when monitoring that the revision identification of the target code in the code review tool is certified passed, sending an audit prompt message to the reviewer, the audit prompt message prompting the reviewer to log in to the code review tool to review the target code.

[0008] In a third aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for submitting code according to the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0009] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to cause a computer to execute the method for submitting code according to the first aspect or any corresponding embodiment thereof.

[0010] In a fifth aspect, the present disclosure provides a computer program product, including computer instructions, where the computer instructions are used to enable a computer to execute the method for submitting code according to the first aspect or any corresponding embodiment thereof.

[0011] The method for submitting code in the above-mentioned embodiment of the present disclosure obtains the target code corresponding to the code review task in the code review tool, then merges the target code into the local code tree to obtain the target code tree, then compiles and tests the target code tree to obtain the compilation test result, and then when the compilation test result indicates that the compilation test has passed and the code review tool is used to merge and revise the target code into the target branch of the local code repository, the verification mark of the target code in the code review tool is revised to be authenticated, and the daemon process is called to perform the following steps: when the verification mark of the target code in the code review tool is detected to be authenticated, a login message is sent to the reviewer. The code review tool reviews the prompt information of the target code, so that when the target code submitted by the developer is successfully merged and revised locally, the reviewer can be reminded to review in time so that the reviewer can review and approve it in time. The target code can be merged and revised to the code tree branch of the remote code repository in time, thereby reducing the conflict caused by the reviewer not reviewing for a long time and reviewing and merging multiple target codes into the repository in a short time. After the target code is merged and revised locally, it is merged and revised into the remote code repository, reducing the need for developers to repeatedly pull down to update the local code repository, modify the target code and submit operations, thereby improving the submission efficiency of developers in submitting target codes to the remote code repository. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0013] Figure 1 is a flowchart of a method for submitting code according to an embodiment of the present disclosure;

[0014] Figure 2a is a flowchart of another method for submitting code according to an embodiment of the present disclosure;

[0015] Figure 2b is an exemplary interactive architecture diagram adopted by the method for submitting code according to an embodiment of the present disclosure;

[0016] Figure 2c is an exemplary schematic diagram of a CAN bus extension frame that is redefined based on a commonly used CAN bus extension frame according to an embodiment of the present disclosure;

[0017] Figure 3 is a flowchart of a specific application embodiment of a method for submitting code according to an embodiment of the present disclosure;

[0018] Figure 4 is a structural block diagram of an apparatus for submitting code according to an embodiment of the present disclosure;

[0019] Figure 5 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0021] According to an embodiment of the present disclosure, a method embodiment for submitting code is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0022] In this embodiment, a method for submitting code is provided, which can be used for a network server in a local area network. Figure 1 is a flowchart of a method for submitting code according to an embodiment of the present disclosure, such as Figure 1 As shown, the process includes the following steps:

[0023] Step S101, obtaining the target code corresponding to the code review task in the code review tool.

[0024] In this embodiment, the execution subject of the method for submitting code may be an automated tool for submitting code running in the above network server. The automated tool can automatically build, test and deploy software.

[0025] Specifically, the automation tool can adopt tools for automating the construction, testing and deployment of software in the existing technology (such as Jenkins, Travis CI, GitLab CI / CD, GitHub Actions, etc.), or it can use programming languages ​​​​(such as C#, Java, Python, etc.) combined with construction, testing and deployment technologies to develop special automation tools for submitting code.

[0026] The target code refers to the code submitted by the developer for review and generates the code review task. The code review tool refers to a tool that helps developers find and fix potential problems in the code. Code review tools in existing technologies (such as GitHub, GitLab, Gerrit, Review Board, etc.) can be used, or programming languages ​​(such as C#, Java, Python, etc.) can be used in combination with code review technology to develop special code review tools.

[0027] The target code submitted by the developer for review is pushed to the code version repository of the remote distributed version control system managed by the code review tool through the submission command, and converted into a code review task. After that, the above-mentioned automation tool can first read the code review task from the code review tool, and then read the target code corresponding to it according to the code review task.

[0028] In some specific examples, when obtaining the target code corresponding to the code review task in the code review tool, the target code corresponding to the code review task in the code review tool may be obtained when a task notification of the code review tool is received.

[0029] In this example, the code review tool can notify the above-mentioned automation tool after generating the code review task, so that when the automation tool receives the task notification, it can promptly obtain the target code corresponding to the code review task in the code review tool, thereby promptly advancing the subsequent code submission steps and improving the efficiency of developers submitting code.

[0030] In some specific examples, a code review task is generated by a code review tool based on the following steps: monitoring the developer's input information; generating a code review task when the input information is an operation of pushing changes to a local repository to a remote code repository on a target code; wherein the target code includes: new code or modified code.

[0031] In this example, by clarifying the timing of generating code review tasks, code review tasks can be generated in a timely manner when the developer's operations meet the requirements, thereby promptly advancing the subsequent code submission steps and improving the efficiency of developers submitting code.

[0032] Step S102: merge the target code into the local code tree to obtain a target code tree.

[0033] In this embodiment, the local code tree can be obtained by the above-mentioned automation tool by copying the code of the target branch of the remote distributed version control system to the local working directory according to the configuration information of the source code. Furthermore, after obtaining the target code, the above-mentioned automation tool can merge the target code with the code tree corresponding to the target code to obtain a merged target code tree, that is, a merged code set.

[0034] Step S103, compile and test the target code tree to obtain a compile and test result.

[0035] In this embodiment, the compile test refers to the code correctly compiling and running basic tests in a specified environment or configuration. The compile test result can indicate the compile test information obtained after the target code is compiled, such as error and warning information of the target code, test report, performance report, etc.

[0036] Step S104, when the compilation test result indicates that the compilation test is passed and the target code is merged and revised into the target branch of the local code repository using the code review tool, the verification mark of the target code in the revised code review tool is certified passed.

[0037] In this embodiment, the local code repository is a local copy of the remote code repository, which stores the history and version information of the project to which the target code developed by the developer belongs. The branches of the local code repository allow developers to create multiple parallel development paths in the code repository. Each branch contains a complete copy of the code repository and can be modified and submitted without affecting other branches. The target branch of the local code repository refers to the branch corresponding to the target code submitted by the developer.

[0038] The verification mark of the target code in the code review tool here is used to indicate whether the target code is merged and revised into the local code repository successfully. If the compilation test result indicates that the compilation test is passed, the target code can be merged and revised into the local code repository. If there is no conflict in the merging and revision process, it means that the merger is successful, and the verification mark of the target code in the code review tool can be revised to pass the certification.

[0039] Step S105, calling the daemon process to perform the following steps: when monitoring that the verification mark of the target code in the code review tool is authenticated, sending a review prompt message to the reviewer, the review prompt message prompting the reviewer to log in to the code review tool to review the target code.

[0040] In this embodiment, the daemon process is a special process running in the background, which is used to perform specific system tasks. The specific tasks performed by the daemon process can at least monitor the verification mark of the target code in the code review tool, and when the verification mark of the target code is detected as passed, send a prompt message to the reviewer to prompt the reviewer to log in to the code review tool to review the target code.

[0041] The daemon process can be started when the system boots and run until the system is shut down; it can also be started according to pre-settings when the state used to start the daemon process meets the start condition, and automatically ended when the state used to end the daemon process meets the end condition.

[0042] The verification mark of the target code can be similar to 1 (passed the merge revision), -1 (failed the merge revision), True (passed the merge revision) and False (failed the merge revision) to indicate whether the merge revision of the target code into the local code repository is successful.

[0043] The method for submitting code in this embodiment obtains the target code corresponding to the code review task in the code review tool, then merges the target code into the local code tree to obtain the target code tree, then compiles and tests the target code tree to obtain the compilation test result, and then when the compilation test result indicates that the compilation test is passed and the code review tool is used to merge and revise the target code to the target branch of the local code repository, the verification mark of the target code in the code review tool is revised to be authenticated, and the daemon process called by the automation tool performs the following steps: when it is monitored that the verification mark of the target code in the code review tool is authenticated, a prompt message for logging in to the code review tool to review the target code is sent to the reviewer, so that when the target code submitted by the developer is successfully merged and revised locally, the reviewer can be reminded to review in time, so that the reviewer can review in time by merging and revising the target code to the target branch of the remote code repository, thereby reducing the conflict when the target code that has been merged and revised locally is merged and revised to the remote code repository, reducing the process of modifying the target code, updating the local code tree, the branches in the local code repository, and resubmitting the code due to the conflict, and improving the submission efficiency of the developer in submitting the target code to the remote code repository.

[0044] In some optional implementations of the above embodiment, the above method may further include: generating authentication information of the target code based on the compilation test result; and returning the authentication information to the developer via a code review tool.

[0045] In this implementation, the compilation test result may indicate the compilation test information obtained after the target code is compiled and tested, such as error and warning information of the target code, test report, performance report, etc. After compiling and testing the target code, the above-mentioned automated tool may directly generate the certification information of the target code according to the compilation test result, or perform other submission operations (such as merging revisions to a local code repository, etc.) based on the compilation test result, and generate the certification information of the target code based on the results of other submission operations, and then return the certification information to the developer through the code review tool.

[0046] The method for submitting code in this implementation enables the developer to quickly receive the result of submitting the code by generating authentication information of the target code and returning it to the developer, thereby improving the efficiency of the developer in completing code submission.

[0047] In some optional implementations of the above embodiments, authentication information of the target code is generated based on the compilation test result, including: when the compilation test result is that the local compilation test fails, setting the verification mark of the target code in the code review tool as failed verification; and generating authentication information including the verification mark.

[0048] In this implementation, the verification mark of the target code can be similar to 1 (passed verification) and -1 (failed verification), True (passed verification) and False (failed verification) to indicate whether the local compilation has passed the compilation test. The certification information may include the compilation test results and the verification mark of the target code. In some examples, other pre-set information for describing the certification situation may also be included, which is not limited in this application.

[0049] The method for submitting code in this implementation, by setting the verification mark of the target code to fail the verification, and then generating authentication information including the verification mark, can quickly provide feedback to the developer including the authentication information indicating that the verification mark has failed the verification, so that the developer can further submit the modified target code, thereby improving the efficiency of the developer in submitting the target code to the remote code repository.

[0050] In some optional implementations of the above embodiments, authentication information of the target code is generated based on the compilation test result, including: when the compilation test result is that the local compilation test passed, setting the verification mark of the target code in the code review tool to passed verification, and submitting the target code to the code review tool; obtaining the merge revision result of the code review tool merging the target code into the target branch in the local code repository; if the merge revision result indicates that a conflict occurs in the merge revision, setting the verification mark of the target code in the code review tool to failed verification; and generating authentication information including the verification mark.

[0051] In this implementation, the authentication information may include the merged revision result and the verification mark of the target code. In some examples, other pre-set information for describing the authentication situation may also be included, which is not limited in this application.

[0052] In this implementation, when the compilation test result is that the local compilation test passed, the verification mark of the target code in the code review tool is set to passed verification. When a conflict occurs when the code review tool is called to merge and revise the target code into the target branch in the local code repository, the verification mark of the target code in the code review tool can be set to failed verification, and authentication information including the verification mark can be generated. This allows the developer to quickly receive feedback including the authentication information that the verification mark shows failed verification, so that the developer can further update the data in the local code repository and submit the modified target code, thereby improving the efficiency of the developer in submitting the target code to the remote code repository.

[0053] In this embodiment, another method for submitting code is provided, which can be used for the network server in the above-mentioned local area network, etc. Figure 2a The flowchart of another method for submitting code according to an embodiment of the present disclosure is as follows. In an intranet environment, an automation tool in a network server connected to the intranet developer using a local area network and to the external network reviewer using a CAN bus performs the following steps:

[0054] like Figure 2a As shown, the process includes the following steps:

[0055] Step S201, obtaining the target code corresponding to the code review task in the code review tool through the local area network.

[0056] Step S202: merge the target code into the code tree of the local code repository to obtain a target code tree.

[0057] Step S203, compile and test the target code tree to obtain a compile and test result.

[0058] Step S204: Generate authentication information of the target code based on the compilation test result.

[0059] Step S205: Return authentication information to the developer on the intranet via the code review tool through the local area network.

[0060] Step S206, when the compilation test result indicates that the compilation test is passed and the target code is merged and revised into the local code repository using the code review tool and passed, the verification mark of the target code in the code review tool is revised as certification passed.

[0061] Step S207, calling the daemon process to perform the following steps: when monitoring the verification mark of the target code in the code review tool as authentication passed, sending an audit prompt message to the reviewer in the external network through the CAN bus, and the audit prompt message prompts the reviewer to log in to the code review tool to review the target code.

[0062] Please refer to Figure 2b , Figure 2b An exemplary interaction architecture diagram adopted by a method for submitting code according to an embodiment of the present disclosure is shown.

[0063] In this embodiment, if Figure 2b As shown, the local area network connects the network server and the computers used by multiple developers. Developers can submit target codes to the code review tool on the computer to generate code review tasks.

[0064] The automation tool running on the network server can obtain the target code corresponding to the code review task in the code review tool through the local area network. After that, the automation tool compiles and tests the target code tree to obtain the compilation test result; then generates the authentication information of the target code based on the compilation test result; then, through the code review tool, the authentication information is returned to the developer in the intranet through the local area network; then, when the compilation test result indicates that the compilation test has passed and the code review tool is used to merge and revise the target code to the local code repository, the verification mark of the target code in the revised code review tool is passed.

[0065] Finally, the above-mentioned automation tool can call the daemon process to perform the following steps: when it is detected that the verification mark of the target code in the code review tool is authenticated, an audit prompt message is sent to the auditor on the external network through the CAN bus, and the audit prompt message prompts the auditor to log in to the code review tool to audit the target code.

[0066] Among them, the CAN bus connects the above network server with the servers of all auditors. The CAN bus adopts a multi-master control mode, that is, any node on the network can actively send information to other nodes on the network at any time without waiting for the bus to be idle. This feature improves the flexibility and real-time performance of communication.

[0067] Specifically, see Figure 2c , Figure 2c An exemplary schematic diagram of a CAN bus extended frame that is redefined based on a commonly used CAN bus extended frame is shown.

[0068] like Figure 2cAs shown, the extended frame of the CAN bus usually includes: an arbitration segment consisting of a 32-bit identifier, a control segment consisting of a 6-bit identifier (including 2 reserved bits (r1, r0), a 4-bit data length code (DLC)), a data segment consisting of a 32-bit identifier, a cyclic redundancy check (CRC) segment, and an acknowledgement (ACK) segment.

[0069] In the present disclosure, the extended frame of the CAN bus is redefined to include: the first 11 bits are used as an identifier (Identify ID) actually used, using the remaining 21 bits of the arbitration segment identifier (including a 1-bit alternative remote request frame (SSR) identifier, a 1-bit extended identifier bit (IDE) identifier, 18 bits of actually used identifiers and a 1-bit remote transmit request bit (RTR) identifier), a 6-bit identifier of the control segment and a 32-bit identifier of the data segment, forming a data length (1 byte, i.e., an 8-bit identifier), a custom data segment (6 bytes, i.e., a 48-bit identifier for actual data transmission) and a data end identifier (3-bit identifier used to identify whether data transmission is ended); as well as a CRC segment and an ACK segment.

[0070] The method for submitting code in the above embodiment uses a CAN bus to connect the automation tool in the network server of the intranet and the servers of all reviewers in the external network. The CAN bus adopts a multi-master control method, that is, any node on the network can actively send information to other nodes on the network at any time without waiting for the bus to be idle. This feature improves the flexibility and real-time performance of communication, solves the problem that the intranet cannot notify code reviewers by email, and enables the newly submitted code by the code developer to be reviewed and stored in a timely manner, avoiding merge conflicts caused by multiple submissions that have not been reviewed in a timely manner, reducing the time wasted on resolving conflicts for code developers, and improving development efficiency.

[0071] As one or more specific application embodiments of the present disclosure, the following Figure 3 A specific application scenario of the present disclosure is described. Figure 3 A flowchart of a specific application embodiment of a method for submitting code according to an embodiment of the present disclosure is shown.

[0072] like Figure 3 As shown, first, the target code submitted by the developer is pushed to the code version library managed by the code review tool through the code submission command. The pushed submission is converted into a code review task, and the review task can be accessed through the reference under the specific path of the code review tool.

[0073] The above-mentioned automated tool can obtain the submitted target code through the above-mentioned specific path reference and compile and test it. If the test fails, the verification flag (verified) can be set to -1, and the verification result can be returned to the developer; if the test passes, the verification flag can be set to +1, and the revision can be merged to the corresponding branch of the version library to determine whether a conflict occurs during the merge process. If a conflict occurs, the verification flag is reset to -1 and the verification result is returned to the developer.

[0074] When the daemon detects that the code merge has passed and the verification flag value is +1, it automatically sends a prompt message (also known as a review notification) to the reviewer through the CAN bus, so that the reviewer can log in to the code review tool in time to review and submit the code. The reviewer can view the review tasks and code changes through the Web interface, and make decisions such as passing the code review or rejecting it through the Web interface.

[0075] After reviewing the code on the code review tool, the reviewer submits comments or opinions and notifies the corresponding developer via external email. The developer handles the code accordingly based on the review result. Specifically, the review notification received by the reviewer is triggered after the local merge revision is completed without conflict. If the reviewer finds no errors, the code can be directly stored in the repository.

[0076] In this embodiment, a device for submitting code is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0077] This embodiment provides a device for submitting code, such as Figure 4 As shown, including:

[0078] The code acquisition module 401 is used to acquire the target code corresponding to the code review task in the code review tool;

[0079] A code merging module 402 is used to merge the target code into the local code tree to obtain a target code tree;

[0080] A compile test module 403 is used to perform a compile test on the target code tree to obtain a compile test result;

[0081] The identification revision module 404 is used to revise the revision mark of the target code in the code review tool as certified when the compilation test result indicates that the compilation test is passed and the target code is merged and revised into the target branch of the local code repository using the code review tool and passed;

[0082] The information sending module 405 is used to call the daemon process to perform the following steps: when it is detected that the revision mark of the target code in the code review tool is certified, an audit prompt message is sent to the reviewer, and the audit prompt message prompts the reviewer to log in to the code review tool to review the target code.

[0083] In some optional embodiments, the device further includes (not shown in the figure):

[0084] An information generation module, used to generate authentication information of the target code based on the compilation test results;

[0085] The information return module is used to return authentication information to the developer via the code review tool.

[0086] In some optional implementations of this embodiment, the information generation module includes (not shown in the figure):

[0087] The identification setting unit is used to set the verification identification of the target code as failed verification in the code review tool when the compilation test result is that the local compilation test fails;

[0088] The information generating unit is used to generate authentication information including a verification identifier.

[0089] In some optional implementations of this embodiment, the information generation module includes (not shown in the figure):

[0090] A code submission unit, used to set the verification mark of the target code in the code review tool as passed verification when the compilation test result is that the local compilation test has passed, and submit the target code to the code review tool;

[0091] A result acquisition unit is used to acquire a merge revision result of the code review tool merging the target code into the target branch in the local code repository;

[0092] A setting identification unit is used to set the verification identification of the target code as failed verification in the code review tool if the merge revision result indicates that the merge revision has a conflict;

[0093] Generate an information unit, used to generate authentication information including a verification identifier.

[0094] In some optional implementations of this embodiment, the device further includes (not shown in the figure):

[0095] The server execution module is used to implement the following modules in the intranet environment through the automation tools in the network server connected to the intranet developers using the LAN and to the external network auditors using the CAN bus:

[0096] The code acquisition module is further used to acquire the target code corresponding to the code review task in the code review tool through the local area network;

[0097] A code merging module is used to merge the target code into the local code tree to obtain a target code tree;

[0098] The compile test module is used to compile and test the target code tree and obtain the compile test results;

[0099] An information generation module, used to generate authentication information of the target code based on the compilation test results;

[0100] The information return module is further used to return authentication information to the developer of the intranet through the local area network via the code review tool;

[0101] The identification revision module is used to revise the revision mark of the target code in the code review tool as certified when the compilation test result indicates that the compilation test has passed and the target code is merged and revised into the target branch of the local code repository using the code review tool and passed;

[0102] The information sending module is further used to call the daemon process to perform the following steps: when it is monitored that the revision mark of the target code is certified, an audit prompt message is sent to the reviewer on the external network through the CAN bus, and the audit prompt message prompts the reviewer to log in to the code review tool to review the target code.

[0103] In some optional implementations of this embodiment, the code acquisition module is further used to: upon receiving a task notification from the code review tool, acquire the target code corresponding to the code review task in the code review tool.

[0104] In some optional implementations of this embodiment, the code review task acquired by the code acquisition module is generated by the code review tool based on the following steps: monitoring the developer's input information; generating a code review task when the input information is an operation of pushing changes to the local repository to the remote code repository for the target code; wherein the target code includes: new code or modified code.

[0105] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0106] The device for submitting code in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0107] See also Figure 5 , Figure 5 1 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present disclosure, and the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).

[0108] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0109] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0110] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0111] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0112] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0113] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0114] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for submitting code, characterized in that: The method comprises: Obtain the target code corresponding to the code review task in the code review tool; Merging the target code into the local code tree to obtain a target code tree; Performing a compile test on the target code tree to obtain a compile test result; When the compilation test result indicates that the compilation test is passed and the target code is merged and revised into the target branch of the local code repository using the code review tool, the revision mark of the target code in the code review tool is revised as certified passed; The daemon process is called to perform the following steps: when it is detected that the revision mark of the target code in the code review tool is authenticated, an audit prompt message is sent to the reviewer, and the audit prompt message prompts the reviewer to log in to the code review tool to review the target code.

2. The method according to claim 1, characterized in that The method further comprises: Based on the compilation test result, generating authentication information of the target code; The authentication information is returned to the developer via the code review tool.

3. The method according to claim 2, characterized in that The generating the authentication information of the target code based on the compilation test result includes: When the compilation test result is that the local compilation test fails, setting the verification mark of the target code as failed verification in the code review tool; Generate authentication information including the verification identifier.

4. The method according to claim 2, characterized in that: The generating the authentication information of the target code based on the compilation test result includes: When the compilation test result is that the local compilation test has passed, setting the verification mark of the target code in the code review tool as passed verification, and submitting the target code to the code review tool; Obtaining a merge revision result of the code review tool merging the target code into a target branch in the local code repository; If the merged revision result indicates that a conflict occurs in the merged revision, setting a verification mark of the target code as failed verification in the code review tool; Generate authentication information including the verification identifier.

5. The method according to claim 2, characterized in that: The method further comprises: In the intranet environment, the following steps are performed by an automated tool in a network server that is connected to the intranet developer via a LAN and to the external reviewer via a CAN bus: Obtaining the target code corresponding to the code review task in the code review tool through the local area network; Merging the target code into the local code tree to obtain a target code tree; Performing a compile test on the target code tree to obtain a compile test result; Based on the compilation test result, generating authentication information of the target code; Returning the authentication information to the developer of the intranet via the code review tool through the local area network; When the compilation test result indicates that the compilation test is passed and the target code is merged and revised into the target branch of the local code repository using the code review tool, the verification mark of the target code in the code review tool is revised to be certified passed; The daemon process is called to perform the following steps: when it is monitored that the verification mark of the target code in the code review tool is authenticated, an audit prompt message is sent to the auditor of the external network through the CAN bus, and the audit prompt message prompts the auditor to log in to the code review tool to review the target code.

6. The method according to claim 1, characterized in that The obtaining of the target code corresponding to the code review task in the code review tool includes: When receiving the task notification of the code review tool, the target code corresponding to the code review task in the code review tool is obtained.

7. The method according to claim 1, characterized in that The code review task is generated by the code review tool based on the following steps: Monitor developer input; When the input information is an operation of pushing changes in a local repository to a remote code repository on a target code, a code review task is generated; wherein the target code includes: new code or modified code.

8. A device for submitting code, characterized in that: The device comprises: A code acquisition module is used to acquire the target code corresponding to the code review task in the code review tool; A code merging module, used for merging the target code into a local code tree to obtain a target code tree; A compile test module, used to perform a compile test on the target code tree to obtain a compile test result; An identification revision module, configured to revise the revision identification of the target code in the code review tool as certified when the compilation test result indicates that the compilation test has passed and the target code has been merged and revised into a target branch of the local code repository using the code review tool; The information sending module is used to call the daemon process to perform the following steps: when it is monitored that the revision mark of the target code in the code review tool is certified, an audit prompt message is sent to the reviewer, and the audit prompt message prompts the reviewer to log in to the code review tool to review the target code.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for submitting code according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the method for submitting code according to any one of claims 1 to 7.