[go: up one dir, main page]

TW201828053A - Code submission method and device that conducts inspection on a code to be submitted before the code in finally submitted - Google Patents

Code submission method and device that conducts inspection on a code to be submitted before the code in finally submitted Download PDF

Info

Publication number
TW201828053A
TW201828053A TW106101938A TW106101938A TW201828053A TW 201828053 A TW201828053 A TW 201828053A TW 106101938 A TW106101938 A TW 106101938A TW 106101938 A TW106101938 A TW 106101938A TW 201828053 A TW201828053 A TW 201828053A
Authority
TW
Taiwan
Prior art keywords
code
submitted
incremental
task
review
Prior art date
Application number
TW106101938A
Other languages
Chinese (zh)
Other versions
TWI735511B (en
Inventor
姜善林
龔悅
翁開域
楊小亮
Original Assignee
阿里巴巴集團服務有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集團服務有限公司 filed Critical 阿里巴巴集團服務有限公司
Priority to TW106101938A priority Critical patent/TWI735511B/en
Publication of TW201828053A publication Critical patent/TW201828053A/en
Application granted granted Critical
Publication of TWI735511B publication Critical patent/TWI735511B/en

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application proposes a code submission method and device. The method comprises: acquiring an increment code to be submitted that is to be submitted to a code warehouse; inspecting the increment code to be submitted; submitting the increment code to be submitted that has passed the inspection to the code warehouse, wherein by conducting inspection of the code before the submission of the code, the accuracy of the code can be ensured, allowing for problems to be identified as early as possible, without affecting other programs or procedures that need to use the submitted code.

Description

代碼提交方法和設備  Code submission method and device  

本申請案實施例涉及通信技術領域,特別涉及一種代碼提交方法和設備。 The embodiments of the present application relate to the field of communications technologies, and in particular, to a code submission method and device.

在現有技術中,是通過工具監控指定代碼倉庫的變更,在發現有新代碼提交入庫時,將代碼倉庫的新代碼檢出到本地,按照配置項和配置步驟,觸發持續集成執行,但觸發持續集成執行的一個重要前提是:代碼必須真實的提交到代碼倉庫,否則不會觸發任務的執行。而提交入庫的代碼,如果因為build break或測試執行失敗導致持續集成的任務失敗,已經對最終的測試結果和檢出代碼到本地的其他團隊成員產生了實質性的影響,其他人或任務必須依賴此次失敗修復後,才能正常繼續執行,這種方式不利於儘早發現問題、且違反了過程成本的軟體工程原則,另外,這種方式沒有把code review(CR:Code Review,代碼審查)的環節納入整個流程中,因此無法保證提交代碼的準確性。 In the prior art, the tool monitors the change of the specified code warehouse, and when the new code is found to be put into the library, the new code of the code warehouse is checked out to the local, and the continuous integration execution is triggered according to the configuration item and the configuration step, but the trigger continues. An important prerequisite for integrated execution is that the code must be submitted to the code repository in real time, otherwise the execution of the task will not be triggered. The code submitted to the repository, if the continuous integration task fails due to a build break or test execution failure, has already had a substantial impact on the final test results and check out the code to other local team members, others must or rely on the task After the failure is fixed, it can continue to execute normally. This method is not conducive to early detection of problems and software engineering principles that violate the cost of the process. In addition, this method does not link the code review (CR: Code Review). It is included in the entire process, so the accuracy of the submitted code cannot be guaranteed.

針對現有技術中的不利於儘早發現問題,且無法保證代碼準確性的缺陷,本申請案提出了一種代碼提交方法,包括:獲取預備向代碼倉庫提交的待提交增量代碼;對所述待提交增量代碼進行檢測;提交檢測通過的待提交增量代碼到所述代碼倉庫。 In view of the defects in the prior art that are not conducive to early detection of the problem, and the accuracy of the code cannot be guaranteed, the present application proposes a code submission method, including: obtaining an incremental code to be submitted to be submitted to the code warehouse; The incremental code is detected; the incremental code to be submitted passed through the detection is submitted to the code repository.

可選的,所述對所述待提交增量代碼進行檢測,具體包括:對所述待提交增量代碼進行代碼審查;對所述待提交增量代碼進行任務測試。 Optionally, the detecting the incremental code to be submitted includes: performing code review on the incremental code to be submitted; performing task testing on the incremental code to be submitted.

若所述代碼審查通過且所述任務測試通過,則確定對所述待提交增量代碼的檢測通過。 If the code review passes and the task test passes, it is determined that the detection of the pending incremental code is passed.

可選的,所述對所述待提交增量代碼進行代碼審查,具體包括:將所述待提交增量代碼發送給多個審查者進行審查;接收審查者回饋的審查結果;如審查結果為超過預設個數的審查者審查所述待提交增量代碼通過,則確定所述待提交增量代碼審查通過。 Optionally, the performing the code review on the incremental code to be submitted includes: sending the incremental code to be submitted to multiple reviewers for review; receiving the review result of the reviewer's feedback; If the reviewer who exceeds the preset number reviews the incremental code to be submitted, it is determined that the incremental code review to be submitted is passed.

可選的,所述對所述待提交增量代碼進行任務測試,具體包括:對所述待提交增量代碼的依賴代碼執行編譯;在對依賴代碼執行編譯時進行指定任務的任務測試;在對依賴代碼編譯完成之後進行預設任務的任務測 試;獲取指定任務與預設任務的任務測試結果;若任務測試結果為全部通過,則確定對所述待提交增量代碼的任務測試通過。 Optionally, the performing task testing on the incremental code to be submitted specifically includes: performing compilation on the dependent code of the incremental code to be submitted; performing task testing of the specified task when performing compilation on the dependent code; The task test of the preset task after the completion of the dependency code is completed; the task test result of the specified task and the preset task is obtained; if the task test result is all passed, it is determined that the task test of the incremental code to be submitted is passed.

可選的,所述對所述待提交增量代碼的依賴代碼執行編譯,具體包括:監控所述待提交增量代碼的依賴代碼是否發生變化;編譯發生了變化的依賴代碼;提取沒有發生變化的依賴代碼對應的程式館檔到指定位置,以便在對所述待提交增量代碼進行編譯時,直接引用所述程式館檔。 Optionally, the compiling the dependent code of the incremental code to be submitted comprises: monitoring whether the dependent code of the incremental code to be submitted changes; compiling the dependent code that has changed; and extracting does not change. The program code corresponding to the dependent code is to a specified location, so as to directly reference the program library file when compiling the incremental code to be submitted.

可選的,進行任務測試,具體包括:基於所述待提交增量代碼的儲存路徑地址在配置庫中指定位置查找任務設定檔;若在指定位置沒有查找到所述任務設定檔,則在所述指定位置的父目錄所在位置查找所述任務設定檔,並利用查找到的任務設定檔進行任務測試;若在父路徑所在位置查找到所述任務設定檔,提取查找到的最新的任務設定檔,並利用提取的最新的任務設定檔進行任務測試;若在父路徑所在位置未查找到所述任務設定檔,基於預設的通用配置來進行任務測試。 Optionally, performing the task test, specifically: searching for a task profile in a specified location in the configuration library based on the storage path address of the incremental code to be submitted; if the task profile is not found in the specified location, The location of the parent directory of the specified location is searched for the task profile, and the task profile is searched by using the found task profile; if the task profile is found at the location of the parent path, the latest task profile found is extracted. And using the extracted latest task profile for task testing; if the task profile is not found at the location of the parent path, the task test is performed based on the preset common configuration.

可選的,所述提交檢測通過後的待提交增量代碼到所述代碼倉庫,具體包括: 判斷檢測通過後的待提交增量代碼是否存在多個;若判斷結果為是,判斷是否存在檢測通過後的多個待提交增量代碼對應於同一原始程式碼,且對應於同一原始程式碼的檢測通過後的多個待提交增量代碼進行代碼修改的位置一致;若判斷結果為是,則確定對應同一個原始程式碼,且代碼修改的位置一致的多個檢測通過後的待提交增量代碼為存在衝突且檢測通過後的待提交增量代碼;基於優先順序評估因素對多個存在衝突且檢測通過後的待提交增量代碼進行優先順序評估;按照評估得到的優先順序依序從高到低依次提交存在衝突且檢測通過後的待提交增量代碼到所述代碼倉庫。 Optionally, the submitting the detected incremental code to be submitted to the code warehouse after the detection comprises: determining whether there is a plurality of incremental codes to be submitted after the detection is passed; and if the determination result is yes, determining whether there is detection The plurality of to-be-delivered incremental codes after the corresponding ones correspond to the same original code, and the positions corresponding to the plurality of pending incremental codes after the detection of the same original code are identical; if the judgment result is yes, Determining the same incremental code that corresponds to the same original code and the position of the code modification is the incremental code to be submitted after the detection is passed, and the incremental code to be submitted after the detection is passed; And performing the priority order evaluation after the passing of the incremental code to be submitted; and submitting the incremental code to be submitted to the code warehouse after the conflict is detected in order from the highest priority to the priority order.

可選的,所述優先順序評估因素包括對代碼進行修改的修改時間,代碼修改行數,以及代碼重要性;所述基於優先順序評估因素對多個存在衝突且檢測通過後的待提交增量代碼進行優先順序評估,具體包括:基於影響程度對各個存在衝突且檢測通過的待提交增量代碼的代碼重要性進行評估,以及獲取各個存在衝突且檢測通過的待提交增量代碼的修改時間和代碼修改行數;基於修改時間,代碼修改行數以及代碼重要性來對各個存在衝突且檢測通過的待提交增量代碼的優先順序進行評估;基於評估結果確定各個存在衝突且檢測通過的待提交增量代碼的優先順序。 Optionally, the priority evaluation factor includes a modification time of modifying the code, a code modification line number, and a code importance; the priority evaluation factor is based on the plurality of conflicting and the detected pending submission increments The code performs the priority evaluation, which includes: evaluating the importance of the code of each of the conflicting and detected passing incremental codes based on the degree of influence, and obtaining the modification time of each of the conflicting and detected passing incremental codes to be submitted. The code modifies the number of rows; based on the modification time, the code modifies the number of rows, and the code importance to evaluate the priority order of each of the conflicting and detected through-delivery incremental codes; determining, based on the evaluation result, each of the conflicts and the detected pass-to-submit The priority order of the incremental code.

本申請案還提出了一種代碼提交設備,包括:獲取模組,用於獲取預備向代碼倉庫提交的待提交增量代碼;檢測模組,用於對所述待提交增量代碼進行檢測;提交模組,用於提交檢測通過的待提交增量代碼到所述代碼倉庫。 The application also provides a code submission device, comprising: an acquisition module, configured to acquire an incremental code to be submitted to be submitted to the code warehouse; a detection module, configured to detect the incremental code to be submitted; The module is configured to submit the detected incremental code to be submitted to the code warehouse.

可選的,所述檢測模組,具體用於:對所述待提交增量代碼進行代碼審查;對所述待提交增量代碼進行任務測試。 Optionally, the detecting module is specifically configured to: perform code review on the incremental code to be submitted; and perform task testing on the incremental code to be submitted.

若所述代碼審查通過且所述任務測試通過,則確定對所述待提交增量代碼的檢測通過。 If the code review passes and the task test passes, it is determined that the detection of the pending incremental code is passed.

可選的,所述檢測模組對所述待提交增量代碼進行代碼審查,具體包括:將所述待提交增量代碼發送給多個審查者進行審查;接收審查者回饋的審查結果;如審查結果為超過預設個數的審查者審查所述待提交增量代碼通過,則確定所述待提交增量代碼審查通過。 Optionally, the detecting module performs code review on the incremental code to be submitted, and specifically includes: sending the incremental code to be submitted to multiple reviewers for review; and receiving the review result of the reviewer's feedback; The result of the review is that the reviewer who exceeds the preset number reviews the pending incremental code to pass, and then determines that the incremental code review to be submitted is passed.

可選的,所述檢測模組對所述待提交增量代碼進行任務測試,具體包括:對所述待提交增量代碼的依賴代碼執行編譯;在對依賴代碼執行編譯時進行指定任務的任務測試;在對依賴代碼編譯完成之後進行預設任務的任務測試;獲取指定任務與預設任務的任務測試結果; 若任務測試結果為全部通過,則確定對所述待提交增量代碼的任務測試通過。 Optionally, the detecting module performs task testing on the incremental code to be submitted, and specifically includes: performing compiling on the dependent code of the incremental code to be submitted; performing a task of specifying a task when compiling the dependent code Testing; performing a task test of a preset task after compiling the dependent code; obtaining a task test result of the specified task and the preset task; and if the task test result is all passed, determining a task test for the incremental code to be submitted by.

可選的,所述檢測模組對所述待提交增量代碼的依賴代碼執行編譯,具體包括:監控所述待提交增量代碼的依賴代碼是否發生變化;編譯發生了變化的依賴代碼;提取沒有發生變化的依賴代碼對應的程式館檔到指定位置,以便在對所述待提交增量代碼進行編譯時,直接引用所述程式館檔。 Optionally, the detecting module performs compilation on the dependent code of the incremental code to be submitted, and specifically includes: monitoring whether the dependent code of the incremental code to be submitted changes; compiling a dependent code that has changed; extracting The library file corresponding to the dependent code that has not changed to the specified location, so as to directly reference the program library file when compiling the incremental code to be submitted.

可選的,所述檢測模組進行任務測試,具體包括:基於所述待提交增量代碼的儲存路徑地址在配置庫中指定位置查找任務設定檔;若在指定位置沒有查找到所述任務設定檔,則在所述指定位置的父目錄所在位置查找所述任務設定檔,並利用查找到的任務設定檔進行任務測試;若在父路徑所在位置查找到所述任務設定檔,提取查找到的最新的任務設定檔,並利用提取的最新的任務設定檔進行任務測試;若在父路徑所在位置未查找到所述任務設定檔,基於預設的通用配置來進行任務測試。 Optionally, the detecting module performs task testing, specifically: searching for a task profile in a specified location in the configuration library based on the storage path address of the incremental code to be submitted; if the task setting is not found in the specified location The file is searched for the task profile at the location of the parent directory of the specified location, and the task profile is searched by using the found task profile; if the task profile is found at the location of the parent path, the found profile is extracted. The latest task profile, and the task test is performed by using the extracted latest task profile; if the task profile is not found at the location of the parent path, the task test is performed based on the preset common configuration.

可選的,所述提交模組,具體用於:判斷檢測通過後的待提交增量代碼是否存在多個;若判斷結果為是,判斷是否存在檢測通過後的多個待提交增量代碼對應於同一原始程式碼,且對應於同一原始 程式碼的檢測通過後的多個待提交增量代碼進行代碼修改的位置一致;若判斷結果為是,則確定對應同一個原始程式碼,且代碼修改的位置一致的多個檢測通過後的待提交增量代碼為存在衝突且檢測通過後的待提交增量代碼;基於優先順序評估因素對多個存在衝突且檢測通過後的待提交增量代碼進行優先順序評估;按照評估得到的優先順序依序從高到低依次提交存在衝突且檢測通過後的待提交增量代碼到所述代碼倉庫。 Optionally, the submitting module is specifically configured to: determine whether there is a plurality of incremental codes to be submitted after the detection is passed; if the determination result is yes, determine whether there is a plurality of incremental codes to be submitted after the detection is passed. In the same original code, and corresponding to the same original code, the position of the code to be submitted after the detection of the incremental code to be submitted is consistent; if the judgment result is yes, it is determined that the same original code is corresponding, and the code is modified. The incremental code of the position to be submitted after the multiple detections are consistent with the incremental code to be submitted after the conflict is detected; and the incremental code to be submitted after the conflict is detected and the detection is passed based on the priority evaluation factor Priority evaluation; submit the incremental code to be submitted to the code warehouse in order of priority according to the priority order of the evaluation.

可選的,所述優先順序評估因素包括對代碼進行修改的修改時間,代碼修改行數,以及代碼重要性;所述提交模組基於優先順序評估因素對多個存在衝突且檢測通過後的待提交增量代碼進行優先順序評估,具體包括:基於影響程度對各個存在衝突且檢測通過的待提交增量代碼的代碼重要性進行評估,以及獲取各個存在衝突且檢測通過的待提交增量代碼的修改時間和代碼修改行數;基於修改時間,代碼修改行數以及代碼重要性來對各個存在衝突且檢測通過的待提交增量代碼的優先順序進行評估;基於評估結果確定各個存在衝突且檢測通過的待提交增量代碼的優先順序。 Optionally, the priority evaluation factor includes a modification time of modifying the code, a code modification line number, and a code importance; and the submitting module is based on the priority evaluation factor to the plurality of conflicts and the detection after the passage The incremental code is submitted for priority evaluation, which includes: evaluating the importance of the code of each of the conflicting and detected passing incremental codes based on the degree of influence, and obtaining the incremental code to be submitted that each conflict exists and passes the test. Modifying the time and code to modify the number of rows; based on the modification time, the number of lines modified by the code, and the importance of the code to evaluate the priority order of each conflicting and detected incremental code to be submitted; determining each conflict based on the evaluation result and passing the detection The priority order of the incremental code to be submitted.

與現有技術相比,本申請案中通過獲取預備向代碼倉庫提交的待提交增量代碼;對所述待提交增量代碼進行檢 測;提交檢測通過的待提交增量代碼到所述代碼倉庫,從而在提交代碼之前先對代碼進行檢測,保證了提交代碼的準確性,且可以儘早發現問題,不會影響到其他需要利用該提交代碼的程式或者過程。 Compared with the prior art, in the present application, the incremental code to be submitted submitted to the code warehouse is obtained by acquiring the incremental code to be submitted; and the incremental code to be submitted through the detection is submitted to the code warehouse. Therefore, the code is detected before the code is submitted, the accuracy of the submitted code is ensured, and the problem can be found as early as possible, without affecting other programs or processes that need to use the submitted code.

201‧‧‧獲取模組 201‧‧‧Getting module

202‧‧‧檢測模組 202‧‧‧Test module

203‧‧‧提交模組 203‧‧‧Submit module

圖1為本申請案提出的一種代碼提交方法的流程示意圖;圖2為本申請案提出的一種代碼提交設備的結果示意圖。 1 is a schematic flowchart of a code submission method proposed in the present application; FIG. 2 is a schematic diagram of a result of a code submission device proposed in the present application.

如先前技術,現有技術中的風險評估方案無法準確評估風險,為此,本申請案中為了更好地評估風險,提出了一種代碼提交方法,如圖1所示,包括以下步驟:步驟101、獲取預備向代碼倉庫提交的待提交增量代碼。 As in the prior art, the risk assessment solution in the prior art cannot accurately assess the risk. To this end, in order to better assess the risk, a code submission method is proposed in the present application. As shown in FIG. 1, the method includes the following steps: Step 101: Get the incremental code to be submitted that is ready to be submitted to the code repository.

在一個具體的應用場景中,在使用者修改完代碼後,會預備提交該代碼到代碼倉庫,也由此可以獲取修改後的預備向代碼倉庫提交的待提交增量代碼,至於與此不同的其他代碼,則不會執行獲取的操作。 In a specific application scenario, after the user has modified the code, the user is ready to submit the code to the code repository, and thus the modified incremental code to be submitted to the code warehouse is obtained, which is different from this. Other code will not perform the acquired operation.

步驟102、對待提交增量代碼進行檢測。 In step 102, the incremental code is submitted for detection.

在獲取到待提交增量代碼之後,就需要對待提交增量代碼進行檢測,而具體的檢測包括:對待提交增量代碼進 行代碼審查和對待提交增量代碼進行任務測試,也即包括以下兩個過程: After obtaining the incremental code to be submitted, it is necessary to detect the submitted incremental code, and the specific detection includes: performing the code review for submitting the incremental code and performing the task test for submitting the incremental code, that is, including the following two Process:

(1)、對待提交增量代碼進行代碼審查: (1), to submit the incremental code for code review:

將待提交增量代碼發送給多個審查者進行審查;接收審查者回饋的審查結果;如審查結果為超過預設個數的審查者審查待提交增量代碼通過,則確定待提交增量代碼審查通過。 Sending the incremental code to be submitted to multiple reviewers for review; receiving the review result of the reviewer's feedback; if the review result is more than a preset number of reviewers reviewing the pending incremental code pass, then determining the incremental code to be submitted The review was passed.

具體的,將待提交增量代碼發送給審查者,審查者審查該待提交增量代碼後,會給出審查結果,通過或者不通過,而為了保證審查的準確性,可以預設只有在超過預設個數的審查者審查通過,例如可以設置為2個審查者審查通過,則可以確定該待提交增量代碼通過。 Specifically, the incremental code to be submitted is sent to the reviewer, and after the reviewer reviews the incremental code to be submitted, the review result is given, passed or not, and in order to ensure the accuracy of the review, the preset may only be exceeded. The preset number of reviewers pass the review, for example, it can be set to 2 reviewers to pass the review, and then the incremental code to be submitted can be determined to pass.

(2)、對待提交增量代碼進行任務測試,具體包括: (2), to submit the incremental code for task testing, specifically:

對待提交增量代碼的依賴代碼執行編譯;在對依賴代碼執行編譯時進行指定任務的任務測試;在對依賴代碼編譯完成之後進行預設任務的任務測試;獲取指定任務與預設任務的任務測試結果;若任務測試結果為全部通過,則確定對待提交增量代碼的任務測試通過。 Compute compilation of dependent code that submits incremental code; perform task test of specified task when compiling with dependent code; perform task test of preset task after compiling dependent code; obtain task test of specified task and preset task Result; if the task test result is all passed, it is determined that the task test for submitting the incremental code passes.

有些測試任務需要在進行編譯時進行任務測試,例如UT(Unit Test,單元測試),還有一些需要在編譯完成之後再進行任務測試,例如BVT(Build Verification Test,冒煙測試),具體的根據其測試任務的特性來選擇相應的時機來進行任務測試,在此不再進行贅敘,而任務測試通 過需要所有進行的任務測試的結果都通過。 Some test tasks require task testing when compiling, such as UT (Unit Test), and some need to perform task testing after compilation is completed, such as BVT (Build Verification Test). The characteristics of the test task to select the appropriate timing for task testing, no longer elaborate here, and the task test passes the results of all the required task tests.

對待提交增量代碼的依賴代碼執行編譯,具體包括:監控待提交增量代碼的依賴代碼是否發生變化;編譯發生了變化的依賴代碼;提取沒有發生變化的依賴代碼對應的程式館檔到指定位置,以便在對待提交增量代碼進行編譯時,直接引用程式館檔。 Compiling the dependent code that submits the incremental code, including: monitoring whether the dependent code of the incremental code to be submitted changes; compiling the dependent code that has changed; extracting the library file corresponding to the dependent code that has not changed to the specified location In order to directly reference the library file when compiling the incremental code to be submitted.

具體的編譯不需要進行全量的編譯,由於待提交增量代碼會引用某些代碼來實現相應的功能,被引用的代碼即為待提交增量代碼的依賴代碼,也由此,在進行編譯時,只需要編譯發生了變化的依賴代碼,對與沒有發生變化的依賴代碼,可以直接提取依賴代碼的程式館檔到指定位置,而不需要執行編譯的過程,以此在保證了功能的實現的同時,減少了資源的消耗和提升了效率。 The specific compilation does not need to be fully compiled. Since the incremental code to be submitted will refer to some code to implement the corresponding function, the referenced code is the dependent code of the incremental code to be submitted, and thus, when compiling It only needs to compile the dependent code that has changed. For the dependent code that has not changed, you can directly extract the library file of the dependent code to the specified location without executing the compilation process, thus ensuring the implementation of the function. At the same time, it reduces resource consumption and improves efficiency.

而具體的,進行任務測試,具體包括:基於待提交增量代碼的儲存路徑地址(後續待提交增量代碼根據儲存路徑地址進行代碼的提交過程)在配置庫中指定位置查找任務設定檔;若在指定位置沒有查找到任務設定檔,則在指定位置的父目錄所在位置查找任務設定檔,並利用查找到的任務設定檔進行任務測試;若在父路徑所在位置查找到任務設定檔,提取查找到的最新的任務設定檔,並利用提取的最新的任務設定檔進行任務測試;若在父路徑所在位置未查找到任務設定檔,基於預設的通用配置來進行任務測試。 Specifically, the task test includes: searching for a task profile in a specified location in the configuration repository based on a storage path address to be submitted with an incremental code (a subsequent process of submitting the incremental code according to the storage path address); If the task profile is not found in the specified location, the task profile is found in the location of the parent directory of the specified location, and the task profile is searched by using the found task profile; if the task profile is found in the location of the parent path, the search is performed. Go to the latest task profile and use the extracted latest task profile for task testing; if the task profile is not found at the location of the parent path, the task is tested based on the preset common configuration.

具體的,由於需要根據任務設定檔來進行任務測試, 而測試的任務有可能之前已經進行過,因此會存在任務設定檔,在此情況下可以利用之前的任務設定檔來進行任務測試,而若之前進行過任務測試,其任務設定檔會存在指定的位置(可以基於待提交增量代碼的儲存路徑地址查找到),或者指定位置的父目錄所在位置,因此先在指定位置查找,若查找到,則根據任務設定檔進行任務測試;若沒有查找到,則在父目錄所在位置查找,也即在指定位置的上一層所在的位置進行查找,若查找到,則基於查找到的最新任務設定檔進行任務測試;若之前沒有進行過任務測試,也即不會存在任務設定檔,在此情況下,就可以基於通用配置來進行任務測試。 Specifically, since the task test needs to be performed according to the task profile, and the test task may have been performed before, there is a task profile, and in this case, the task profile can be used to perform the task test, and if Before the task test, the task profile will exist in the specified location (can be found based on the storage path address of the incremental code to be submitted), or the location of the parent directory of the specified location, so first look in the specified location, if found , according to the task profile for task testing; if not found, the location of the parent directory, that is, the location of the upper layer of the specified location, if found, based on the latest task profile found Perform task testing; if you have not performed a task test before, there is no task configuration file. In this case, you can perform task testing based on the common configuration.

如此通過對待提交增量代碼進行對待提交增量代碼進行代碼審查以及任務測試,當代碼審查通過且任務測試通過時,確定對待提交增量代碼的檢測通過。 In this way, by submitting the incremental code to submit the incremental code for code review and task testing, when the code review passes and the task test passes, it is determined that the detection of the submitted incremental code is passed.

具體的,經過步驟102對待提交增量代碼進行檢測後,會有兩種結果,檢測通過或不通過,若檢測通過,則執行步驟103、若檢測不通過,則結束操作和/或進行檢測不通過告警。 Specifically, after the step 102 is used to detect the submitted incremental code, there are two results, and the detection passes or fails. If the detection passes, step 103 is performed, and if the detection fails, the operation ends and/or the detection is not performed. Pass the alarm.

步驟103、提交檢測通過的待提交增量代碼。 Step 103: Submit the incremental code to be submitted for detection.

由於只會提交檢測通過的待提交增量代碼到所述代碼倉庫,因此具體的提交過程包括:判斷檢測通過後的待提交增量代碼是否存在多個;若判斷結果為是,判斷是否存在檢測通過後的多個待提交增量代碼對應於同一原始程式碼,且對應於同一原始程式碼 的檢測通過後的多個待提交增量代碼進行代碼修改的位置一致;若判斷結果為是,則確定對應同一個原始程式碼,且代碼修改的位置一致的多個檢測通過後的待提交增量代碼為存在衝突且檢測通過後的待提交增量代碼;基於優先順序評估因素對多個存在衝突且檢測通過後的待提交增量代碼進行優先順序評估;按照評估得到的優先順序依序從高到低依次提交存在衝突且檢測通過後的待提交增量代碼到所述代碼倉庫。 Since only the incremental code to be submitted for detection is submitted to the code warehouse, the specific submission process includes: determining whether there are multiple incremental codes to be submitted after the detection is passed; if the determination result is yes, determining whether there is detection The plurality of to-be-delivered incremental codes after the corresponding ones correspond to the same original code, and the positions corresponding to the plurality of pending incremental codes after the detection of the same original code are identical; if the judgment result is yes, Determining the same incremental code that corresponds to the same original code and the position of the code modification is the incremental code to be submitted after the detection is passed, and the incremental code to be submitted after the detection is passed; And performing the priority order evaluation after the passing of the incremental code to be submitted; and submitting the incremental code to be submitted to the code warehouse after the conflict is detected in order from the highest priority to the priority order.

具體的,由於可能出現同一原始程式碼可能被多個修改者同時修改,且修改的位置一致(具體為修改的代碼行數,例如修改都是第7行),這樣會產生多個待提交增量代碼,且多個待提交增量代碼的對應於同一原始程式碼,在此情況下,由於這多個待提交增量代碼之間是存在衝突的,在此情況下可以對多個待提交增量代碼進行優先順序評估,以確定優先順序的高低,最後基於優先順序的高低來確定提交的順序,在一個具體的實施例中,優先順序的評估因素可以包括對代碼進行修改的修改時間,代碼修改行數,以及代碼重要性;具體的,若其他兩個因素一致,修改時間越早,對應的優先順序越高;代碼重要性越高(也即修改後的代碼的影響程度越大),對應的優先順序越高;代碼修改行數越多,對應的優先順序越高;在此情況下,基於優先順序評估因素對多個存在衝突且檢測通過的待提交增量代碼進行優先順序評估,具體包括:基於影響程度對各個存在衝突且檢測通過的待提交增 量代碼的代碼重要性進行評估,以及獲取各個存在衝突且檢測通過的待提交增量代碼的修改時間和代碼修改行數;基於修改時間,代碼修改行數以及代碼重要性來對各個存在衝突且檢測通過的待提交增量代碼的優先順序進行評估;基於評估結果確定各個存在衝突且檢測通過的待提交增量代碼的優先順序;具體的,可以利用一個公式ΣP=(C,K,T)來進行評估,具體的,C為代碼修改行數,K為代碼重要性(具體體現為修改後的代碼的影響程度),T為時間因素,初始基準值為1,按照提交時間的倒序排序,T的取值按照2(n-1)遞增,以此通過這三個因素來對多個存在衝突且檢測通過後的待提交增量代碼的優先順序ΣP進行評估。 Specifically, since the same original code may be modified by multiple modifiers at the same time, and the modified positions are consistent (specifically, the number of modified lines of code, for example, the modification is the 7th line), this will generate multiple pending submissions. A quantity code, and a plurality of to-be-delivered incremental codes correspond to the same original code. In this case, since there is a conflict between the plurality of pending incremental codes, in this case, multiple to-be-committed The incremental code performs priority evaluation to determine the priority level, and finally determines the order of submission based on the priority level. In a specific embodiment, the evaluation factor of the priority order may include the modification time of modifying the code. The code modifies the number of lines and the importance of the code; specifically, if the other two factors are consistent, the earlier the modification time, the higher the priority order; the higher the code importance (that is, the greater the impact of the modified code) The higher the priority order is; the more the number of lines modified by the code, the higher the priority order; in this case, the factor is evaluated based on the priority order. The priority code to be submitted for conflicting and detecting the pending incremental code includes: evaluating the importance of the code of each of the conflicting and detected passing incremental codes based on the degree of influence, and obtaining each conflict and detecting The modification time of the incremental code to be submitted and the number of code modification lines; based on the modification time, the number of lines modified by the code, and the importance of the code to evaluate the priority order of each conflicting and detected incremental code to be submitted; based on the evaluation As a result, the priority order of each incremental code to be submitted that is conflicting and detected is determined; specifically, a formula ΣP=(C, K, T) can be used for evaluation. Specifically, C is the code modification line number, K is The importance of the code (specifically the degree of influence of the modified code), T is the time factor, the initial reference value is 1, sorted in reverse order of the submission time, and the value of T is incremented by 2 (n-1) . These three factors are used to evaluate the priority order ΣP of a plurality of conflicting and detected incremental codes to be submitted.

為了對本申請案進行進一步的說明,本申請案實施例二還公開了一種具體場景下的代碼提交,包括以下步驟;步驟1,Review Board(即審查板,屬於整個伺服器的一部分)獲取使用者修改完代碼後,通過RBT Client(RBT客戶端)上傳的修改後的代碼,具體,修改後的代碼請求對修改後的代碼進行審查的審查請求,Review Board為該請求分配一個審查ID(Review ID),並將該Review ID返回給RBT Client,以便RBT Client將該Review ID以及其他的修改後的代碼標識發送給Task Server(任務伺服器)。 In order to further explain the present application, the second embodiment of the present application also discloses a code submission in a specific scenario, including the following steps; Step 1, the Review Board (ie, the review board, which is part of the entire server) acquires the user. After the code is modified, the modified code uploaded by the RBT Client (RBT client), specifically, the modified code requests a review request for reviewing the modified code, and the Review Board assigns a review ID to the request (Review ID) ), and return the Review ID to the RBT Client, so that the RBT Client sends the Review ID and other modified code identifiers to the Task Server (task server).

步驟2、Review Board將修改後的代碼發送給多個審查者進行審查,並獲取審查者的審查結果(審查通過或審 查不通過),同時Task Server基於Review ID輪詢Review Board獲取審查結果,若審查結果為有2個或多於2個審查者的審查結果為通過,則可以確定代碼審查通過。 Step 2: The Review Board sends the modified code to multiple reviewers for review, and obtains the review result of the reviewer (the review pass or the review fails), and the Task Server polls the Review Board based on the Review ID to obtain the review result. If the result of the review is that two or more examiners have passed the review, it can be determined that the code review is passed.

在具體的過程中,審查者在做完審查之後,給予審查通過的標記,一個審查者可以給出一個有效的+1 ship it標記,可以設置要求有+2的標記才算本次審查通過,由此通過查詢ship it來確定是否審查通過。 In the specific process, after the reviewer has completed the review, the reviewer will give the mark of the review. One reviewer can give a valid +1 ship it mark, and can set the mark with the requirement of +2 to pass the review. This is done by querying ship it to determine if the review is passed.

步驟3、Task Server獲取測試任務所需的設定檔,並將設定檔發送給CISE(Continuous Integration Servevice Engine,持續集成服務執行引擎),以便CISE基於設定檔來執行任務測試,並將測試結果返回給Task Server,Task Server在接收到測試結果後儲存在資料庫中。 Step 3: The Task Server obtains the configuration file required for the test task, and sends the configuration file to the CISE (Continuous Integration Servevice Engine), so that the CISE performs the task test based on the configuration file, and returns the test result to the test result. Task Server, Task Server is stored in the database after receiving the test results.

Task Server基於代碼標識,例如差別檔,原始程式碼標識,版本伺服器等,復原修改後的代碼,當然,也可以直接獲取修改後的代碼,不過考慮到原代碼可能比較長,以復原的方式效率較高,節約了資源,在賦予了修改後的代碼後,查找與任務相關的設定檔(Yaml設定檔),其中,具體包括以下三種情況:一、首先從SVN/Git的腳本庫中,檢測指定位置是否存在Yaml設定檔,若存在,按照此設定檔執行整個任務;二、若指定位置不存在Yaml設定檔,首先根據SVN/Git地址,根據指定位置的父路徑(即只到trunk或 branches這一級目錄結構)在Task Server維護的配置庫中進行查找,如果存在對應父目錄的配置,則自動獲取父目錄下最新的規則配置作為此新加入任務的配置使用;三、對於不存在任何配置的任務,則從資料庫中獲取通用任務配置規則,以預設的執行規則進行處理。其中,預設配置規則是區分語言環境的,具體語言環境根據RBT Client傳遞的資訊獲取;具體的,任務中也包括編譯,具體的在準備編譯時,先獲取確定修改後的代碼的依賴代碼的變更情況,具體可以基於變更時間戳記來進行判斷,看是否一致,若一致,則說明未發生變更,基於makefile(其中儲存有修改後的代碼的標識與依賴代碼之間的關係)生成最新makefile的配置副本,將之前的依靠編譯生成依賴庫的操作替換為指定路徑的程式館檔,同時,動態更新Yaml設定檔(利用了makefile的配置副本,任務發送了變化),下載程式館檔到指定路徑,與makefile配置副本保持一致;對於發生變更的情況,則保持各配置項不變,按照依賴循序執行編譯構建過程;CISE任務執行結束後,將最新編譯生成的程式館檔上傳至OSS(Open Storage Service)雲端空間中,按照檔名+Unix時間戳記的形式存放,同時編譯生成的模組資訊和時間戳記(也即標識)會以JSON串的形式通過Save介面更新到資料庫中,作為後續任務執行的依據,JSON串data部分內容及格式如下: The Task Server restores the modified code based on the code identifier, such as the difference file, the original code identifier, the version server, etc., of course, the modified code can also be obtained directly, but considering that the original code may be long, in a recovery manner High efficiency, saving resources, after assigning the modified code, find the task-related configuration file (Yaml configuration file), which specifically includes the following three situations: First, from the SVN/Git script library, Detect whether there is a Yaml profile in the specified location. If it exists, execute the entire task according to the profile. Second, if there is no Yaml profile in the specified location, first according to the SVN/Git address, according to the parent path of the specified location (ie only to the trunk or The branch directory structure is searched in the configuration library maintained by the Task Server. If there is a configuration corresponding to the parent directory, the latest rule configuration in the parent directory is automatically obtained as the configuration of the newly added task. 3. For any non-existent configuration The configured task obtains the general task configuration rule from the database and processes it according to the preset execution rule. The preset configuration rule is to distinguish the language environment, and the specific language environment is obtained according to the information transmitted by the RBT client; specifically, the task also includes compiling, and specifically, when preparing for compiling, first obtaining the dependent code for determining the modified code. The change can be determined based on the change time stamp to see if it is consistent. If it is consistent, it indicates that no change has occurred. Based on the makefile (where the relationship between the modified code identifier and the dependent code is stored), the latest makefile is generated. Configure the copy, replace the previous operation that relies on compiling and generating the dependent library with the library file of the specified path. At the same time, dynamically update the Yaml configuration file (using the configuration copy of the makefile, the task sends a change), and download the program file to the specified path. , consistent with the makefile configuration copy; for the case of changes, keep the configuration items unchanged, execute the compilation and build process according to the dependency; after the execution of the CISE task, upload the latest compiled library file to OSS (Open Storage) Service) in the cloud space, according to the file name + Unix timestamp Put, while the compiled modules and timestamp information (i.e., identity) of the string will be as JSON interface updates to the repository by Save, as a basis for the subsequent execution of the task, data string part and JSON format is as follows:

步驟4、Task Server輪詢資料庫中的任務測試結果,若審查通過,則可以提交該修改後的代碼。 Step 4: The Task Server polls the task test result in the database. If the review passes, the modified code can be submitted.

當然需要提交代碼時,在預提交的過程中,也即已經進行代碼審查通過,和任務測試通過,若發現針對該修改後的代碼對應的原始程式碼還有其他的代碼變更同步發生(也即多個代碼變更對應同一個原始程式碼,且進行修改的位置一致),且多個代碼變更也都是審查通過和任務測試通過的,針對該場景,本申請案從對代碼進行修改的修改時間(T)、變更複雜度(C)和關鍵路徑影響(K)三個因素綜合對比,其中,變更複雜度具體體現為代碼修改行數,代碼修改行數越多,變更複雜度越高;而關鍵路徑 影響則體現為代碼重要性,依據公式計算向量模長判斷優先順序:ΣP=(C,K,T),其中:變更複雜度C以代碼修改行數作為判斷依據;關鍵路徑影響以變更影響的方法個數作為判斷依據,變更影響的方法個數越多,對應的,體現為代碼重要性越高;對於時間因數T,則是靠前提交的任務取值較大其初始基準值為1,多個任務之間按照提交時間的倒序排序,T的取值按照2(n-1)遞增,從而保證靠前任務優先被提交;此處以對同一模組代碼的相關檔的兩個併發提交為實例進行說明,第一個提交任務的增量代碼行數為20,影響方法個數為2,T取值為2(基準值為1,倒序排列);第二個提交任務的增量代碼行數是20,影響方法個數為6,T取值為1。計算向量的模長的公式為,根據計算結果可以確定第二個提交任務的代碼優先被提交。 Of course, when the code needs to be submitted, in the process of pre-submission, the code review has been passed, and the task test is passed. If the original code corresponding to the modified code is found, other code changes occur synchronously (ie, Multiple code changes correspond to the same original code, and the location of the modification is consistent), and multiple code changes are also passed through the review and task test. For this scenario, the modification time of the code from the modification of the code is (T), change complexity (C) and critical path impact (K) comprehensive comparison of the three factors, wherein the complexity of the change is embodied in the code modification line number, the more code modification lines, the higher the complexity of the change; The critical path impact is reflected in the importance of the code. The vector modulus length is judged according to the formula: ΣP=(C, K, T), where: the change complexity C is determined by the number of lines modified by the code; the critical path influence is changed. The number of methods affected is used as the basis for judging. The more the number of methods to change the influence, the more corresponding, the higher the importance of the code; for the time factor T, Larger value jobs submitted its initial reference value is 1, among a plurality of tasks in the reverse order submission time, T values according to 2 (n-1) is incremented, so as to ensure forward the task priority is submitted; here to Two concurrent submissions of related files of the same module code are described as examples. The number of incremental code lines of the first submitted task is 20, the number of affected methods is 2, and the value of T is 2 (the reference value is 1, Reverse order); the number of incremental code lines for the second commit task is 20, the number of affected methods is 6, and the value of T is 1. The formula for calculating the modulus length of a vector is According to the calculation result, it can be determined that the code of the second submitting task is preferentially submitted.

本申請案實施例還公開了一種代碼提交設備,如圖2所示,包括:獲取模組201,用於獲取預備向代碼倉庫提交的待提交增量代碼;檢測模組202,用於對所述待提交增量代碼進行檢測;提交模組203,用於提交檢測通過的待提交增量代碼到所述代碼倉庫。 The embodiment of the present application further discloses a code submission device, as shown in FIG. 2, comprising: an acquisition module 201, configured to acquire an incremental code to be submitted submitted to a code warehouse; and a detection module 202, configured to The submitting the incremental code for detecting; the submitting module 203 is configured to submit the incremental code to be submitted for detection to the code warehouse.

所述檢測模組202,具體用於:對所述待提交增量代碼進行代碼審查; 對所述待提交增量代碼進行任務測試。 The detecting module 202 is specifically configured to: perform code review on the incremental code to be submitted; perform task testing on the incremental code to be submitted.

若所述代碼審查通過且所述任務測試通過,則確定對所述待提交增量代碼的檢測通過。 If the code review passes and the task test passes, it is determined that the detection of the pending incremental code is passed.

所述檢測模組202對所述待提交增量代碼進行代碼審查,具體包括:將所述待提交增量代碼發送給多個審查者進行審查;接收審查者回饋的審查結果;如審查結果為超過預設個數的審查者審查所述待提交增量代碼通過,則確定所述待提交增量代碼審查通過。 The detecting module 202 performs code review on the incremental code to be submitted, and specifically includes: sending the incremental code to be submitted to multiple reviewers for review; and receiving the review result of the reviewer's feedback; if the review result is If the reviewer who exceeds the preset number reviews the incremental code to be submitted, it is determined that the incremental code review to be submitted is passed.

所述檢測模組202對所述待提交增量代碼進行任務測試,具體包括:對所述待提交增量代碼的依賴代碼執行編譯;在對依賴代碼執行編譯時進行指定任務的任務測試;在對依賴代碼編譯完成之後進行預設任務的任務測試;獲取指定任務與預設任務的任務測試結果;若任務測試結果為全部通過,則確定對所述待提交增量代碼的任務測試通過。 The detecting module 202 performs task testing on the incremental code to be submitted, and specifically includes: performing compiling on the dependent code of the incremental code to be submitted; performing task testing of the specified task when compiling the dependent code; The task test of the preset task after the completion of the dependency code is completed; the task test result of the specified task and the preset task is obtained; if the task test result is all passed, it is determined that the task test of the incremental code to be submitted is passed.

所述檢測模組202對所述待提交增量代碼的依賴代碼執行編譯,具體包括:監控所述待提交增量代碼的依賴代碼是否發生變化;編譯發生了變化的依賴代碼;提取沒有發生變化的依賴代碼對應的程式館檔到指定位置,以便在對所述待提交增量代碼進行編譯時,直接引 用所述程式館檔。 The detecting module 202 performs compilation on the dependent code of the incremental code to be submitted, and specifically includes: monitoring whether the dependent code of the incremental code to be submitted changes; compiling the dependent code that has changed; and extracting does not change. The program code corresponding to the dependent code is to a specified location, so as to directly reference the program library file when compiling the incremental code to be submitted.

所述檢測模組202進行任務測試,具體包括:基於所述待提交增量代碼的儲存路徑地址在配置庫中指定位置查找任務設定檔;若在指定位置沒有查找到所述任務設定檔,則在所述指定位置的父目錄所在位置查找所述任務設定檔,並利用查找到的任務設定檔進行任務測試;若在父路徑所在位置查找到所述任務設定檔,提取查找到的最新的任務設定檔,並利用提取的最新的任務設定檔進行任務測試;若在父路徑所在位置未查找到所述任務設定檔,基於預設的通用配置來進行任務測試。 The detecting module 202 performs task testing, specifically: searching for a task profile in a specified location in the configuration library based on the storage path address of the incremental code to be submitted; if the task profile is not found in the specified location, Searching for the task profile in the location of the parent directory of the specified location, and using the found task profile to perform task testing; if the task profile is found in the location of the parent path, extracting the latest task found The profile is set and the task test is performed by using the extracted latest task profile; if the task profile is not found at the location of the parent path, the task test is performed based on the preset common configuration.

提交模組203,具體用於:判斷檢測通過後的待提交增量代碼是否存在多個;若判斷結果為是,判斷是否存在檢測通過後的多個待提交增量代碼對應於同一原始程式碼,且對應於同一原始程式碼的檢測通過後的多個待提交增量代碼進行代碼修改的位置一致;若判斷結果為是,則確定對應同一個原始程式碼,且代碼修改的位置一致的多個檢測通過後的待提交增量代碼為存在衝突且檢測通過後的待提交增量代碼;基於優先順序評估因素對多個存在衝突且檢測通過後的待提交增量代碼進行優先順序評估;按照評估得到的優先順序依序從高到低依次提交存在 衝突且檢測通過後的待提交增量代碼到所述代碼倉庫。 The submitting module 203 is specifically configured to: determine whether there is a plurality of incremental codes to be submitted after the detection is passed; if the determination result is yes, determine whether there are multiple pending incremental codes corresponding to the same original code after the detection is passed. And corresponding to the same original code, the position of the code to be submitted after the detection of the incremental code is consistent; if the judgment result is yes, it is determined that the same original code is corresponding, and the position of the code modification is consistent. After the detection, the incremental code to be submitted is the conflicting code and the incremental code to be submitted after the detection is passed; based on the priority evaluation factor, the priority code of the pending incremental code after the detection is passed; The priority order of the evaluation is sequentially submitted from high to low, and the incremental code to be submitted after the detection is passed to the code warehouse.

所述優先順序評估因素包括對代碼進行修改的修改時間,代碼修改行數,以及代碼重要性;所述提交模組203提交模組基於優先順序評估因素對多個存在衝突且檢測通過後的待提交增量代碼進行優先順序評估,具體包括:基於影響程度對各個存在衝突且檢測通過的待提交增量代碼的代碼重要性進行評估,以及獲取各個存在衝突且檢測通過的待提交增量代碼的修改時間和代碼修改行數;基於修改時間,代碼修改行數以及代碼重要性來對各個存在衝突且檢測通過的待提交增量代碼的優先順序進行評估;基於評估結果確定各個存在衝突且檢測通過的待提交增量代碼的優先順序。 The priority evaluation factor includes a modification time for modifying the code, a code modification line number, and a code importance; the submission module 203 submits the module based on the priority evaluation factor to the plurality of conflicts and the detection after the passage The incremental code is submitted for priority evaluation, which includes: evaluating the importance of the code of each of the conflicting and detected passing incremental codes based on the degree of influence, and obtaining the incremental code to be submitted that each conflict exists and passes the test. Modifying the time and code to modify the number of rows; based on the modification time, the number of lines modified by the code, and the importance of the code to evaluate the priority order of each conflicting and detected incremental code to be submitted; determining each conflict based on the evaluation result and passing the detection The priority order of the incremental code to be submitted.

與現有技術相比,本申請案中在獲取待提交增量代碼之後,會對待提交增量代碼進行檢測,只有再檢測通過後的待提交增量代碼才會提交,這樣使得代碼遞交後,保證了被提交代碼的準確性,且可以儘早發現問題,不會影響到其他需要利用該提交代碼的程式或者過程。 Compared with the prior art, in the present application, after the incremental code to be submitted is obtained, the incremental code to be submitted is detected, and only the incremental code to be submitted after the re-test is passed, so that the code is submitted, and then the guarantee is guaranteed. The accuracy of the submitted code, and the problem can be found as early as possible, without affecting other programs or processes that need to use the submitted code.

通過以上的實施方式的描述,本領域的技術人員可以清楚地瞭解到本申請案可以通過硬體實現,也可以借助軟體加必要的通用硬體平臺的方式來實現。基於這樣的理解,本申請案的技術方案可以以軟體產品的形式體現出來,該軟體產品可以儲存在一個非易失性儲存媒體(可以 是CD-ROM,U盤,移動硬碟等)中,包括若干指令用以使得一台電腦設備(可以是個人電腦,伺服器,或者網路設備等)執行本申請案各個實施場景所述的方法。 Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by hardware, or by means of a software plus a necessary universal hardware platform. Based on the understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.). A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in the various implementation scenarios of the present application.

本領域技術人員可以理解附圖只是一個較佳實施場景的示意圖,附圖中的模組或流程並不一定是實施本申請案所必須的。 A person skilled in the art can understand that the drawings are only a schematic diagram of a preferred implementation scenario, and the modules or processes in the drawings are not necessarily required to implement the present application.

本領域技術人員可以理解實施場景中的裝置中的模組可以按照實施場景描述進行分佈於實施場景的裝置中,也可以進行相應變化位於不同於本實施場景的一個或多個裝置中。上述實施場景的模組可以合併為一個模組,也可以進一步拆分成多個子模組。 A person skilled in the art may understand that the modules in the device in the implementation scenario may be distributed in the device that implements the scenario according to the implementation scenario description, or may be correspondingly changed in one or more devices different from the implementation scenario. The modules of the above implementation scenarios may be combined into one module, or may be further split into multiple sub-modules.

上述本申請案序號僅僅為了描述,不代表實施場景的優劣。 The serial numbers of the above application are for the purpose of description only and do not represent the advantages and disadvantages of the implementation scenario.

以上公開的僅為本申請案的幾個具體實施場景,但是,本申請案並非局限於此,任何本領域的技術人員能思之的變化都應落入本申請案的保護範圍。 The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any changes that can be made by those skilled in the art should fall within the protection scope of the present application.

Claims (16)

一種代碼提交方法,其特徵在於,包括:獲取預備向代碼倉庫提交的待提交增量代碼;對所述待提交增量代碼進行檢測;提交檢測通過的待提交增量代碼到所述代碼倉庫。  A code submission method, comprising: obtaining an incremental code to be submitted submitted to the code warehouse; detecting the incremental code to be submitted; and submitting the incremental code to be submitted through the detection to the code warehouse.   如申請專利範圍第1項所述的方法,其中,所述對所述待提交增量代碼進行檢測,具體包括:對所述待提交增量代碼進行代碼審查;對所述待提交增量代碼進行任務測試;若所述代碼審查通過且所述任務測試通過,則確定對所述待提交增量代碼的檢測通過。  The method of claim 1, wherein the detecting the incremental code to be submitted comprises: performing code review on the incremental code to be submitted; and adding the incremental code to be submitted. Performing a task test; if the code review passes and the task test passes, it is determined that the detection of the pending incremental code is passed.   如申請專利範圍第2項所述的方法,其中,所述對所述待提交增量代碼進行代碼審查,具體包括:將所述待提交增量代碼發送給多個審查者進行審查;接收審查者回饋的審查結果;如審查結果為超過預設個數的審查者審查所述待提交增量代碼通過,則確定所述待提交增量代碼審查通過。  The method of claim 2, wherein the performing the code review on the incremental code to be submitted comprises: sending the incremental code to be submitted to a plurality of reviewers for review; receiving the review If the review result is that the reviewer exceeds the preset number of reviewers, the incremental code review is to be submitted.   如申請專利範圍第2項所述的方法,其中,所述對所述待提交增量代碼進行任務測試,具體包括:對所述待提交增量代碼的依賴代碼執行編譯;在對依賴代碼執行編譯時進行指定任務的任務測試;在對依賴代碼編譯完成之後進行預設任務的任務測試;獲取指定任務與預設任務的任務測試結果; 若任務測試結果為全部通過,則確定對所述待提交增量代碼的任務測試通過。  The method of claim 2, wherein the performing the task test on the incremental code to be submitted comprises: performing compilation on the dependent code of the incremental code to be submitted; performing on the dependent code Performing a task test of a specified task at compile time; performing a task test of a preset task after compiling the dependent code; obtaining a task test result of the specified task and the preset task; and if the task test result is all passed, determining the waiting for the task The task test that submitted the incremental code passed.   如申請專利範圍第4項所述的方法,其中,所述對所述待提交增量代碼的依賴代碼執行編譯,具體包括:監控所述待提交增量代碼的依賴代碼是否發生變化;編譯發生了變化的依賴代碼;提取沒有發生變化的依賴代碼對應的程式館檔到指定位置,以便在對所述待提交增量代碼進行編譯時,直接引用所述程式館檔。  The method of claim 4, wherein the compiling the dependent code of the incremental code to be submitted comprises: monitoring whether the dependent code of the incremental code to be submitted changes; compiling occurs. The dependent dependency code is extracted; the library file corresponding to the dependent code that has not changed is extracted to a specified location, so that the program library file is directly referenced when compiling the incremental code to be submitted.   如申請專利範圍第4項所述的方法,其中,進行任務測試,具體包括:基於所述待提交增量代碼的儲存路徑地址在配置庫中指定位置查找任務設定檔;若在指定位置沒有查找到所述任務設定檔,則在所述指定位置的父目錄所在位置查找所述任務設定檔,並利用查找到的任務設定檔進行任務測試;若在父路徑所在位置查找到所述任務設定檔,提取查找到的最新的任務設定檔,並利用提取的最新的任務設定檔進行任務測試;若在父路徑所在位置未查找到所述任務設定檔,基於預設的通用配置來進行任務測試。  The method of claim 4, wherein the performing the task test comprises: searching for a task profile in a specified location in the configuration repository based on the storage path address of the incremental code to be submitted; if not searching at the specified location Go to the task profile, search for the task profile at the location of the parent directory of the specified location, and perform task test using the found task profile; if the task profile is found at the location of the parent path Extracting the latest task profile found, and using the extracted latest task profile for task testing; if the task profile is not found at the location of the parent path, the task is tested based on the preset common configuration.   如申請專利範圍第1項所述的方法,其中,所述提交檢測通過後的待提交增量代碼到所述代碼倉庫,具體包括: 判斷檢測通過後的待提交增量代碼是否存在多個;若判斷結果為是,判斷是否存在檢測通過後的多個待提交增量代碼對應於同一原始程式碼,且對應於同一原始程式碼的檢測通過後的多個待提交增量代碼進行代碼修改的位置一致;若判斷結果為是,則確定對應同一個原始程式碼,且代碼修改的位置一致的多個檢測通過後的待提交增量代碼為存在衝突且檢測通過後的待提交增量代碼;基於優先順序評估因素對多個存在衝突且檢測通過後的待提交增量代碼進行優先順序評估;按照評估得到的優先順序依序從高到低依次提交存在衝突且檢測通過後的待提交增量代碼到所述代碼倉庫。  The method of claim 1, wherein the submitting the detected incremental code to be submitted to the code warehouse after the detection comprises: determining whether there is a plurality of incremental codes to be submitted after the detection is passed; If the result of the determination is yes, it is determined whether there is a plurality of to-be-delivered incremental codes corresponding to the same original code after the detection is passed, and the code corresponding to the incremental code corresponding to the same original code is used for the code modification. If the result of the determination is YES, it is determined that the incremental code corresponding to the same original code and the position of the code modification is consistent with the pending code to be submitted, and the incremental code to be submitted after the detection is passed; Prioritizing the plurality of conflicting and post-tested incremental codes to be submitted based on the priority evaluation factor; submitting the conflicts to be submitted in descending order according to the priority order of the evaluations Code to the code repository.   如申請專利範圍第7項所述的方法,其中,所述優先順序評估因素包括對代碼進行修改的修改時間,代碼修改行數,以及代碼重要性;所述基於優先順序評估因素對多個存在衝突且檢測通過後的待提交增量代碼進行優先順序評估,具體包括:基於影響程度對各個存在衝突且檢測通過的待提交增量代碼的代碼重要性進行評估,以及獲取各個存在衝突且檢測通過的待提交增量代碼的修改時間和代碼修改行數;基於修改時間,代碼修改行數以及代碼重要性來對各個存在衝突且檢測通過的待提交增量代碼的優先順序進行評估;基於評估結果確定各個存在衝突且檢測通過的待提交 增量代碼的優先順序。  The method of claim 7, wherein the priority evaluation factor includes a modification time of modifying the code, a code modification line number, and a code importance; the priority evaluation factor is based on the plurality of presence factors The priority of the conflict is detected by the incremental code to be submitted after the detection, and the method includes: estimating the importance of the code of each of the conflicting and detecting the pending incremental code based on the degree of influence, and obtaining each conflict and detecting the pass The modification time of the incremental code to be submitted and the number of code modification lines; based on the modification time, the number of lines modified by the code, and the code importance to evaluate the priority order of each conflicting and detected incremental code to be submitted; based on the evaluation result Determine the priority order of each pending incremental code that has conflicts and passes the test.   一種代碼提交設備,其特徵在於,包括:獲取模組,用於獲取預備向代碼倉庫提交的待提交增量代碼;檢測模組,用於對所述待提交增量代碼進行檢測;提交模組,用於提交檢測通過的待提交增量代碼到代碼倉庫。  A code submission device, comprising: an acquisition module, configured to acquire an incremental code to be submitted to be submitted to a code warehouse; a detection module, configured to detect the incremental code to be submitted; and submit a module , used to submit the detected incremental code to be submitted to the code repository.   如申請專利範圍第9項所述的設備,其中,所述檢測模組,具體用於:對所述待提交增量代碼進行代碼審查;對所述待提交增量代碼進行任務測試。 若所述代碼審查通過且所述任務測試通過,則確定對所述待提交增量代碼的檢測通過。  The device of claim 9, wherein the detecting module is configured to perform code review on the incremental code to be submitted, and perform task testing on the incremental code to be submitted. If the code review passes and the task test passes, it is determined that the detection of the pending incremental code is passed.   如申請專利範圍第10項所述的設備,其中,所述檢測模組對所述待提交增量代碼進行代碼審查,具體包括:將所述待提交增量代碼發送給多個審查者進行審查;接收審查者回饋的審查結果;如審查結果為超過預設個數的審查者審查所述待提交增量代碼通過,則確定所述待提交增量代碼審查通過。  The device of claim 10, wherein the detecting module performs code review on the incremental code to be submitted, specifically: sending the incremental code to be submitted to multiple reviewers for review Receiving the review result of the reviewer's feedback; if the review result is that the reviewer who exceeds the preset number reviews the incremental code to be submitted, it is determined that the incremental code review to be submitted is passed.   如申請專利範圍第10項所述的設備,其中,所述檢測模組對所述待提交增量代碼進行任務測試,具體包括:對所述待提交增量代碼的依賴代碼執行編譯; 在對依賴代碼執行編譯時進行指定任務的任務測試;在對依賴代碼編譯完成之後進行預設任務的任務測試;獲取指定任務與預設任務的任務測試結果;若任務測試結果為全部通過,則確定對所述待提交增量代碼的任務測試通過。  The device of claim 10, wherein the detecting module performs task testing on the incremental code to be submitted, specifically: performing compilation on the dependent code of the incremental code to be submitted; Relying on the code to perform the task test of the specified task when compiling; performing the task test of the preset task after compiling the dependent code; obtaining the task test result of the specified task and the preset task; if the task test result is all passed, determining the pair The task of the incremental code to be submitted is tested.   如申請專利範圍第12項所述的設備,其中,所述檢測模組對所述待提交增量代碼的依賴代碼執行編譯,具體包括:監控所述待提交增量代碼的依賴代碼是否發生變化;編譯發生了變化的依賴代碼;提取沒有發生變化的依賴代碼對應的程式館檔到指定位置,以便在對所述待提交增量代碼進行編譯時,直接引用所述程式館檔。  The device of claim 12, wherein the detecting module performs compilation on the dependent code of the incremental code to be submitted, and specifically includes: monitoring whether the dependent code of the incremental code to be submitted changes. Compiling the dependent code that has changed; extracting the library file corresponding to the dependent code that has not changed to the specified location, so as to directly reference the program library file when compiling the incremental code to be submitted.   如申請專利範圍第12項所述的設備,其中,所述檢測模組進行任務測試,具體包括:基於所述待提交增量代碼的儲存路徑地址在配置庫中指定位置查找任務設定檔;若在指定位置沒有查找到所述任務設定檔,則在所述指定位置的父目錄所在位置查找所述任務設定檔,並利用查找到的任務設定檔進行任務測試;若在父路徑所在位置查找到所述任務設定檔,提取查找到的最新的任務設定檔,並利用提取的最新的任務設定檔進行任務測試; 若在父路徑所在位置未查找到所述任務設定檔,基於預設的通用配置來進行任務測試。  The device of claim 12, wherein the detecting module performs task testing, specifically: searching for a task profile in a specified location in the configuration library based on the storage path address of the incremental code to be submitted; If the task profile is not found in the specified location, the task profile is searched for in the location of the parent directory of the specified location, and the task profile is searched by using the found task profile; if the parent path is found in the location of the parent path The task profile, extracting the found latest task profile, and performing task test using the extracted latest task profile; if the task profile is not found at the location of the parent path, based on the preset common configuration To perform task testing.   如申請專利範圍第9項所述的設備,其中,所述提交模組,具體用於:判斷檢測通過後的待提交增量代碼是否存在多個;若判斷結果為是,判斷是否存在檢測通過後的多個待提交增量代碼對應於同一原始程式碼,且對應於同一原始程式碼的檢測通過後的多個待提交增量代碼進行代碼修改的位置一致;若判斷結果為是,則確定對應同一個原始程式碼,且代碼修改的位置一致的多個檢測通過後的待提交增量代碼為存在衝突且檢測通過後的待提交增量代碼;基於優先順序評估因素對多個存在衝突且檢測通過後的待提交增量代碼進行優先順序評估;按照評估得到的優先順序依序從高到低依次提交存在衝突且檢測通過後的待提交增量代碼到所述代碼倉庫。  The device of claim 9, wherein the submitting module is specifically configured to: determine whether there is a plurality of incremental codes to be submitted after the detection is passed; if the determination result is yes, determine whether the detection passes The plurality of pending incremental codes corresponding to the same original code, and corresponding to the same original code, after the detection of the plurality of to-be-delivered incremental codes, the code modification is consistent; if the determination result is yes, then determining Corresponding to the same original code, and the position of the code modification is consistent, the incremental code to be submitted is the conflicting code and the incremental code to be submitted after the detection is passed; The priority code to be submitted is detected after the passing of the incremental code to be submitted; and the incremental code to be submitted after the conflict is detected and sequentially passed to the code warehouse according to the priority order of the evaluation.   如申請專利範圍第15項所述的設備,其中,所述優先順序評估因素包括對代碼進行修改的修改時間,代碼修改行數,以及代碼重要性;所述提交模組基於優先順序評估因素對多個存在衝突且檢測通過後的待提交增量代碼進行優先順序評估,具體包括:基於影響程度對各個存在衝突且檢測通過的待提交增量代碼的代碼重要性進行評估,以及獲取各個存在衝突且 檢測通過的待提交增量代碼的修改時間和代碼修改行數;基於修改時間,代碼修改行數以及代碼重要性來對各個存在衝突且檢測通過的待提交增量代碼的優先順序進行評估;基於評估結果確定各個存在衝突且檢測通過的待提交增量代碼的優先順序。  The device of claim 15, wherein the priority evaluation factor comprises a modification time of modifying the code, a code modification line number, and a code importance; the submitting module is based on a priority evaluation factor pair A plurality of conflicting and detected incremental code to be submitted for priority evaluation, including: evaluating the importance of the code of each of the conflicting and detected passing incremental codes based on the degree of influence, and obtaining each conflict And detecting the modified time of the pending incremental code and the number of modified lines of the code; based on the modification time, the number of modified lines of the code and the importance of the code to evaluate the priority order of each of the conflicting and detected incremental codes to be submitted; Based on the evaluation result, the priority order of each of the conflicting and detected passing incremental codes is determined.  
TW106101938A 2017-01-19 2017-01-19 Code submission method and equipment TWI735511B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW106101938A TWI735511B (en) 2017-01-19 2017-01-19 Code submission method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW106101938A TWI735511B (en) 2017-01-19 2017-01-19 Code submission method and equipment

Publications (2)

Publication Number Publication Date
TW201828053A true TW201828053A (en) 2018-08-01
TWI735511B TWI735511B (en) 2021-08-11

Family

ID=63960487

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106101938A TWI735511B (en) 2017-01-19 2017-01-19 Code submission method and equipment

Country Status (1)

Country Link
TW (1) TWI735511B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI710896B (en) * 2019-01-14 2020-11-21 宏碁股份有限公司 Cloud system and method for integrating a cloud system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7593943B2 (en) * 2005-01-14 2009-09-22 Microsoft Corporation Method and system for synchronizing multiple user revisions to a shared object
CN101963911B (en) * 2010-09-29 2015-12-16 用友网络科技股份有限公司 Patch generates method and apparatus
AU2012340684A1 (en) * 2011-11-22 2014-07-17 Solano Labs, Inc. System of distributed software quality improvement
CN103744678B (en) * 2014-01-14 2017-05-03 清华大学 Method for determining static function call relations based on register transfer language
CN104077140B (en) * 2014-07-04 2017-11-07 用友网络科技股份有限公司 Automation Compilation Method and compilation device for continuous integrating
CN105302533B (en) * 2014-07-25 2020-04-07 腾讯科技(深圳)有限公司 Code synchronization method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI710896B (en) * 2019-01-14 2020-11-21 宏碁股份有限公司 Cloud system and method for integrating a cloud system

Also Published As

Publication number Publication date
TWI735511B (en) 2021-08-11

Similar Documents

Publication Publication Date Title
WO2017036335A1 (en) Code submitting method and device
US11366747B2 (en) Unified test automation system
US10949225B2 (en) Automatic detection of user interface elements
CN107885660B (en) Fund system automatic test management method, device, equipment and storage medium
US9824002B2 (en) Tracking of code base and defect diagnostic coupling with automated triage
US11366713B2 (en) System and method for automatically identifying and resolving computing errors
CA2777434C (en) Verifying application security vulnerabilities
US9703692B2 (en) Development supporting system
US11836072B2 (en) Risk-based root cause identification methods and related autobuild systems
CN111625839A (en) Third-party component vulnerability detection method, device, device and computer storage medium
US10509693B2 (en) Method for identifying a cause for a failure of a test
Behnamghader et al. Towards better understanding of software quality evolution through commit-impact analysis
US10949333B1 (en) Application maturity console
US11436133B2 (en) Comparable user interface object identifications
CN114238110B (en) Software application testing method, device, equipment and storage medium
Shimagaki et al. Why are commits being reverted?: A comparative study of industrial and open source projects
US9563541B2 (en) Software defect detection identifying location of diverging paths
CN103064780B (en) A kind of method of software test and device
CN111654495B (en) Method, apparatus, device and storage medium for determining traffic generation source
US10176087B1 (en) Autogenic test framework
Xu et al. Detecting cloud provisioning errors using an annotated process model
KR20190020363A (en) Method and apparatus for analyzing program by associating dynamic analysis with static analysis
TWI735511B (en) Code submission method and equipment
CN113031995B (en) Rule updating method and device, storage medium and electronic equipment
Neelapu Enhancement of Software reliability using Automatic API Testing Model

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees