CN108776643B - Target code merging control method and system based on version control process - Google Patents

Target code merging control method and system based on version control process Download PDF

Info

Publication number
CN108776643B
CN108776643B CN201810565169.XA CN201810565169A CN108776643B CN 108776643 B CN108776643 B CN 108776643B CN 201810565169 A CN201810565169 A CN 201810565169A CN 108776643 B CN108776643 B CN 108776643B
Authority
CN
China
Prior art keywords
detection
code
target
configuration
branch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810565169.XA
Other languages
Chinese (zh)
Other versions
CN108776643A (en
Inventor
陆小三
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Wuhan Co Ltd
Original Assignee
Tencent Technology Wuhan Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Wuhan Co Ltd filed Critical Tencent Technology Wuhan Co Ltd
Priority to CN201810565169.XA priority Critical patent/CN108776643B/en
Publication of CN108776643A publication Critical patent/CN108776643A/en
Application granted granted Critical
Publication of CN108776643B publication Critical patent/CN108776643B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/368Test management for test version control, e.g. updating test cases to a new software version

Abstract

The invention provides a target code merging control method and a target code merging control system based on a version control process, wherein the method comprises the steps of configuring a detection task, wherein the configuration detection task comprises configuring a detection server and configuring a detection object in a distributed version control system, and the distributed version control system comprises a development branch and a target branch; acquiring a target code submitted to a development branch; judging whether the target code belongs to the detection object or not; and if so, triggering the detection server to realize the incremental detection of the target code and the feedback of the detection result, and controlling the merging flow of the target code to the target branch according to the detection result. Compared with the full-quantity detection in the prior art, the method has the advantages that the detection process is advanced, the detection speed is high, the result is concise, and compared with the local incremental detection in the prior art, the method can be combined with the version control process.

Description

Target code merging control method and system based on version control process
Technical Field
The invention relates to the technical field of computer application, in particular to a target code merging control method and a target code merging control system based on a version control process.
Background
The existing code detection technology mainly comprises full-amount detection and local increment detection, the full-amount detection is based on full-amount code scanning, and common scanning tools comprise coverage and CppLint; incremental detection is done autonomously locally by the developer, without versioning flow integration.
Under the prior art, the problems of large code scanning amount, long time consumption, numerous results, incapability of positioning corresponding responsible persons, difficulty in promoting solution, low problem solution rate and the like exist in the full detection after the scanning process; the incremental detection is located locally by a developer and is not combined with a version control process, so that the master control performance of the developer is overlarge, and the problems of low problem solving rate and the like occur.
Disclosure of Invention
In order to solve the technical problem, the invention provides a target code merging control method and a target code merging control system based on a version control process. The invention is realized by the following technical scheme:
in a first aspect, a target code merging control method based on a version control process includes:
configuring a detection task, wherein the configuration detection task comprises a configuration detection server and a detection object in a configuration version control system, the version control system is used for carrying out version management on codes, and the version control system comprises a development branch and a target branch; the detection server is used for automatically detecting codes submitted by the development branches;
acquiring a target code submitted to a development branch;
judging whether the target code belongs to the detection object or not;
and if so, triggering the detection server to realize the incremental detection of the target code and the feedback of the detection result, and controlling the merging flow of the target code to the target branch according to the detection result.
In a second aspect, an object code merging control system based on a version control process comprises a version control system, a detection task configuration manager and a detection server;
the detection task configuration manager comprises:
the system comprises a detection task configuration module, a detection task configuration module and a version control system, wherein the detection task configuration module is used for configuring a detection task, the detection task configuration comprises a configuration detection server and a detection object in the configuration version control system, and the version control system comprises a development branch and a target branch;
the target code acquisition module is used for acquiring a target code submitted to a development branch;
the judging module is used for judging whether the target code belongs to the detection object or not;
the triggering module is used for triggering the detection server to realize incremental detection of the target code and feedback of a detection result;
and the flow control module is used for controlling the merging flow of the target code to the target branch according to the detection result.
In a third aspect, a computer-readable storage medium is used for storing a program, and the program is executed to implement the steps of the object code merging control method based on the version control flow.
The invention provides a target code merging control method and a target code merging control system based on a version control process. Compared with the full-quantity detection in the prior art, the method has the advantages that the detection process is forward, the detection speed is high, the result is concise, and compared with the local incremental detection in the prior art, the method can be combined with the version control process. If the incremental detection is unqualified, the target code cannot be merged into the target branch, and the target code can be finally merged into the target branch only after a developer solves the problem of the target code. Therefore, the scheme guarantees the quality of the target code submitted by the developer based on the version control process and the incremental detection.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic diagram of an implementation environment of a target code detection method based on a version control process according to an embodiment of the present invention;
fig. 2 is a flowchart of a target code merging control method based on a version control flow according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for performing incremental code detection by a detection server according to an embodiment of the present invention;
FIG. 4 is a flowchart of a method for incrementally detecting a code based on the test case library according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a test case deployment structure provided by an embodiment of the present invention;
FIG. 6 is a flowchart illustrating merging of target code into a target branch according to a detection result according to an embodiment of the present invention;
FIG. 7 is a block diagram of a detection task configuration manager provided by an embodiment of the invention;
FIG. 8 is a block diagram of a detection server provided by an embodiment of the present invention;
FIG. 9 is a block diagram of a detection module provided by an embodiment of the present invention;
FIG. 10 is a block diagram of a process control module provided by an embodiment of the present invention;
fig. 11 is a schematic diagram of an object code merging control system operating device based on a version control flow according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The current mainstream static code detection method is based on the full-scale scanning of codes, generally, most developers submit codes and then perform the full-scale scanning of codes on a main line or a release line of a product, and the defects of the full-scale scanning of codes are obvious and mainly include: if the code submitted to the main line or the sending and distributing line has problems after the scanning time is relatively later, the code needs to be rolled back to influence the function of the code in the main line or the sending and distributing line; the scan time is slow, such as the full scan of the browser kernel code may take hours; the scanning results are many, and the problem is difficult to solve in a limited time of development; the responsibility division is unclear, most of the development only takes charge of the codes submitted by the development, and the whole scanning is difficult to locate the position where a specific problem appears and find the responsible person.
In addition, some local incremental detection methods exist in the prior art, but the local detection is easily and freely controlled by developers, and cannot be tightly combined with a version control flow. In order to improve the efficiency of code detection, a detection process and a version control process are closely combined together, so that the embodiment of the invention provides a target code combination control method and a target code combination control system based on the version control process.
Referring to fig. 1, an implementation environment diagram of an object code merging control method based on a version control flow according to an embodiment of the present invention is provided. The implementation environment includes: distributed version control system 101, detection task configuration manager 102, and detection server 103.
The distributed version control system 101 is configured to perform code version control management, the detection server 103 is configured to perform code incremental detection, and the detection task configuration manager 102 is configured to configure a detection task, control the detection server 103 to perform code incremental detection, and control a code version control process in the distributed version control system 101.
The distributed version control system 101, the detection task configuration manager 102 and the detection server 103 may communicate with each other through a wireless network or a wired network.
Referring to fig. 2, an embodiment of the present invention specifically provides a target code merging control method based on a version control process, including:
s101, configuring a detection task, wherein the configuration detection task comprises configuring a detection server and configuring a detection object in a distributed version control system, and the distributed version control system comprises a development branch and a target branch.
The distributed version control system can effectively process various project version management at high speed, wherein SVN and Git are common. In the embodiment of the invention, Git is taken as an example to describe the target code merging control method based on the version control process.
Git is an open source version control software developed by LinusTorvalds to help manage Linux kernel development. Git supports cloning a complete Git repository (including code and version information) from a server onto a stand-alone, and supports creating branches, as well as merging branches. In general, developers of various departments submit codes on respective corresponding development branches, and Git supports merging the codes on the respective development branches into a target branch. The target branch may also be referred to as a main branch in general, which may be a master branch or a release branch in particular. When the codes on the development branches are merged into the target branches, the codes are merged on the development flow.
The purpose of configuring the detection task in the embodiment of the present invention is to ensure that the detection server can be triggered to automatically detect the target code when a developer submits the code, and the embodiment of the present invention specifically discloses the following configuration contents:
1) warehouse address: the address of the code repository in the distributed version control system that needs to be incrementally checked is configured to ensure that incremental checking occurs at the designated repository.
2) And (3) branch development: for developers in various departments, the code they submit may be located on different branches of development. In general, developers in each department will pull codes belonging to their development branches, and after the code development is completed, the codes will be submitted to their development branches, and the codes of the development branches will be stored in a certain code warehouse. Thus, after the development branch and repository addresses are configured, it can be determined which code is submitted that triggers the automatic detection.
In fact, in an actual development flow, detection of target codes should be performed on each development branch, and in order to be able to detect codes submitted by all development branches, regular expressions are used in the embodiment of the present invention to match the situations of all development branches. In order to improve matching efficiency, the same prefix can be used by all development branches agreed by developers, for example, a name of 'dev/' is used as the development branch prefix, so that the purpose of automatically detecting codes submitted on all development branches is achieved.
3) The detection server: the detection server is used for automatically detecting the codes submitted by the development branches. In order to enable the detection server to have the capability of automatic detection, the following configuration is performed in the detection server in the embodiment of the invention:
detecting a script: the detection script can be configured in a detection server or a code warehouse and used for automatically detecting the codes submitted by the development branches. The detection script may include the following: the incremental detection tool deploys and updates related code, and the detection tool automatically executes the related code and processes the detection result. The detection script can perform incremental detection according to preset code detection rules, such as whether a tab key exists or not, whether log output is not allowed to be detected or not, and the like.
Environmental variables: and detecting environment variables required by script running. The environment variables and the development branches can have corresponding relations, namely the environment variables on which the detection scripts depend can be different when codes submitted by different development branches are automatically detected.
And (3) detection result configuration: and evaluating the detection result according to the required evaluation rule. The evaluation rules and the development branches may have a corresponding relationship, that is, the evaluation rules according to which the script is detected may be different when the codes submitted by different development branches are automatically detected. For example, when the number of questions at different levels meets the conditions, the test is passed and failed, for example, when the number of questions at the warning level of the code quality detection result is less than or equal to 5, the test is passed, and when the number of questions at the warning level of the code quality detection result is greater than 5, the test is failed.
Further, in order to improve the normalization of the configuration detection task, in the embodiment of the present invention, at least the relevant personnel capable of performing the configuration detection task should have a management right more than the development right for the code repository and pass the security authentication.
S103, acquiring the target code submitted to the development branch.
The object code is code that the developer completes each time and submits to the development branch.
And S105, judging whether the target code belongs to the detection object.
As can be seen from the above configuration, in step S105, it may be determined whether the development branch in step S103 belongs to a development branch configured in the configuration task, and whether the address of the code repository corresponding to the development branch is also located in the configuration task, and if so, the target code belongs to the detection object.
And S107, if yes, triggering the detection server to realize the incremental detection of the target code and the feedback of the detection result, and controlling the merging flow of the target code to the target branch according to the detection result.
The incremental detection is that only the code part changed by the developer is subjected to code detection, the code part which is not changed is not subjected to code detection, and the detected code quality problem is responsible for a code submitter (developer). Incremental detection is triggered by a developer submitting code to a development branch and belongs to code static detection.
The Git code warehouse is a company-level code management platform, and when developers submit codes, corresponding detection servers are triggered to carry out incremental detection on the codes according to development branches configured by detection tasks. The embodiment of the invention further discloses a method for detecting the incremental detection of codes executed by a server, which comprises the following steps of:
and P1, pulling the code of the development branch where the target code is located to the local of a detection server.
The purpose of P1 is to ensure that the latest code is present on the detection server.
And P3, executing the detection script.
Specifically, the main functions of the detection script include: deploying or updating the incremental code detection tool, controlling the execution of the incremental code detection tool, and controlling the migration and deletion of the detection result.
P5. outputs the detection result to the distributed version control system.
Specifically, the detection result may be output to the development branch, or may also be output to a data statistics center at the same time, where the data statistics center is used to record and perform subsequent statistics on the detection result of each incremental code.
Further, after the incremental detection is completed, the environment variables corresponding to the development branches are also modified correspondingly, and the environment variables are located in the detection server. The environment variable holds the commit location of the last time the development branch committed code. In the embodiment of the invention, the environment variable is defined as GIT _ BRANCH _ REVISION _ LAST, and for GIT, Commit Id submitted LAST time in GIT is recorded into the environment variable GIT _ BRANCH _ REVISION _ LAST.
In the embodiment of the invention, two tools, namely an incremental code detection tool and a test case library, are called in the detection script.
The incremental code detection tool is configured to perform incremental detection on a code based on the test case library, as shown in fig. 4, where the detection method includes:
A1. and acquiring an increment code according to the target code.
In particular, the obtaining of the delta code may be implemented by a command line tool in a delta code detection tool.
And the command line tool acquires the position of the code submitted last time by detecting the environment variable provided by the server, and acquires the incremental code by a git diff command.
A2. And calling a target test case from the test case library according to the incremental code.
A3. And running the target test case.
Specifically, some general test cases can be used in the running process of the target test case, so that the general test cases can be listed separately to generate a common test case library in order to avoid code redundancy and reduce the coupling degree.
A4. And generating a detection result.
The test case library can also be managed according to a code management method of developers, and corresponding test cases for testing codes of different development branches are also placed on the development branches together. The test cases in the test case library are deployed according to the directory hierarchy, and as shown in fig. 5, the white list is used for controlling so as to position the directory where the target test case is located according to the incremental code. When the test case is executed, only the code in the directory and the subdirectory where the target test case is located is operated.
Specifically, the embodiment of the present invention further discloses a merging process for controlling the target code to the target branch according to the detection result, as shown in fig. 6, including:
s1071, acquiring a merging request.
The merge request is mr (merge request), and the developer applies for the process of merging the target code into the stable target branch.
Specifically, when the developer applies for merging the object codes submitted by the developer, the incremental detection results of the object codes are synchronously displayed. If the detection result is not satisfactory, the developer can not initiate the merging request for the target code, but revise and submit the target code again until the detection result is satisfactory, and then initiate the merging request.
And S1073, responding to the merging request, and judging whether the detection result is qualified.
S1075, if the target code is qualified, the target code is merged into the target branch.
And S1077, if the target code is not qualified, refusing to be combined into the target branch, and issuing a rollback instruction so as to facilitate the developer to resubmit the modified target code.
In a feasible implementation manner, a rechecker (Code Review) of the target Code can refer to the detection result to determine whether the Code is qualified, if a problem exists, a merging request initiated by the developer is directly rejected, a rollback instruction is issued so that the developer can resubmit the modified target Code, and after the corresponding developer modifies the Code quality problem, the submission process is carried out again, and the next incremental detection is carried out again.
After reviewing the code, the reviewer typically replies with LGTM (full Look Good To Me), and when the inspection result is passed and the reviewer considers the code To be trouble-free, replies To the LGTM and incorporates the code into the target branch.
In another possible embodiment, merging or refusing merging can be directly carried out according to the detection result without depending on a rechecker.
In another possible embodiment, if the detection result is not qualified, the developer is not allowed to initiate the merge request directly.
The embodiment of the invention provides a target code merging control method based on a version control process, which can directly solve the problems of slow detection, more detection results, incapability of specifying responsible persons, low problem solving rate and the like in the current full code detection process. The detection process works on an independent server, and local matching access does not need to be developed through regular matching, so that the pushing cost of local detection access is reduced. The detection rule of the technical scheme is combined with the version control flow, the quality of submitted codes is detected, the detection speed is high, a problem responsibility developer is clear, the problem responsibility developer is bound with the submission flow, the problem of the quality of the currently submitted codes can be effectively solved through certain constraint force, and the quality of project codes can be integrally improved after long-term operation.
Another embodiment of the present invention provides a target code merging control system based on a version control process, which includes a distributed version control system 101, a detection task configuration manager 102, and a detection server 103;
the detection task configuration manager 102, as shown in fig. 7, includes:
a detection task configuration module 1021, configured to configure a detection task, where the configuration detection task includes configuring a detection server and configuring a detection object in a distributed version control system, and the distributed version control system includes a development branch and a target branch.
An object code obtaining module 1022, configured to obtain object code submitted to the development branch.
A judging module 1023, configured to judge whether the target code belongs to the detection object.
A triggering module 1024, configured to trigger the detection server to implement incremental detection on the target code and feedback of a detection result.
And the flow control module 1025 is used for controlling the merging flow of the target code to the target branch according to the detection result.
The detection object in the configuration distributed version control system comprises a configuration warehouse address and a development branch, and the configuration detection server comprises a configuration detection script, an environment variable and an evaluation rule required by detection result evaluation.
As shown in fig. 8, the detection server 103 includes:
a code pulling module 1031, configured to pull the code of the development branch where the target code is located to the local detection server.
A detection module 1032 for executing a detection script; the detection script calls an incremental code detection tool and a test case library.
And an output module 1033, configured to output the detection result to the distributed version control system.
As shown in fig. 9, the detection module 1033 includes:
an increment code obtaining unit 1031, configured to obtain an increment code according to the target code.
And the test case calling unit 1032 is configured to call a target test case to the test case library according to the incremental code.
A test case running unit 1033, configured to run the target test case.
A detection result generating unit 1034 for generating a detection result.
As shown in fig. 10, the flow control module 1025 includes:
a merge request get unit 10251, configured to get a merge request.
A judging unit 10252, configured to, in response to the merge request, judge whether the detection result is qualified.
A merging unit 10253 for merging the target code into the target branch.
A reject unit 10254 to reject the merging of the object code into the target branch and issue a rollback instruction to facilitate a developer resubmitting the modified object code.
The target code merging control system and the method based on the version control flow in the device embodiment of the invention are based on the same inventive concept.
Embodiments of the present invention also provide a storage medium, where the storage medium may be used to store a program code for implementing a target code merge control method based on a version control flow in a method embodiment. Optionally, in this embodiment, the storage medium may be located in at least one network device of a plurality of network devices of a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, which can store program codes.
Referring to fig. 11, fig. 11 is a schematic structural diagram of an operating device of a target code merging control system based on a version control flow according to an embodiment of the present invention. The running device can comprise one or more functional modules in the object code merging control system based on the version control process. The runtime apparatus 800, which may vary significantly depending on configuration or performance, may include one or more Central Processing Units (CPUs) 822 (e.g., one or more processors) and memory 832, one or more storage media 830 (e.g., one or more mass storage devices) that store applications 842 or data 844. Memory 832 and storage medium 830 may be, among other things, transient or persistent storage. The program stored in the storage medium 830 may include one or more modules (not shown), each of which may include a series of instruction operations for the execution device. Still further, the central processor 822 may be configured to communicate with the storage medium 830 and execute a series of instruction operations in the storage medium 830 on the execution device 800. Runtime apparatus 800 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input-output interfaces 858, and/or one or more operating systems 841, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, and so forth. The steps performed by the above-described method embodiment may be based on the operational equipment configuration shown in fig. 11.
It should be noted that: the sequence of the above embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (13)

1. A target code merging control method based on a version control process is characterized by comprising the following steps:
configuring a detection task, wherein the configuration detection task comprises a configuration detection server and a detection object in a configuration version control system, the version control system is used for carrying out version management on codes, and the version control system comprises a development branch and a target branch; the detection server is used for automatically detecting codes submitted by development branches, detection objects in the configuration version control system comprise configuration warehouse addresses and development branches, the warehouse addresses are addresses of code warehouses needing incremental detection in the version control system, and the codes of the development branches are submitted to the corresponding code warehouses; the configuration detection server comprises configuration environment variables and evaluation rules required by detection result evaluation, and the environment variables and the evaluation rules correspond to development branches to which detection objects belong;
acquiring a target code submitted to a development branch;
judging whether the development branch of the target code belongs to a development branch configured in the detection task, if so, judging whether the address of a code warehouse corresponding to the development branch of the target code is located in the detection task, and if so, determining a target detection object to which the target code belongs; triggering the detection server to enable the detection server to perform incremental detection and detection result feedback on the target code based on the evaluation rule corresponding to the target detection object and the environment variable corresponding to the target detection object, and controlling the merging process of the target code to the target branch according to the detection result.
2. The method of claim 1, wherein the configuration detection server further comprises a configuration detection script.
3. The method of claim 1, wherein incrementally detecting the target code comprises:
pulling the code of the development branch where the target code is located to the local detection server;
executing the detection script; the detection script calls an incremental code detection tool and a test case library;
and outputting the detection result to the version control system.
4. The method of claim 3, wherein the detecting method of detecting script execution comprises:
acquiring an increment code according to the target code;
calling a target test case from the test case library according to the incremental code;
running the target test case;
and generating a detection result.
5. The method of claim 4, further comprising:
a common test case library is embedded in the incremental code detection tool, the common test case library records general test cases, and the common test case library can be called by the test case library.
6. The method of claim 1, wherein the controlling the merging process of the target code into the target branch according to the detection result comprises:
acquiring a merging request;
responding to the merging request, and judging whether a detection result is qualified;
if the target code is qualified, merging the target code into a target branch;
and if not, refusing to incorporate the target code into the target branch, and issuing a rollback instruction so as to facilitate the developer to resubmit the modified target code.
7. A target code merging control system based on a version control process is characterized by comprising a version control system, a detection task configuration manager and a detection server;
the detection task configuration manager comprises:
the system comprises a detection task configuration module, a detection task configuration module and a version control system, wherein the detection task configuration module is used for configuring a detection task, the configuration detection task comprises a configuration detection server and a detection object in a configuration version control system, the version control system comprises a development branch and a target branch, the detection object in the configuration version control system comprises a configuration warehouse address and a development branch, the warehouse address is the address of a code warehouse which needs to be incrementally detected in the version control system, and the code of the development branch is submitted to the corresponding code warehouse; the configuration detection server comprises configuration environment variables and evaluation rules required by detection result evaluation, and the environment variables and the evaluation rules correspond to development branches to which detection objects belong;
the target code acquisition module is used for acquiring a target code submitted to a development branch;
the judging module is used for judging whether the development branch of the target code belongs to the development branch configured in the detection task, if so, judging whether the address of a code warehouse corresponding to the development branch of the target code is located in the detection task, and if so, determining a target detection object to which the target code belongs;
the triggering module is used for triggering the detection server so that the detection server performs incremental detection and feedback of a detection result on the target code based on the evaluation rule corresponding to the target detection object and the environment variable corresponding to the target detection object;
and the flow control module is used for controlling the merging flow of the target code to the target branch according to the detection result.
8. The system of claim 7, wherein:
the detection object in the configuration version control system comprises a configuration warehouse address and a development branch, and the configuration detection server comprises a configuration detection script, an environment variable and an evaluation rule required by detection result evaluation.
9. The system of claim 8, wherein the detection server comprises:
the code pulling module is used for pulling the code of the development branch where the target code is located to the local part of the detection server;
the detection module is used for executing the detection script; the detection script calls an incremental code detection tool and a test case library;
and the output module is used for outputting the detection result to the version control system.
10. The system of claim 9, wherein the detection module comprises:
an increment code acquisition unit, configured to acquire an increment code according to the target code;
the test case calling unit is used for calling a target test case from the test case library according to the incremental code;
the test case running unit is used for running the target test case;
and the detection result generating unit is used for generating a detection result.
11. The system of claim 7, wherein the flow control module comprises:
a merge request acquisition unit for acquiring a merge request;
the judging unit is used for responding to the merging request and judging whether the detection result is qualified or not;
a merging unit for merging the target code into a target branch;
and the rejection unit is used for rejecting the target code to be combined into the target branch and issuing a rollback instruction so as to facilitate the developer to resubmit the modified target code.
12. A computer-readable storage medium storing a program, wherein the program is configured to implement the object code merging control method based on the version control flow according to any one of claims 1 to 6 when executed.
13. An electronic device, comprising a processor and a memory, wherein instructions stored in the memory are loaded and executed by the processor to implement a version control flow-based object code merging control method according to any one of claims 1 to 6.
CN201810565169.XA 2018-06-04 2018-06-04 Target code merging control method and system based on version control process Active CN108776643B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810565169.XA CN108776643B (en) 2018-06-04 2018-06-04 Target code merging control method and system based on version control process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810565169.XA CN108776643B (en) 2018-06-04 2018-06-04 Target code merging control method and system based on version control process

Publications (2)

Publication Number Publication Date
CN108776643A CN108776643A (en) 2018-11-09
CN108776643B true CN108776643B (en) 2021-10-22

Family

ID=64025666

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810565169.XA Active CN108776643B (en) 2018-06-04 2018-06-04 Target code merging control method and system based on version control process

Country Status (1)

Country Link
CN (1) CN108776643B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110297639B (en) * 2019-07-01 2023-03-21 北京百度网讯科技有限公司 Method and apparatus for detecting code
CN111399856A (en) * 2020-03-11 2020-07-10 山东汇贸电子口岸有限公司 File configuration editing method and system in service deployment
CN111783104B (en) * 2020-07-02 2021-04-06 北京自如信息科技有限公司 Vulnerability checking method, vulnerability checking method and device for continuous integrated codes
CN113126998B (en) * 2021-04-21 2023-11-07 北京字节跳动网络技术有限公司 Incremental source code acquisition method and device, electronic equipment and storage medium
CN113448614A (en) * 2021-06-29 2021-09-28 北京金山云网络技术有限公司 Software project code management method and device, storage medium and electronic equipment
CN113792026B (en) * 2021-08-11 2023-08-11 深圳力维智联技术有限公司 Method and device for deploying database script and computer-readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216696A (en) * 2008-01-03 2008-07-09 浙江中控技术股份有限公司 Control system configuration increment type on-line downloading method
CN104123149A (en) * 2013-04-28 2014-10-29 腾讯科技(深圳)有限公司 Software upgrading method, device, client and system
CN105404519A (en) * 2015-12-07 2016-03-16 青岛海信电器股份有限公司 Version control method, code testing method and system
CN106095681A (en) * 2016-06-14 2016-11-09 深圳市彬讯科技有限公司 A kind of SVN integrated JSHint code detection method and system thereof
CN107678773A (en) * 2017-09-28 2018-02-09 郑州云海信息技术有限公司 A kind of code development based on git and testing process management method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216696A (en) * 2008-01-03 2008-07-09 浙江中控技术股份有限公司 Control system configuration increment type on-line downloading method
CN104123149A (en) * 2013-04-28 2014-10-29 腾讯科技(深圳)有限公司 Software upgrading method, device, client and system
CN105404519A (en) * 2015-12-07 2016-03-16 青岛海信电器股份有限公司 Version control method, code testing method and system
CN106095681A (en) * 2016-06-14 2016-11-09 深圳市彬讯科技有限公司 A kind of SVN integrated JSHint code detection method and system thereof
CN107678773A (en) * 2017-09-28 2018-02-09 郑州云海信息技术有限公司 A kind of code development based on git and testing process management method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
干货|最佳实践:KIocwork增量/VerifyCI检查;wanglh5555;《http://www.360doc.com/content/17/0430/08/30774303_649740396.shtml》;20170430;第1-5页 *

Also Published As

Publication number Publication date
CN108776643A (en) 2018-11-09

Similar Documents

Publication Publication Date Title
CN108776643B (en) Target code merging control method and system based on version control process
AU2019203999B2 (en) Automating testing and deployment of software code changes
EP3769223B1 (en) Unified test automation system
US9311064B1 (en) Systems and methods for automated centralized build/merge management
CN110321254B (en) Software version rollback method, device, server and storage medium
US8078589B2 (en) Software merging utility
US20170372247A1 (en) Methods, systems, and articles of manufacture for implementing software application development and releases
CN107315689A (en) The Automation regression testing method of granularity is retrieved based on Git code files
US9542173B2 (en) Dependency handling for software extensions
CN111324522A (en) Automatic test system and method
CN111158730B (en) System updating method, device, electronic equipment and readable storage medium
CN110188049A (en) Container Management method, apparatus and electronic equipment
US20160179570A1 (en) Parallel Computing Without Requiring Antecedent Code Deployment
US20220326927A1 (en) Abort installation of firmware bundles
CN113434180B (en) Data processing method and device for application, server and storage medium
CN115220863A (en) Operation and maintenance method and device for container application, computer equipment and storage medium
US9760364B2 (en) Checks for software extensions
CN114237754A (en) Data loading method and device, electronic equipment and storage medium
CN110727575A (en) Information processing method, system, device and storage medium
WO2019099008A1 (en) Software builds using a cloud system
EP4007955A1 (en) Parallel cloned workflow execution
US20230393825A1 (en) Automated software deployment techniques
CN115237422A (en) Code compiling method, device, computer equipment and storage medium
CN113791977A (en) Code development processing method and device, electronic equipment and storage medium
CN110865806A (en) Code processing method, device, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant