CN106484606B - A kind of code submission method and apparatus - Google Patents
A kind of code submission method and apparatus Download PDFInfo
- Publication number
- CN106484606B CN106484606B CN201510552904.XA CN201510552904A CN106484606B CN 106484606 B CN106484606 B CN 106484606B CN 201510552904 A CN201510552904 A CN 201510552904A CN 106484606 B CN106484606 B CN 106484606B
- Authority
- CN
- China
- Prior art keywords
- code
- committed
- incremental
- task
- pass
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
Present applicant proposes a kind of codes to submit method and apparatus, this method comprises: obtaining the incremental code to be committed that preparation is submitted to code storage;The incremental code to be committed is detected;Submit the incremental code to be committed that passes through of detection to code storage, by first being detected before to code to submission code, it ensure that the accuracy for submitting code, and can find the problem as early as possible, do not interfere with other and need the program or process using the submission code.
Description
Technical field
The invention relates to field of communication technology, in particular to a kind of code submits method and apparatus.
Background technique
In the prior art, it is the change for monitoring appointment codes warehouse by tool, has fresh code to submit storage in discovery
When, the fresh code detection of code storage to local is triggered continuous integrating and executed according to configuration item and configuration step, but is triggered
The important prerequisite that continuous integrating executes is: code must really be submitted to code storage, otherwise will not trigger task
It executes.And the code of storage is submitted, if because build break or test execution unsuccessfully cause the task of continuous integrating to be lost
It loses, substantive influence is produced to other local Team Members to final test result and detection code, other
People or task must rely on this time unsuccessfully repair after, could normally continue to execute, this mode be unfavorable for finding the problem as early as possible and
The soft project principle of process cost is violated, in addition, this mode in code review (CR:Code Review, generation
Code examine) link be included in whole flow process, therefore not can guarantee submit code accuracy.
Summary of the invention
It is unfavorable for finding the problem as early as possible in the prior art, and does not can guarantee the defect of code accuracy, the application
Propose a kind of code submission method, comprising:
Obtain the incremental code to be committed that preparation is submitted to code storage;
The incremental code to be committed is detected;
Submit the incremental code to be committed that passes through of detection to the code storage.
Optionally, described that the incremental code to be committed is detected, it specifically includes:
Code inspection is carried out to the incremental code to be committed;
Task test is carried out to the incremental code to be committed.
If the code inspection passes through and task test passes through, it is determined that the detection to the incremental code to be committed
Pass through.
Optionally, described that code inspection is carried out to the incremental code to be committed, it specifically includes:
The incremental code to be committed is sent to multiple examiners to examine;
Receive the examination result of examiner's feedback;
Examination result be examined more than the examiner of predetermined number as described in incremental code to be committed pass through, it is determined that it is described
Incremental code to be committed passes.
Optionally, described that task test is carried out to the incremental code to be committed, it specifically includes:
Compiling is executed to the dependence code of the incremental code to be committed;
It is tested to the relying on progress appointed task when code executes compiling of the task;
It is tested to the relying on progress preset task after code compilation is completed of the task;
Obtain the task test result of appointed task and preset task;
If task test result is all to pass through, it is determined that pass through to the task test of the incremental code to be committed.
Optionally, the dependence code to the incremental code to be committed executes compiling, specifically includes:
Whether the dependence code for monitoring the incremental code to be committed changes;
Compile the dependence code changed;
There is no the corresponding library files of dependence code of variation to designated position for extraction, so as to the increasing to be committed
When amount code is compiled, the library file is directly quoted.
Optionally, task test is carried out, is specifically included:
Search task configuration text in store path address based on the incremental code to be committed designated position in repository
Part;
If not finding the task configuration file in designated position, the parent directory institute in the designated position is in place
It sets and searches the task configuration file, and carry out task test using the task configuration file found;
If finding the task configuration file in father path position, the newest task configuration text found is extracted
Part, and task test is carried out using the newest task configuration file extracted;
If not finding the task configuration file in father path position, appointed based on preset generic configuration
Business test.
Optionally, described submit detects the incremental code to be committed after passing through to the code storage, specifically includes:
Judgement detects the incremental code to be committed after passing through with the presence or absence of multiple;
If the determination result is YES, multiple incremental codes to be committed after detection passes through are judged whether there is and correspond to same source
Code, and the detection for corresponding to same source code pass through after multiple incremental codes to be committed progress code revisions position one
It causes;
If the determination result is YES, it is determined that the corresponding same source code, and multiple detections of the position consistency of code revision
Incremental code to be committed after is in the presence of conflict and to detect the incremental code to be committed after passing through;
It is carried out preferentially to multiple in the presence of conflicting and detecting the incremental code to be committed after passing through based on priority assessment factor
Grade assessment;
The priority orders obtained according to assessment are successively submitted from high to low to be had conflict and detects to be committed after passing through
Incremental code is to the code storage.
Optionally, the priority assessment factor includes the modification time modified to code, code revision line number, with
And code importance;
It is described to be carried out to multiple in the presence of conflicting and detecting the incremental code to be committed after passing through based on priority assessment factor
Priority assessment specifically includes:
Based on influence degree to each code importance progress for existing and conflicting and detecting the incremental code to be committed passed through
Assessment, and obtain each modification time and code revision line number that there is the incremental code to be committed that conflict and detection pass through;
Based on modification time, code revision line number and code importance come to it is each exist conflict and detection passes through to
The priority of incremental code is submitted to be assessed;
Each priority orders that there is the incremental code to be committed that conflict and detection pass through are determined based on assessment result.
The application also proposed a kind of code submission equipment, comprising:
Module is obtained, the incremental code to be committed submitted for obtaining preparation to code storage;
Detection module, for being detected to the incremental code to be committed;
Module is submitted, the incremental code to be committed for submitting detection to pass through to the code storage.
Optionally, the detection module, is specifically used for:
Code inspection is carried out to the incremental code to be committed;
Task test is carried out to the incremental code to be committed.
If the code inspection passes through and task test passes through, it is determined that the detection to the incremental code to be committed
Pass through.
Optionally, the detection module carries out code inspection to the incremental code to be committed, specifically includes:
The incremental code to be committed is sent to multiple examiners to examine;
Receive the examination result of examiner's feedback;
Examination result be examined more than the examiner of predetermined number as described in incremental code to be committed pass through, it is determined that it is described
Incremental code to be committed passes.
Optionally, the detection module carries out task test to the incremental code to be committed, specifically includes:
Compiling is executed to the dependence code of the incremental code to be committed;
It is tested to the relying on progress appointed task when code executes compiling of the task;
It is tested to the relying on progress preset task after code compilation is completed of the task;
Obtain the task test result of appointed task and preset task;
If task test result is all to pass through, it is determined that pass through to the task test of the incremental code to be committed.
Optionally, the detection module executes compiling to the dependence code of the incremental code to be committed, specifically includes:
Whether the dependence code for monitoring the incremental code to be committed changes;
Compile the dependence code changed;
There is no the corresponding library files of dependence code of variation to designated position for extraction, so as to the increasing to be committed
When amount code is compiled, the library file is directly quoted.
Optionally, the detection module carries out task test, specifically includes:
Search task configuration text in store path address based on the incremental code to be committed designated position in repository
Part;
If not finding the task configuration file in designated position, the parent directory institute in the designated position is in place
It sets and searches the task configuration file, and carry out task test using the task configuration file found;
If finding the task configuration file in father path position, the newest task configuration text found is extracted
Part, and task test is carried out using the newest task configuration file extracted;
If not finding the task configuration file in father path position, appointed based on preset generic configuration
Business test.
Optionally, the submission module, is specifically used for:
Judgement detects the incremental code to be committed after passing through with the presence or absence of multiple;
If the determination result is YES, multiple incremental codes to be committed after detection passes through are judged whether there is and correspond to same source
Code, and the detection for corresponding to same source code pass through after multiple incremental codes to be committed progress code revisions position one
It causes;
If the determination result is YES, it is determined that the corresponding same source code, and multiple detections of the position consistency of code revision
Incremental code to be committed after is in the presence of conflict and to detect the incremental code to be committed after passing through;
It is carried out preferentially to multiple in the presence of conflicting and detecting the incremental code to be committed after passing through based on priority assessment factor
Grade assessment;
The priority orders obtained according to assessment are successively submitted from high to low to be had conflict and detects to be committed after passing through
Incremental code is to the code storage.
Optionally, the priority assessment factor includes the modification time modified to code, code revision line number, with
And code importance;
It is described to submit module based on priority assessment factor to multiple increments to be committed for existing and conflicting and detecting after passing through
Code carries out priority assessment, specifically includes:
Based on influence degree to each code importance progress for existing and conflicting and detecting the incremental code to be committed passed through
Assessment, and obtain each modification time and code revision line number that there is the incremental code to be committed that conflict and detection pass through;
Based on modification time, code revision line number and code importance come to it is each exist conflict and detection passes through to
The priority of incremental code is submitted to be assessed;
Each priority orders that there is the incremental code to be committed that conflict and detection pass through are determined based on assessment result.
Compared with prior art, the incremental code to be committed submitted by obtaining preparation to code storage in the application;It is right
The incremental code to be committed is detected;Submit the incremental code to be committed for detecting and passing through to the code storage, thus
It submits and first code is detected before code, ensure that the accuracy for submitting code, and can find the problem as early as possible, Bu Huiying
Ring the program or process needed to other using the submission code.
Detailed description of the invention
Fig. 1 is the flow diagram that a kind of code that the application proposes submits method;
Fig. 2 is the result schematic diagram that a kind of code that the application proposes submits equipment.
Specific embodiment
Such as background technique, risk assessment scheme in the prior art can not accurate evaluation risk, for this purpose, in the application in order to
Risk is preferably assessed, proposes a kind of code submission method, as shown in Figure 1, comprising the following steps:
Step 101 obtains the incremental code to be committed that preparation is submitted to code storage.
In a specific application scenarios, after user has modified code, it can prepare and submit the code to code storage,
Also it is possible thereby to the incremental code to be committed that modified preparation is submitted to code storage be obtained, as other generations unlike this
Code, then be not carried out the operation of acquisition.
Step 102 detects incremental code to be committed.
After getting incremental code to be committed, it is necessary to detect to incremental code to be committed, and specifically examine
Survey include: to incremental code to be committed carry out code inspection and to incremental code to be committed carry out task test, namely including with
Lower two processes:
(1), code inspection is carried out to incremental code to be committed:
Incremental code to be committed is sent to multiple examiners to examine;Receive the examination result of examiner's feedback;Such as
Examination result is to examine that incremental code to be committed passes through more than the examiner of predetermined number, it is determined that incremental code to be committed examines
Pass through.
Specifically, incremental code to be committed, which is sent to examiner after examiner examines the incremental code to be committed, to be given
Examination result out, by or do not pass through, and in order to guarantee the accuracy examined, can preset only is being more than predetermined number
Examiner passes, such as can be set to 2 examiners and pass, then can determine that the incremental code to be committed is logical
It crosses.
(2), task test is carried out to incremental code to be committed, specifically included:
Compiling is executed to the dependence code of incremental code to be committed;Appointed task is carried out when to code execution compiling is relied on
Task test;It is tested to the relying on progress preset task after code compilation is completed of the task;It obtains appointed task and presets
The task test result of task;If task test result is all to pass through, it is determined that test the task of incremental code to be committed
Pass through.
Some test assignments need to carry out task test, such as UT (Unit Test, unit testing) when being compiled,
It needs to carry out task test again after compiling is completed there are also some, such as (Build Verification Test, smolders BVT
Test), it is specifically selected corresponding opportunity to carry out task test according to the characteristic of its test assignment, no longer gone to live in the household of one's in-laws on getting married herein
It chats, and task test is by needing the result of the task test of all progress all to pass through.
Compiling is executed to the dependence code of incremental code to be committed, is specifically included:
Whether the dependence code for monitoring incremental code to be committed changes;Compile the dependence code changed;It mentions
Take that there is no the corresponding library files of dependence code of variation to designated position, to be compiled to incremental code to be committed
When, directly quote library file.
Specific compiling do not need to carry out the compiling of full dose, realizes since incremental code to be committed can quote certain codes
Corresponding function, the code being cited is the dependence code of incremental code to be committed, also as a result, when being compiled, is only needed
The dependence code changed is compiled, to there is no the dependence code of variation, can directly extract and rely on code
For library file to designated position, the process without executing compiling reduces money with this while the realization that ensure that function
The consumption in source and improve efficiency.
And specifically, progress task test, specifically includes:
Based on incremental code to be committed store path address (subsequent incremental code to be committed according to store path address into
The submission process of line code) task configuration file is searched in designated position in repository;Take office if not searched in designated position
Business configuration file is then searched task configuration file in the parent directory position of designated position, and is matched using finding for task
It sets file and carries out task test;If finding task configuration file in father path position, newest found is extracted
Business configuration file, and the newest task configuration file extracted is utilized to carry out task test;If not looked into father path position
Task configuration file is found, task test is carried out based on preset generic configuration.
Specifically, due to needing to carry out task test according to task configuration file, and before testing for task is possible to
It has been carried out that, therefore there can be task configuration file, task configuration file before can use in the case carries out
Task test, and if carried out task test before, task configuration file, which can have specified position, (can be based on to be committed
The store path address search of incremental code is arrived) or designated position parent directory position, therefore first looked into designated position
It looks for, if finding, task test is carried out according to task configuration file;If not finding, looked into parent directory position
It looks for, namely is searched in the position where upper one layer of designated position, if finding, matched based on the newest task found
It sets file and carries out task test;If task test was not carried out before, namely there is no task configuration files, in this situation
Under, so that it may task test is carried out based on generic configuration.
So by carrying out carrying out incremental code to be committed code inspection and task test to incremental code to be committed,
When code passes and task test passes through, determination passes through the detection of incremental code to be committed.
Specifically, after step 102 detects incremental code to be committed, can there are two types of as a result, detection pass through or
Do not pass through, if detection passes through, if thening follow the steps 103, detection does not pass through, end operation and/or is detected and do not pass through announcement
It is alert.
Step 103, the incremental code to be committed for submitting detection to pass through.
Incremental code to be committed due to can only submit detection to pass through specifically submits process to the code storage
Include:
Judgement detects the incremental code to be committed after passing through with the presence or absence of multiple;If the determination result is YES, judge whether to deposit
Multiple incremental codes to be committed after detection passes through correspond to same source code, and the detection for corresponding to same source code passes through
Multiple incremental codes to be committed afterwards carry out the position consistency of code revision;If the determination result is YES, it is determined that correspondence is same
Source code, and multiple detections of the position consistency of code revision pass through after incremental code to be committed to there is conflict and detection is logical
Later incremental code to be committed;Based on priority assessment factor to multiple increments to be committed for existing and conflicting and detecting after passing through
Code carries out priority assessment;The priority orders obtained according to assessment are successively submitted to there is conflict and detect from high to low to be passed through
Incremental code to be committed afterwards is to the code storage.
Specifically, the position one that by multiple revisers while may be modified due to being likely to occur same source code, and modify
It causes (lines of code specially modified, such as modifying all is the 7th row), multiple incremental codes to be committed can be generated in this way, and more
A incremental code to be committed corresponds to same source code, in the case, due to being between this multiple incremental code to be committed
There are conflicts, priority assessment can be carried out to multiple incremental codes to be committed in the case, to determine the height of priority
It is low, the sequence of submission is finally just determined priority-based, in a specific embodiment, the assessment factor of priority
It may include the modification time modified to code, code revision line number and code importance;Specifically, if other two
A factor is consistent, and modification time is more early, and corresponding priority is higher;Higher (namely the shadow of modified code of code importance
The degree of sound is bigger), corresponding priority is higher;Code revision line number is more, and corresponding priority is higher;In the case, base
It is specific to wrap in priority assessment factor to multiple incremental code to be committed progress priority assessments that there is conflict and detection and pass through
It includes:
Based on influence degree to each code importance progress for existing and conflicting and detecting the incremental code to be committed passed through
Assessment, and obtain each modification time and code revision line number that there is the incremental code to be committed that conflict and detection pass through;
Based on modification time, code revision line number and code importance are come to each increment to be committed that there is conflict and detection and pass through
The priority of code is assessed;The incremental code to be committed that each presence conflict and detection pass through is determined based on assessment result
Priority orders;Specifically, can use a formula Σ P=(C, K, T) to be assessed, specifically, C is code revision row
Number, K are code importance (influence degree for being embodied as modified code), and T is time factor, initial baseline value 1,
According to the Bit-reversed of submission time, the value of T is according to 2(n-1)Be incremented by, with this by these three because usually to it is multiple presence conflicts
And the priority ∑ P for detecting the incremental code to be committed after passing through is assessed.
In order to which the application is further detailed, the embodiment of the present application two also discloses the generation under a kind of concrete scene
Code is submitted, and is included the following steps;
Step 1, Review Board (i.e. examination plate, belong to a part of entire server) obtains user and has modified code
Afterwards, the modified code uploaded by RBT Client (RBT client), specifically, after modified code request is to modification
The audit request that is examined of code, Review Board is that the request distributes an examination ID (Review ID), and should
Review ID returns to RBT Client, so that RBT Client is by the Review ID and other modified code mark
Knowledge is sent to Task Server (task server).
Modified code is sent to multiple examiners and examined, and obtains examiner by step 2, Review Board
Examination result (pass or examine and do not pass through), while Task Server be based on Review ID poll Review Board
Examination result is obtained, if it is to pass through that examination result, which is the examination result for having 2 or more than two examiner, can determine code
It passes.
Within a particular process, examiner is after finishing examination, gives the label passed, and examiner can be with
An effective+1ship it label is provided, requirement can be set has+2 label just to calculate this and pass, from there through looking into
Ship it is ask to determine whether to pass.
Configuration file needed for step 3, Task Server obtain test assignment, and configuration file is sent to CISE
(Continuous Integration Servevice Engine, continuous integrating service execution engine), so that CISE is based on matching
File is set to execute task test, and test result is returned into Task Server, Task Server is receiving test knot
It is stored in the database after fruit.
Task Server is based on marking code, such as difference file, source identifier code, and version server etc. restores modification
Code afterwards, it is of course also possible to modified code is directly acquired, but in view of original code may be long, with recovery
Mode efficiency is higher, has saved resource, after imparting modified code, searches configuration file (Yaml relevant to task
Configuration file), wherein specifically include following three kinds of situations:
One, first from the script bank of SVN/Git, detection designated position whether there is Yaml configuration file, and if it exists, press
Configuration file executes entire task like this;
If two, Yaml configuration file is not present in designated position, first according to the address SVN/Git, according to the father of designated position
Path (only arriving this level-one bibliographic structure of trunk or branches) is searched in the repository that Task Server is safeguarded,
If there is the configuration of corresponding parent directory, then newest rule configuration matching as this new addition task under parent directory is obtained automatically
Set use;
Three, for there is no the tasks of any configuration, then common tasks configuration rule is obtained, from database with default
Executing rule is handled.Wherein, default configuration rule is to discriminate between language environment, and concrete syntax environment is according to RBT Client
The acquisition of information of transmitting;
Specifically, also include compiling in task, specifically when preparing compiling, first obtain determine modified code according to
Rely the alteration of code, can specifically be judged based on change timestamp, is seen whether unanimously, if unanimously, illustrating not
It changes, is generated most based on makefile (be wherein stored with the mark of modified code and rely on the relationship between code)
The operation for generating dependence library by compiling before is replaced with the library file of specified path by the configuration copy of new makefile,
Meanwhile dynamic updates Yaml configuration file (the configuration copy of makefile being utilized, task has sent variation), downloads library file
To specified path, it is consistent with makefile configuration copy;For there is a situation where changing, then keeping each configuration item constant,
Compiling building process is executed according to dependence sequence;
After CISE task execution, the library file that newest compiling generates is uploaded to OSS (Open Storage
Service it) in cloud space, is stored according to the form of filename+Unix timestamp, while compiling module information and the time of generation
The form that stamp (namely mark) can go here and there with JSON is updated by Save interface into database, as follow-up work execution according to
According to JSON string data partial content and format are as follows:
Task test result in step 4, Task Server polling data library can submit this to repair if passing
Code after changing.
Certainly when needing to submit code, during pre- submit, namely carried out that code inspection passes through and task is surveyed
Pinged, if discovery for the corresponding source code of the modified code there are also other codes changes it is synchronous occur it is (namely more
A corresponding same source code of code change, and the position consistency modified), and the change of multiple codes also all passes
Pass through with task test, for the scene, the application from modify to code modification time (T), change complexity (C)
With three combined factors comparisons of critical path impact (K), wherein change complexity is embodied as code revision line number, code
It is more to modify line number, change complexity is higher;And code importance is then presented as in critical path impact, calculates vector according to formula
Mould length judges priority: Σ P=(C, K, T), in which: complexity C is using code revision line number as judgment basis for change;Critical path
Diameter influences the method number to change influence as judgment basis, and the method number for changing influence is more, corresponding, is presented as generation
Code importance is higher;For time factor T, then be forward submission its larger initial baseline value of task value be 1, multiple tasks
Between according to submission time Bit-reversed, the value of T is according to 2(n-1)It is incremented by, to guarantee that forward task is preferentially submitted;This
It sentences concurrently to submit two of the associated documents of same block code and be illustrated for example, the increment of first submission task
Lines of code is 20, influence method number be 2, T value be 2 (a reference value 1, inverted order arrangement);The increasing of second submission task
Measuring lines of code is 20, and it is 1 that influence method number, which be 6, T value,.Calculating the long formula of vector field homoemorphism isIt can determine that the code of second submission task is preferentially submitted according to calculated result.
The embodiment of the present application also discloses a kind of code submission equipment, as shown in Figure 2, comprising:
Module 201 is obtained, the incremental code to be committed submitted for obtaining preparation to code storage;
Detection module 202, for being detected to the incremental code to be committed;
Module 203 is submitted, the incremental code to be committed for submitting detection to pass through to the code storage.
The detection module 202, is specifically used for:
Code inspection is carried out to the incremental code to be committed;
Task test is carried out to the incremental code to be committed.
If the code inspection passes through and task test passes through, it is determined that the detection to the incremental code to be committed
Pass through.
The detection module 202 carries out code inspection to the incremental code to be committed, specifically includes:
The incremental code to be committed is sent to multiple examiners to examine;
Receive the examination result of examiner's feedback;
Examination result be examined more than the examiner of predetermined number as described in incremental code to be committed pass through, it is determined that it is described
Incremental code to be committed passes.
The detection module 202 carries out task test to the incremental code to be committed, specifically includes:
Compiling is executed to the dependence code of the incremental code to be committed;
It is tested to the relying on progress appointed task when code executes compiling of the task;
It is tested to the relying on progress preset task after code compilation is completed of the task;
Obtain the task test result of appointed task and preset task;
If task test result is all to pass through, it is determined that pass through to the task test of the incremental code to be committed.
The detection module 202 executes compiling to the dependence code of the incremental code to be committed, specifically includes:
Whether the dependence code for monitoring the incremental code to be committed changes;
Compile the dependence code changed;
There is no the corresponding library files of dependence code of variation to designated position for extraction, so as to the increasing to be committed
When amount code is compiled, the library file is directly quoted.
The detection module 202 carries out task test, specifically includes:
Search task configuration text in store path address based on the incremental code to be committed designated position in repository
Part;
If not finding the task configuration file in designated position, the parent directory institute in the designated position is in place
It sets and searches the task configuration file, and carry out task test using the task configuration file found;
If finding the task configuration file in father path position, the newest task configuration text found is extracted
Part, and task test is carried out using the newest task configuration file extracted;
If not finding the task configuration file in father path position, appointed based on preset generic configuration
Business test.
Module 203 is submitted, is specifically used for:
Judgement detects the incremental code to be committed after passing through with the presence or absence of multiple;
If the determination result is YES, multiple incremental codes to be committed after detection passes through are judged whether there is and correspond to same source
Code, and the detection for corresponding to same source code pass through after multiple incremental codes to be committed progress code revisions position one
It causes;
If the determination result is YES, it is determined that the corresponding same source code, and multiple detections of the position consistency of code revision
Incremental code to be committed after is in the presence of conflict and to detect the incremental code to be committed after passing through;
It is carried out preferentially to multiple in the presence of conflicting and detecting the incremental code to be committed after passing through based on priority assessment factor
Grade assessment;
The priority orders obtained according to assessment are successively submitted from high to low to be had conflict and detects to be committed after passing through
Incremental code is to the code storage.
The priority assessment factor includes the modification time modified to code, code revision line number and code
Importance;
The submission module 203 submit module based on priority assessment factor to it is multiple exist conflict and after detection passes through
Incremental code to be committed carries out priority assessment, specifically includes:
Based on influence degree to each code importance progress for existing and conflicting and detecting the incremental code to be committed passed through
Assessment, and obtain each modification time and code revision line number that there is the incremental code to be committed that conflict and detection pass through;
Based on modification time, code revision line number and code importance come to it is each exist conflict and detection passes through to
The priority of incremental code is submitted to be assessed;
Each priority orders that there is the incremental code to be committed that conflict and detection pass through are determined based on assessment result.
Compared with prior art, in the application after obtaining incremental code to be committed, can to incremental code to be committed into
Row detection, only detecting the incremental code to be committed after passing through again can just submit, so that after code is submitted, ensure that and mentioned
The accuracy for handing over code, and can find the problem as early as possible, do not interfere with other need using the submission code program or
Process.
Through the above description of the embodiments, those skilled in the art can be understood that the application can lead to
Hardware realization is crossed, the mode of necessary general hardware platform can also be added to realize by software.Based on this understanding, this Shen
Technical solution please can be embodied in the form of software products, which can store in a non-volatile memories
In medium (can be CD-ROM, USB flash disk, mobile hard disk etc.), including some instructions are used so that a computer equipment (can be
Personal computer, server or network equipment etc.) execute method described in each implement scene of the application.
It will be appreciated by those skilled in the art that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, module in attached drawing or
Process is not necessarily implemented necessary to the application.
It will be appreciated by those skilled in the art that the module in device in implement scene can be described according to implement scene into
Row is distributed in the device of implement scene, can also be carried out corresponding change and is located at the one or more dresses for being different from this implement scene
In setting.The module of above-mentioned implement scene can be merged into a module, can also be further split into multiple submodule.
Above-mentioned the application serial number is for illustration only, does not represent the superiority and inferiority of implement scene.
Disclosed above is only several specific implementation scenes of the application, and still, the application is not limited to this, Ren Heben
What the technical staff in field can think variation should all fall into the protection scope of the application.
Claims (12)
1. a kind of code submits method characterized by comprising
Obtain the incremental code to be committed that preparation is submitted to code storage;
The incremental code to be committed is detected, is specifically included: code inspection is carried out to the incremental code to be committed, it is right
The incremental code to be committed carries out task test, if the code inspection passes through and task test passes through, it is determined that right
The detection of the incremental code to be committed passes through;
Submit the incremental code to be committed that passes through of detection to the code storage;
Wherein, described that task test is carried out to the incremental code to be committed, it specifically includes:
Compiling is executed to the dependence code of the incremental code to be committed;
It is tested to the relying on progress appointed task when code executes compiling of the task;
It is tested to the relying on progress preset task after code compilation is completed of the task;
Obtain the task test result of appointed task and preset task;
If task test result is all to pass through, it is determined that pass through to the task test of the incremental code to be committed.
2. the method as described in claim 1, which is characterized in that it is described that code inspection is carried out to the incremental code to be committed,
It specifically includes:
The incremental code to be committed is sent to multiple examiners to examine;
Receive the examination result of examiner's feedback;
Examination result be examined more than the examiner of predetermined number as described in incremental code to be committed pass through, it is determined that it is described wait mention
Incremental code is handed over to pass.
3. the method as described in claim 1, which is characterized in that the dependence code to the incremental code to be committed executes
Compiling, specifically includes:
Whether the dependence code for monitoring the incremental code to be committed changes;
Compile the dependence code changed;
There is no the corresponding library files of dependence code of variation to designated position for extraction, so as to the increment generation to be committed
When code is compiled, the library file is directly quoted.
4. the method as described in claim 1, which is characterized in that carry out task test, specifically include:
Search task configuration file in store path address based on the incremental code to be committed designated position in repository;
If not finding the task configuration file in designated position, looked into the parent directory position of the designated position
The task configuration file is looked for, and carries out task test using the task configuration file found;
If finding the task configuration file in father path position, the newest task configuration file found is extracted,
And task test is carried out using the newest task configuration file extracted;
If not finding the task configuration file in father path position, task survey is carried out based on preset generic configuration
Examination.
5. the method as described in claim 1, which is characterized in that described submit detects the incremental code to be committed after passing through to institute
Code storage is stated, is specifically included:
Judgement detects the incremental code to be committed after passing through with the presence or absence of multiple;
If the determination result is YES, multiple incremental codes to be committed after detection passes through are judged whether there is and correspond to same source generation
Code, and the detection for corresponding to same source code pass through after multiple incremental codes to be committed progress code revisions position consistency;
If the determination result is YES, it is determined that the corresponding same source code, and multiple detections of the position consistency of code revision pass through
Incremental code to be committed afterwards is in the presence of conflict and to detect the incremental code to be committed after passing through;
It is commented in the presence of conflicting and detecting the incremental code to be committed progress priority after passing through based on priority assessment factor multiple
Estimate;
The priority orders obtained according to assessment are successively submitted from high to low to be had conflict and detects the increment to be committed after passing through
Code is to the code storage.
6. method as claimed in claim 5, which is characterized in that the priority assessment factor includes modifying to code
Modification time, code revision line number and code importance;
It is described to be carried out preferentially to multiple in the presence of conflicting and detecting the incremental code to be committed after passing through based on priority assessment factor
Grade assessment, specifically includes:
Each code importance that there is the incremental code to be committed that conflict and detection pass through is assessed based on influence degree,
And obtain each modification time and code revision line number that there is the incremental code to be committed that conflict and detection pass through;
Based on modification time, code revision line number and code importance come to it is each exist conflict and detection pass through it is to be committed
The priority of incremental code is assessed;
Each priority orders that there is the incremental code to be committed that conflict and detection pass through are determined based on assessment result.
7. a kind of code submits equipment characterized by comprising
Module is obtained, the incremental code to be committed submitted for obtaining preparation to code storage;
Detection module is specifically used for for detecting to the incremental code to be committed: to the incremental code to be committed into
Line code examines, carries out task test to the incremental code to be committed, if the code inspection passes through and the task is tested
Pass through, it is determined that the detection of the incremental code to be committed is passed through;
Module is submitted, the incremental code to be committed for submitting detection to pass through to code storage;
The detection module carries out task test to the incremental code to be committed, specifically includes:
Compiling is executed to the dependence code of the incremental code to be committed;
It is tested to the relying on progress appointed task when code executes compiling of the task;
It is tested to the relying on progress preset task after code compilation is completed of the task;
Obtain the task test result of appointed task and preset task;
If task test result is all to pass through, it is determined that pass through to the task test of the incremental code to be committed.
8. equipment as claimed in claim 7, which is characterized in that the detection module carries out generation to the incremental code to be committed
Code examines, specifically includes:
The incremental code to be committed is sent to multiple examiners to examine;
Receive the examination result of examiner's feedback;
Examination result be examined more than the examiner of predetermined number as described in incremental code to be committed pass through, it is determined that it is described wait mention
Incremental code is handed over to pass.
9. equipment as claimed in claim 7, which is characterized in that dependence of the detection module to the incremental code to be committed
Code executes compiling, specifically includes:
Whether the dependence code for monitoring the incremental code to be committed changes;
Compile the dependence code changed;
There is no the corresponding library files of dependence code of variation to designated position for extraction, so as to the increment generation to be committed
When code is compiled, the library file is directly quoted.
10. equipment as claimed in claim 7, which is characterized in that the detection module carries out task test, specifically includes:
Search task configuration file in store path address based on the incremental code to be committed designated position in repository;
If not finding the task configuration file in designated position, looked into the parent directory position of the designated position
The task configuration file is looked for, and carries out task test using the task configuration file found;
If finding the task configuration file in father path position, the newest task configuration file found is extracted,
And task test is carried out using the newest task configuration file extracted;
If not finding the task configuration file in father path position, task survey is carried out based on preset generic configuration
Examination.
11. equipment as claimed in claim 7, which is characterized in that the submission module is specifically used for:
Judgement detects the incremental code to be committed after passing through with the presence or absence of multiple;
If the determination result is YES, multiple incremental codes to be committed after detection passes through are judged whether there is and correspond to same source generation
Code, and the detection for corresponding to same source code pass through after multiple incremental codes to be committed progress code revisions position consistency;
If the determination result is YES, it is determined that the corresponding same source code, and multiple detections of the position consistency of code revision pass through
Incremental code to be committed afterwards is in the presence of conflict and to detect the incremental code to be committed after passing through;
It is commented in the presence of conflicting and detecting the incremental code to be committed progress priority after passing through based on priority assessment factor multiple
Estimate;
The priority orders obtained according to assessment are successively submitted from high to low to be had conflict and detects the increment to be committed after passing through
Code is to the code storage.
12. equipment as claimed in claim 11, which is characterized in that the priority assessment factor includes modifying to code
Modification time, code revision line number and code importance;
It is described to submit module based on priority assessment factor to multiple incremental codes to be committed for existing and conflicting and detecting after passing through
Priority assessment is carried out, is specifically included:
Each code importance that there is the incremental code to be committed that conflict and detection pass through is assessed based on influence degree,
And obtain each modification time and code revision line number that there is the incremental code to be committed that conflict and detection pass through;
Based on modification time, code revision line number and code importance come to it is each exist conflict and detection pass through it is to be committed
The priority of incremental code is assessed;
Each priority orders that there is the incremental code to be committed that conflict and detection pass through are determined based on assessment result.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510552904.XA CN106484606B (en) | 2015-09-01 | 2015-09-01 | A kind of code submission method and apparatus |
PCT/CN2016/096585 WO2017036335A1 (en) | 2015-09-01 | 2016-08-24 | Code submitting method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510552904.XA CN106484606B (en) | 2015-09-01 | 2015-09-01 | A kind of code submission method and apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106484606A CN106484606A (en) | 2017-03-08 |
CN106484606B true CN106484606B (en) | 2019-07-26 |
Family
ID=58188450
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510552904.XA Active CN106484606B (en) | 2015-09-01 | 2015-09-01 | A kind of code submission method and apparatus |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106484606B (en) |
WO (1) | WO2017036335A1 (en) |
Families Citing this family (34)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106933591A (en) * | 2017-03-15 | 2017-07-07 | 东软集团股份有限公司 | The method and device that code merges |
CN107122218A (en) * | 2017-03-30 | 2017-09-01 | 北京深思数盾科技股份有限公司 | A kind of software development methodology and system |
CN107908420A (en) * | 2017-11-16 | 2018-04-13 | 泰康保险集团股份有限公司 | A kind of code process method, apparatus and system |
CN108089984A (en) * | 2017-12-14 | 2018-05-29 | 泰康保险集团股份有限公司 | Implementation method, device, storage medium and the electronic equipment of code review |
CN108334313A (en) * | 2017-12-27 | 2018-07-27 | 苏州中晟宏芯信息科技有限公司 | Continuous integrating method, apparatus and code management system for large-scale SOC research and development |
CN108733366A (en) * | 2018-05-22 | 2018-11-02 | 深圳Tcl新技术有限公司 | The method, apparatus and computer readable storage medium of software product release code |
CN109002294A (en) * | 2018-07-16 | 2018-12-14 | 浪潮电子信息产业股份有限公司 | Code examination method, device, equipment and readable storage medium |
CN109240734A (en) * | 2018-07-17 | 2019-01-18 | 北京奇虎科技有限公司 | Code submits method and device |
CN109726114A (en) * | 2018-09-07 | 2019-05-07 | 网联清算有限公司 | Code quality management-control method, device and electronic equipment |
CN109359438A (en) * | 2018-09-20 | 2019-02-19 | 摩尔元数(厦门)科技有限公司 | Web terminal realizes the method and MC-Studio plug-in unit of code open source |
CN109491663A (en) * | 2018-11-01 | 2019-03-19 | 北京车和家信息技术有限公司 | Code inspection method and device |
CN109783128A (en) * | 2018-12-13 | 2019-05-21 | 平安普惠企业管理有限公司 | Code change notification method, equipment, storage medium and device |
CN109634865B (en) * | 2018-12-13 | 2024-03-22 | 平安科技(深圳)有限公司 | Code transfer testing method and device and transfer testing terminal |
CN111338632A (en) * | 2018-12-19 | 2020-06-26 | 中国移动通信集团湖南有限公司 | Cloud platform mirror image construction method and device |
CN111382049B (en) * | 2018-12-28 | 2023-05-02 | 阿里云计算有限公司 | Code submitting method and device and electronic equipment |
CN110866730B (en) * | 2018-12-29 | 2023-11-21 | 北京安妮全版权科技发展有限公司 | Code checking system and method |
CN110377497A (en) * | 2019-05-27 | 2019-10-25 | 深圳壹账通智能科技有限公司 | Code detection method, device, computer installation and storage medium |
CN110704298A (en) * | 2019-08-23 | 2020-01-17 | 北京奇艺世纪科技有限公司 | Code verification method and device, terminal equipment and storage medium |
CN110825427B (en) * | 2019-10-12 | 2024-01-26 | 天航长鹰(江苏)科技有限公司 | Code management method, device, server and storage medium |
CN112905224B (en) * | 2019-12-04 | 2024-04-30 | 阿里巴巴集团控股有限公司 | Time-consuming determination method, device and equipment for code review |
CN111399856A (en) * | 2020-03-11 | 2020-07-10 | 山东汇贸电子口岸有限公司 | File configuration editing method and system in service deployment |
CN111427543B (en) * | 2020-03-23 | 2023-08-11 | 中国建设银行股份有限公司 | Processing method and device for software product development |
CN111541563A (en) * | 2020-04-17 | 2020-08-14 | 成都千立网络科技有限公司 | System and method for orderly effective configuration |
CN113688028B (en) * | 2020-05-19 | 2023-08-15 | 成都鼎桥通信技术有限公司 | Code submitting method and device |
CN111610999A (en) * | 2020-05-26 | 2020-09-01 | 北京字节跳动网络技术有限公司 | Checking method, checking device, computer equipment and storage medium |
CN112083927B (en) * | 2020-07-06 | 2023-06-30 | 宁波三星医疗电气股份有限公司 | Method for acquiring SVN version information of software in power acquisition terminal on site |
CN112068895B (en) * | 2020-08-10 | 2023-12-19 | 深圳市鼎盛光电有限公司 | Code configuration method, device, video playing equipment and storage medium |
CN112558981B (en) * | 2020-12-23 | 2024-02-06 | 上海万向区块链股份公司 | Custom compiling and deploying method and system based on jenkinsfile |
CN113094066B (en) * | 2021-03-16 | 2024-03-26 | 北京优奥创思科技发展有限公司 | Multi-server code release method and system |
CN113031960B (en) * | 2021-03-18 | 2024-04-30 | 北京达佳互联信息技术有限公司 | Code compiling method, device, server and storage medium |
CN113126998B (en) * | 2021-04-21 | 2023-11-07 | 北京字节跳动网络技术有限公司 | Incremental source code acquisition method and device, electronic equipment and storage medium |
CN113535206B (en) * | 2021-07-23 | 2024-02-20 | 上海幻电信息科技有限公司 | Multi-version code upgrading method and system |
CN115114626B (en) * | 2022-08-26 | 2022-12-30 | 国网江西省电力有限公司电力科学研究院 | Industrial equipment code detection method, system, computer equipment and storage medium |
CN115374762B (en) * | 2022-10-26 | 2023-05-26 | 深圳市明源云采购科技有限公司 | Code template sharing method and device based on VS code, electronic equipment and medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103645985A (en) * | 2013-11-28 | 2014-03-19 | 广州视源电子科技股份有限公司 | Source code macro-pairing detection method |
CN103677831A (en) * | 2013-12-12 | 2014-03-26 | 迈普通信技术股份有限公司 | On-line code inspection system and method |
CN104809071A (en) * | 2015-05-14 | 2015-07-29 | 北京润科通用技术有限公司 | Code testing method and device |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100495331C (en) * | 2007-10-31 | 2009-06-03 | 金蝶软件(中国)有限公司 | Construction method, device and system |
CN101963911B (en) * | 2010-09-29 | 2015-12-16 | 用友网络科技股份有限公司 | Patch generates method and apparatus |
CN102012814B (en) * | 2010-11-24 | 2015-07-22 | 中兴通讯股份有限公司 | Construction method and system for software version |
WO2013078269A1 (en) * | 2011-11-22 | 2013-05-30 | Solano Labs, Inc. | System of distributed software quality improvement |
CN103390183B (en) * | 2012-05-09 | 2019-07-19 | 顾泽苍 | A kind of generation method of the anti-counterfeiting codes suitable for handset identity |
CN104077140B (en) * | 2014-07-04 | 2017-11-07 | 用友网络科技股份有限公司 | Automation Compilation Method and compilation device for continuous integrating |
-
2015
- 2015-09-01 CN CN201510552904.XA patent/CN106484606B/en active Active
-
2016
- 2016-08-24 WO PCT/CN2016/096585 patent/WO2017036335A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103645985A (en) * | 2013-11-28 | 2014-03-19 | 广州视源电子科技股份有限公司 | Source code macro-pairing detection method |
CN103677831A (en) * | 2013-12-12 | 2014-03-26 | 迈普通信技术股份有限公司 | On-line code inspection system and method |
CN104809071A (en) * | 2015-05-14 | 2015-07-29 | 北京润科通用技术有限公司 | Code testing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN106484606A (en) | 2017-03-08 |
WO2017036335A1 (en) | 2017-03-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106484606B (en) | A kind of code submission method and apparatus | |
Da Costa et al. | A framework for evaluating the results of the szz approach for identifying bug-introducing changes | |
US9703692B2 (en) | Development supporting system | |
CN104077217B (en) | The compiling dissemination method and system of code file | |
US8799869B2 (en) | System for ensuring comprehensiveness of requirements testing of software applications | |
US20130041900A1 (en) | Script Reuse and Duplicate Detection | |
US10303469B1 (en) | Commit graph generation | |
US8713554B1 (en) | Automated hotfix handling model | |
US10489124B2 (en) | Method and system for providing software containers supporting executable code created from computational algorithms described in printed publications | |
KR20190031030A (en) | Method and system for identifying an open source software package based on binary files | |
US20160292062A1 (en) | System and method for detection of duplicate bug reports | |
CN109840194A (en) | A kind of detection method and system of configuration file | |
CN103955429B (en) | Determine the method and device of regression test scope | |
CN110221933A (en) | Aacode defect assists restorative procedure and system | |
CN111654495B (en) | Method, apparatus, device and storage medium for determining traffic generation source | |
CN103064780B (en) | A kind of method of software test and device | |
CN111597069A (en) | Program processing method, program processing apparatus, electronic device, and storage medium | |
KR20190020363A (en) | Method and apparatus for analyzing program by associating dynamic analysis with static analysis | |
Agrawal et al. | Ruffle: Extracting co-change information from software project repositories | |
CN111338632A (en) | Cloud platform mirror image construction method and device | |
TWI735511B (en) | Code submission method and equipment | |
Moyo et al. | A metasynthesis of solo software development methodologies | |
CN113031995B (en) | Rule updating method and device, storage medium and electronic equipment | |
CN109558153B (en) | Method, device and system for determining version consistency | |
JP2019521406A (en) | Method of evaluating information search accuracy, system, device, and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20201112 Address after: Room 603, 6 / F, Roche Plaza, 788 Cheung Sha Wan Road, Kowloon, China Patentee after: Zebra smart travel network (Hong Kong) Limited Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands Patentee before: Alibaba Group Holding Ltd. |