WO2019037418A1 - 代码管理方法、装置、计算机设备和计算机可读存储介质 - Google Patents

代码管理方法、装置、计算机设备和计算机可读存储介质 Download PDF

Info

Publication number
WO2019037418A1
WO2019037418A1 PCT/CN2018/079963 CN2018079963W WO2019037418A1 WO 2019037418 A1 WO2019037418 A1 WO 2019037418A1 CN 2018079963 W CN2018079963 W CN 2018079963W WO 2019037418 A1 WO2019037418 A1 WO 2019037418A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
configuration file
task package
code
name
Prior art date
Application number
PCT/CN2018/079963
Other languages
English (en)
French (fr)
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 深圳壹账通智能科技有限公司
Publication of WO2019037418A1 publication Critical patent/WO2019037418A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Definitions

  • the present application relates to a code management method, apparatus, computer device, and computer readable storage medium.
  • Git Distributed Version Control System
  • the inventor realized that when managing code through Git, since the main project in Git does not directly track the code of the submodule, but only tracks the change of the commit id of the submodule, when the code is changed, Not only need to change the commit id of the submodule to the corresponding submodule in the main project, but also change the commit id of all the upper module of the submodule and the main project. Once the commit id of the submodule is changed, the submodule will be free. Status, this change will be lost when the main project is updated.
  • a code management method, apparatus, computer device, and computer readable storage medium are provided.
  • a code management method that includes:
  • Obtaining a configuration file of the task package where the configuration file includes a code address of the module and a branch of the module, where the branch of the module is represented by a nested module name;
  • the code of the module missing in the task package is obtained from the code base according to the code address of the module in the configuration file;
  • the acquired code is updated into the task package according to the branch of the module in the configuration file.
  • a code management device comprising:
  • a configuration file obtaining module configured to acquire a configuration file of the task package, where the configuration file includes a code address of the module and a branch of the module, where the branch of the module is represented by a nested module name;
  • a detecting module configured to detect whether a module recorded in the configuration file is missing in the task package
  • a code obtaining module configured to: when a module recorded in the configuration file is missing in the task package, obtain a module that is missing from the task package from a code base according to a code address of a module in the configuration file Code;
  • an update module configured to update the acquired code into the task package according to a branch of the module in the configuration file.
  • a computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executable by the processor to cause the one or more processors to execute The following steps:
  • Obtaining a configuration file of the task package where the configuration file includes a code address of the module and a branch of the module, where the branch of the module is represented by a nested module name;
  • the code of the module missing in the task package is obtained from the code base according to the code address of the module in the configuration file;
  • the acquired code is updated into the task package according to the branch of the module in the configuration file.
  • One or more non-transitory computer readable instruction storage media storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the steps of:
  • Obtaining a configuration file of the task package where the configuration file includes a code address of the module and a branch of the module, where the branch of the module is represented by a nested module name;
  • the code of the module missing in the task package is obtained from the code base according to the code address of the module in the configuration file;
  • the acquired code is updated into the task package according to the branch of the module in the configuration file.
  • FIG. 1 is an application environment diagram of a code management method in accordance with one or more embodiments.
  • FIG. 2 is a flow diagram of a code management method in accordance with one or more embodiments.
  • FIG. 3 is a flow chart of step S204 in the embodiment shown in FIG. 2.
  • FIG. 4 is a schematic diagram of a configuration file of a task package in accordance with one or more embodiments.
  • FIG. 5 is a timing diagram of steps of modifying a profile in accordance with one or more embodiments.
  • FIG. 6 is a block diagram of a code management apparatus in accordance with one or more embodiments.
  • FIG. 7 is a block diagram of a computer device in accordance with one or more embodiments.
  • FIG. 1 is an application environment diagram of a code management method in an embodiment, including several computer devices and a review terminal.
  • Several computer devices can communicate with the auditing end, and the R&D personnel can write a new file on the computer device.
  • Code, and the code can be sent to the reviewing end for review. Only the code passed by the review can be updated into the task package, so that the task package can be stored and sent to the user terminal, so that the user terminal can update according to the task package.
  • Corresponding content such as client APP.
  • a code management method is provided.
  • the present embodiment is exemplified by applying the method to the computer device in FIG. 1 described above.
  • Code-managed computer readable instructions are executed on the computer device, and the code management method is implemented by computer readable instructions managed by the code.
  • the method specifically includes the following steps:
  • S202 Acquire a configuration file of the task package, where the configuration file includes a code address of the module and a branch of the module, and the branch of the module is represented by a nested module name.
  • a task package refers to a project in a software development process.
  • an application corresponding to an application corresponds to a task package, which contains all the code of the application, and the code is stored in a module, for example, an application can Provide different functions, one function can be a module.
  • a configuration file is a configuration file for the task package that stores the names of all modules in the task package, the code address of the module, and the branches of the module.
  • the code address of the module is the address stored by the code of the module.
  • the branch of the module is represented by the nested name of the module. For example, if the modules module is under the release module, the branches are represented as release, and the release module is nested in abc.
  • the branch of the release module is represented as abc.
  • the branches of the modules module can also be represented as abc-release, indicating that the modules module is first nested under the release module, and then the release module is nested in Abc module.
  • the task package After obtaining the configuration file of the task package, first determining whether the module recorded in the configuration file is missing in the task package, if the module recorded in the configuration file is missing in the task package, the task package is not updated, thereby The task package needs to be updated according to the configuration file to ensure the integrity of the task package.
  • the computer device can obtain the code of the module missing from the task package from the code base according to the code address of the module, and the code library is a database storing the code of all the modules.
  • the module recorded in the configuration file is missing from the task package, the task package is updated according to the configuration file.
  • the task package is read according to the code address of the modules module in the configuration file. Take the code of the modules module, so that the code of the modules module can be updated into the task package, thus ensuring the integrity of the task package.
  • the computer device obtains the branch of the modules module from the configuration file, that is, the release module, so that the code can be updated to the release module according to the branch, and the release module is the abc module.
  • the abc module can be updated according to the update of the release module until the main module of the task package, so that each added module can be associated with other modules in the task package to prevent free branches.
  • the above code management method configures a configuration file for the task package, and the code address of the module in the configuration file gives the storage address of the code of each module, and the branch of the module gives the branch to which each module belongs by nesting the module name. Therefore, each module can obtain its own branch according to the module name, preventing the occurrence of free branches when the task package is updated, and when the task package needs to be updated, only the code address of the module in the configuration file and the branch pair of the module are needed.
  • the task package can be updated, and it is no longer necessary to manually add the modules in the task package, which improves the efficiency of the task package update.
  • FIG. 3 is involved in the process of step S204 in the embodiment shown in FIG. 2.
  • the step S204 that is, detecting whether the module recorded in the configuration file is missing in the task package may include:
  • S302 Detect whether a module whose name matches the name of the module recorded in the configuration file is missing in the task package.
  • FIG. 4 is a schematic diagram of a configuration file of a task package in an embodiment, where the configuration file includes a ver field, that is, a version number of the configuration file, and the version number of the configuration file may correspond to a version of the application.
  • the configuration file also includes several modules such as an app module, a common module, a framework module, a react_native/node_modules module, a react_native module, and a react_native/packager module, and other modules may also be included in other configuration files, wherein each module is a module.
  • the form of the name exists in the configuration file.
  • Each module in the configuration file includes two configuration information, one is a branch, that is, a branch, which can represent a branch to which the module belongs, such as an app module, belonging to the release-1.0.0 module, and the other is a repo, that is, a module code.
  • the address such as the code address of the app module, is http://xxx.xxx.xxx/xxx/app.git.
  • the release-1.0.0 module type 1.0.0 indicates the version of the release module to facilitate the update of each module, so that the task package can be updated according to the version number of the task package, and can also be based on each module in the task package. The version number is updated locally, making the task package more flexible when it is updated.
  • the computer device when judging whether the module recorded in the configuration file is missing in the task package, first determining according to the name of the module, that is, determining whether the names of the modules in the task package are all in the configuration file, if a module name exists Appears in the configuration file, but does not exist in the task package, indicating that the module is missing from the task package, so the computer device needs to update the module to the task according to the code address of the module and the branch of the module recorded in the configuration file. in the bag. In addition, if a module exists in the task package but does not exist in the configuration file, that is, the module name of a module in the task package does not match the module name recorded in the configuration file, the computer device directly deletes the task package. The module in it can be.
  • the monitoring task can be continued. Whether the label of the module in the package is consistent with the label of the module in the configuration file. For example, when the label of the release module in the task package is 1.2.0, and the label of the release module in the configuration file is 1.3.0, it is also considered at this time. The module recorded in the configuration file is missing from the task package.
  • the module recorded in the configuration file is also considered to be missing from the task package, thereby The computer device is required to update the module to the task package according to the code address of the module and the branch of the module recorded in the configuration file.
  • “1.0.0” in “release-1.0.0” in Figure 4 is the version label, which can be applied to code query, code rollback, for example, when the code is rolled back, it can include: obtaining the stored in the computer The target version label in the device; replace the current version label of the module in the configuration file with the target version label, and then continue to update the task package, then read the configuration file of the task package, that is, the specific module in the task package can be updated. Go to the target version without having to manually change the code, etc.
  • whether the module recorded in the configuration file is missing in the task package is determined by the module name and the version label in the module name, so that the module in the task package can be accurately updated according to the configuration file, without manual Interventions save manpower.
  • the method may further include: acquiring the input code, entering the name of the module corresponding to the input code, and inputting the module corresponding to the input code. Branch; the generated code address according to the input code; the configuration file of the task package is modified and the modified configuration file is submitted according to the code address of the input code, the name of the input module, and the branch of the input module.
  • the step of obtaining a configuration file of the task package includes: obtaining the modified configuration file of the task package.
  • the method may further include: obtaining a difference between the modified configuration file of the task package and the configuration file before the modification; The difference between the modified configuration file of the package and the configuration file before modification is sent to the review side.
  • the step of obtaining the modified configuration file of the task package may include: when receiving the confirmation information returned by the review terminal indicating that the review is passed, acquiring the modified configuration file of the task package.
  • FIG. 5 is a sequence diagram of steps of modifying a configuration file in an embodiment, where the steps of modifying the configuration file may include:
  • the computer device can generate a code address according to the input code, so that the computer device can write the generated module code address into the configuration file, or the developer can manually input the address into the configuration file. That is, according to the code address of the input code, the name of the input module, and the branch of the input module, the configuration file of the task package is modified and the modified configuration file is submitted. For example, after the R&D personnel modify the configuration file, the configuration file needs to be submitted, so that the R&D personnel on the audit side can review whether the modification is passed.
  • the computer device first obtains the difference between the modified configuration file of the task package and the configuration file before the modification, and the difference includes the newly added module name in the configuration file, and a new addition.
  • the branch of the module and the code address of the newly added module so that the developer on the audit side can query the corresponding new code according to the newly added code address.
  • the difference may also include the name of the reduced module in the configuration file, the reduced branch of the module, and the code address of the reduced module, so that the developer on the audit side can judge whether the deletion of the module is correct according to the information.
  • the difference can also include the new version and the old version of the module that changed the version in the configuration file, so that the developer on the audit side can directly see the difference between the new version and the old version of the module.
  • the difference between the modified configuration file of the task package and the configuration file before the modification is sent to the reviewing end.
  • only the difference between the modified configuration file and the configuration file before modification is sent, and since the review terminal generally stores each configuration file, only the modified configuration file is sent.
  • the difference between the configuration files before the modification does not affect the full configuration file of the R&D personnel on the audit side.
  • only the difference between the modified configuration file and the configuration file before the modification is sent.
  • the R&D personnel at the review end can directly obtain the configuration file.
  • the difference in the number of revisions can shorten the review time.
  • the R&D personnel can review the difference to determine whether the modification can be directly applied.
  • the auditing end can automatically detect whether the sent difference has a syntax error, etc.
  • the computer equipment is convenient for the R&D personnel to know in time that when there is no grammatical error in the difference, the R&D personnel of the auditing end can be submitted for review, and if the audit is passed, the confirmation information is returned to the computer device, and when the computer receives the indication returned by the auditing end When the confirmation information passed is reviewed, the modified configuration file of the task package is obtained, so that the task package can be updated.
  • the configuration file according to the task package update is first reviewed. After the audit is passed, the computer device updates the task package according to the modified configuration file, so that the update can be guaranteed.
  • the correctness of the modules in the task package reduces the occurrence of code reflow and the like.
  • the method further includes: detecting whether the modification instruction for the submission code is received. When an modification instruction for the submission code is received, an invalid prompt for the modification instruction of the submission code is generated.
  • the method of code management is based on git
  • a commit code in git that is, a modification of the commit id
  • the task package is updated, and the commit id is modified according to the commit id, in order to avoid
  • the submission code is always fixed in the embodiment.
  • the modification instruction for the submission code is monitored, the modification of the submission code is prompted, for example, the developer may be prompted in the form of a pop-up box, thereby ensuring The commit code is unchanged, and the task package is updated based only on the configuration file, regardless of the update of the commit code.
  • the update of the submission code is rejected by detecting whether the modification instruction for the submission code is received, so that the update of the task package can be ensured only according to the configuration file, and the update of the submission code is not required, and the task package is updated. accuracy.
  • steps in the flowcharts of FIGS. 2, 3, and 5 are sequentially displayed in accordance with the indication of the arrows, these steps are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in FIGS. 2, 3, and 5 may include a plurality of sub-steps or stages, which are not necessarily performed at the same time, but may be executed at different times. The order of execution of the sub-steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of the other steps or other steps.
  • FIG. 6 is a block diagram of a code management apparatus in an embodiment, where the code management apparatus includes:
  • the configuration file obtaining module 100 is configured to obtain a configuration file of the task package, where the configuration file includes a code address of the module and a branch of the module, and the branch of the module is represented by a nested module name.
  • the detecting module 200 is configured to detect whether a module recorded in the configuration file is missing in the task package.
  • the code obtaining module 300 is configured to: when the module recorded in the configuration file is missing in the task package, obtain the code of the module missing from the task package from the code base according to the code address of the module in the configuration file.
  • the update module 400 is configured to update the acquired code into the task package according to the branch of the module in the configuration file.
  • the detection module 200 can include:
  • a name detecting unit configured to detect, in the task package, a module whose name matches the name of the module recorded in the configuration file, and when the module in the task package lacks a name whose name matches the name of the module recorded in the configuration file, The module recorded in the configuration file is missing from the task package.
  • the version label detecting unit is configured to detect, when the task package does not have a module whose name matches the name of the module recorded in the configuration file, detect the version label of the module in the task package and the version of the module recorded in the configuration file. Whether the tags match; and when the version tag of the module in the task package does not match the version tag of the module recorded in the configuration file, the module recorded in the configuration file is missing from the task package.
  • the code management apparatus 300 may further include:
  • the input acquisition module is configured to acquire the input code, the name of the input module corresponding to the input code, and the input branch of the module corresponding to the input code.
  • a generation module for generating a code address based on the entered code.
  • the modification module is configured to modify the configuration file of the task package according to the code address of the input code, the name of the input module, and the branch of the input module, and submit the modified configuration file.
  • the code management apparatus may further include:
  • the difference obtaining module is configured to obtain a difference between the modified configuration file of the task package and the configuration file before the modification.
  • the sending module is configured to send the difference between the modified configuration file of the task package and the configuration file before the modification to the reviewing end.
  • the configuration file obtaining module is further configured to obtain the modified configuration file of the task package when receiving the confirmation information returned by the reviewing end indicating that the review is passed.
  • the code management apparatus may further include:
  • the detecting module is configured to detect whether a modification instruction for the submission code is received; when the modification instruction for the submission code is received, generate an invalidation prompt for the modification instruction of the submission code.
  • the above definition of the code management apparatus may participate in the above definition of the code management method, and details are not described herein again.
  • the various modules in the above code management apparatus may be implemented in whole or in part by software, hardware, and combinations thereof.
  • Each of the above modules may be embedded in or independent of the processor in the computer device, or may be stored in a memory in the computer device in a software form, so that the processor invokes the operations corresponding to the above modules.
  • a computer device which may be a terminal, and its internal structure diagram may be as shown in FIG.
  • the computer device includes a processor, memory, network interface, display screen, and input device connected by a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium, an internal memory.
  • the non-volatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for operation of an operating system and computer programs in a non-volatile storage medium.
  • the network interface of the computer device is used to communicate with an external terminal via a network connection.
  • the computer program is executed by the processor to implement a code management method.
  • the display screen of the computer device may be a liquid crystal display or an electronic ink display screen
  • the input device of the computer device may be a touch layer covered on the display screen, or may be a button, a trackball or a touchpad provided on the computer device casing. It can also be an external keyboard, trackpad or mouse.
  • FIG. 7 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the solution of the present application is applied.
  • the specific computer device may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
  • a computer apparatus comprising a memory and a processor, the memory storing a computer program, the processor executing the computer program to: obtain a configuration file of a task package, the module includes a module The code address and the branch of the module, the branch of the module is represented by the nested module name; whether the module recorded in the configuration file is missing in the task package; when the module recorded in the configuration file is missing from the task package, according to the configuration
  • the code address of the module in the file obtains the code of the module missing from the task package from the code base; and updates the acquired code to the task package according to the branch of the module in the configuration file.
  • the following steps may be further implemented: detecting whether a module in the task package whose name matches the name of the module recorded in the configuration file is missing; when the task package lacks a name and When the module whose name is recorded in the configuration file matches the module, the module recorded in the configuration file is missing from the task package; when the module with the name matching the name of the module recorded in the configuration file is not missing in the task package , detecting whether the version label of the module in the task package matches the version label of the module recorded in the configuration file; and when the version label of the module in the task package does not match the version label of the module recorded in the configuration file, The module recorded in the configuration file is missing from the task package.
  • the processor when the processor executes the computer readable instructions, the following steps may be implemented: obtaining the input code, entering the name of the module corresponding to the input code, and inputting the module corresponding to the input code. Branch; according to the generated code address of the input code; and according to the code address of the input code, the name of the input module, and the branch of the input module, modify the configuration file of the task package and submit the modified configuration file;
  • the steps of the package configuration file include: obtaining the modified configuration file of the task package.
  • the following steps may be further performed: obtaining a difference between the modified configuration file of the task package and the configuration file before the modification; and modifying the modified configuration file of the task package
  • the processor may further implement the steps of: detecting whether a modification instruction for the submission code is received when executing the computer readable instruction; and generating a modification instruction for the submission code when receiving the modification instruction for the submission code Invalid prompt to modify the instruction.
  • One or more non-volatile storage media storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the steps of: obtaining a configuration file for a task package
  • the configuration file includes the code address of the module and the branch of the module.
  • the branch of the module is represented by the nested name of the module; whether the module recorded in the configuration file is missing in the task package; when the configuration file is missing from the configuration file
  • the code of the module missing from the task package is obtained from the code base according to the code address of the module in the configuration file; and the acquired code is updated into the task package according to the branch of the module in the configuration file.
  • the computer readable instructions when executed by the processor may further implement the step of detecting whether a module in the task package whose name matches the name of the module recorded in the configuration file is missing; when the task package is missing When the module whose name matches the name of the module recorded in the configuration file, the module recorded in the configuration file is missing from the task package; when the name is not missing in the task package, the name of the module recorded in the configuration file matches In the module, it is detected whether the version label of the module in the task package matches the version label of the module recorded in the configuration file; and the version label of the module in the task package does not match the version label of the module recorded in the configuration file. The module recorded in the configuration file is missing from the task package.
  • the computer readable instructions when executed by the processor may further implement the steps of: obtaining the input code, inputting a name of the module corresponding to the input code, and inputting the input code corresponding to the code.
  • the step of obtaining a configuration file of the task package includes: obtaining a modified configuration file of the task package.
  • the following steps may be further performed: obtaining a difference between the modified configuration file of the task package and the configuration file before the modification; and modifying the modified configuration file of the task package.
  • the computer readable instructions when executed by the processor may further implement the steps of: detecting whether a modification instruction for the submission code is received; and when receiving the modification instruction for the submission code, generating the submission Invalid prompt for the code modification instruction.
  • Non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in a variety of formats, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization chain.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • Synchlink DRAM SLDRAM
  • Memory Bus Radbus
  • RDRAM Direct RAM
  • DRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Abstract

一种代码管理方法,该方法包括:获取任务包的配置文件,配置文件中包括模块的代码地址及模块的分支,模块的分支是通过模块名称嵌套表示的;检测任务包中是否缺少配置文件中所记录的模块;若是,则根据配置文件中模块的代码地址从代码库中获取任务包中所缺少的模块的代码;根据配置文件中模块的分支,将获取的代码更新到所述任务包中。

Description

代码管理方法、装置、计算机设备和计算机可读存储介质
相关申请的交叉引用
本申请要求于2017年8月25日提交中国专利局,申请号为201710744853X,申请名称为“代码管理方法、装置、计算机设备和计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及一种代码管理方法、装置、计算机设备和计算机可读存储介质。
背景技术
Git(分布式版本控制系统)因其便捷、高效性,被越来越多的开源项目所使用,并且一些传统的非开源项目,也开始逐步考虑使用Git来管理代码。
但是,发明人意识到,通过Git管理代码时,由于Git中主工程并不直接跟踪子模块的代码,而只是跟踪子模块的commit id(提交码)的改动,因此当将改动的代码提交后,不仅需要到主工程中相应的子模块改动子模块的commit id,还需要将子模块的所有上层模块和主工程的commit id改动,一旦只改动子模块的commit id,该子模块会处于游离状态,在主工程更新时,本次改动就会丢失。
发明内容
根据本申请公开的各种实施例,提供一种代码管理方法、装置、计算机设备和计算机可读存储介质。
一种代码管理方法,包括:
获取任务包的配置文件,所述配置文件中包括模块的代码地址以及模块的分支,所述模块的分支是通过模块名称嵌套表示的;
检测所述任务包中是否缺少所述配置文件中所记录的模块;
当所述任务包中缺少所述配置文件中所记录的模块时,则根据所述配置文件中模块的代码地址从代码库中获取所述任务包中所缺少的模块的代码;及
根据所述配置文件中模块的分支,将获取的代码更新到所述任务包中。
一种代码管理装置,包括:
配置文件获取模块,用于获取任务包的配置文件,所述配置文件中包括模块的代码地址以及模块的分支,所述模块的分支是通过模块名称嵌套表示的;
检测模块,用于检测所述任务包中是否缺少所述配置文件中所记录的模块;
代码获取模块,用于当所述任务包中缺少所述配置文件中所记录的模块时,则根据所 述配置文件中模块的代码地址从代码库中获取所述任务包中所缺少的模块的代码;及
更新模块,用于根据所述配置文件中模块的分支,将获取的代码更新到所述任务包中。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:
获取任务包的配置文件,所述配置文件中包括模块的代码地址以及模块的分支,所述模块的分支是通过模块名称嵌套表示的;
检测所述任务包中是否缺少所述配置文件中所记录的模块;
当所述任务包中缺少所述配置文件中所记录的模块时,则根据所述配置文件中模块的代码地址从代码库中获取所述任务包中所缺少的模块的代码;及
根据所述配置文件中模块的分支,将获取的代码更新到所述任务包中。
一个或多个存储有计算机可读指令的非易失性计算机可读指令存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
获取任务包的配置文件,所述配置文件中包括模块的代码地址以及模块的分支,所述模块的分支是通过模块名称嵌套表示的;
检测所述任务包中是否缺少所述配置文件中所记录的模块;
当所述任务包中缺少所述配置文件中所记录的模块时,则根据所述配置文件中模块的代码地址从代码库中获取所述任务包中所缺少的模块的代码;及
根据所述配置文件中模块的分支,将获取的代码更新到所述任务包中。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为根据一个或多个实施例中的代码管理方法的应用环境图。
图2为根据一个或多个实施例中的代码管理方法的流程图。
图3为图2所示实施例中的步骤S204的流程。
图4为根据一个或多个实施例中任务包的配置文件的示意图。
图5为根据一个或多个实施例中的修改配置文件步骤的时序图。
图6为根据一个或多个实施例中的代码管理装置的框图。
图7为根据一个或多个实施例中的计算机设备的框图。
具体实施方式
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用于解释本申请,并不用于限定本申请。
参阅图1,图1为一实施例中的代码管理方法的应用环境图,包括数个计算机设备以及审查端,数个计算机设备可以与审查端进行通信,研发人员可以在计算机设备上编写新的代码,并可以将编写的代码发送至审查端进行审查,只有审查通过的代码可以更新到任务包中,以便于将任务包进行存储后向用户终端下发,从而用户终端可以根据该任务包更新相应的内容,例如客户端APP等。
请参阅图2,在其中一个实施例中,提供一种代码管理方法,本实施例以该方法应用到上述图1中的计算机设备来举例说明。该计算机设备上运行有代码管理的计算机可读指令,通过该代码管理的计算机可读指令来实施代码管理方法。该方法具体包括如下步骤:
S202:获取任务包的配置文件,配置文件中包括模块的代码地址以及模块的分支,模块的分支是通过模块名称嵌套表示的。
具体地,任务包是指软件开发过程中的工程,例如一个应用程序所对应的工程即对应一个任务包,其包含该应用程序的所有的代码,且代码分模块进行存储,例如一个应用程序可以提供不同的功能,一个功能则可以为一个模块。配置文件是指该任务包的配置文件,其中存储有关于该任务包中所有模块的名称、模块的代码地址以及模块的分支。其中模块的代码地址即该模块的代码所存储的地址,模块的分支是通过模块名称嵌套表示的,例如modules模块其是处于release模块下,则其分支表示为release,release模块嵌套于abc模块下,则release模块的分支表示为abc。此外,如果modules模块其是处于release模块下,release是处于abc模块下,则modules模块的分支还可以表示为abc-release,从而表示modules模块首先嵌套于release模块下,然后release模块嵌套于abc模块。
S204:检测任务包中是否缺少配置文件中所记录的模块。
具体地,当获取到任务包的配置文件后,首先判断任务包中是否缺少配置文件中所记录的模块,如果任务包中缺少配置文件中所记录的模块,则会导致任务包未更新,从而需要根据配置文件更新任务包,以保证任务包的完整性。
S206:当任务包中缺少配置文件中所记录的模块时,则根据配置文件中模块的代码地址从代码库中获取任务包中所缺少的模块的代码。
具体地,计算机设备可以根据模块的代码地址从代码库中获取任务包中所缺少的模块的代码,代码库为存储有所有模块的代码的数据库。当任务包中缺少配置文件中所记录的模块时,则根据配置文件来更新任务包,例如上个例子中,当任务包缺少modules模块时,则根据配置文件中modules模块的代码地址,来读取modules模块的代码,从而可以将modules模块的代码更新到任务包中,从而可以保证任务包的完整性。
S208:根据配置文件中模块的分支,将获取的代码更新到任务包中。
具体地,在上述例子中,即使获取到modules模块的代码,如果只是随意将modules 模块代码保存到任务包中,则会造成任务包中存在大量的无联系的代码,从而任务包更新时,该些代码极易丢失,为了避免该种情况,计算机设备从配置文件中相应地获取到modules模块的分支,即release模块,这样可以根据该分支将代码更新到release模块,而release模块是abc模块的一个分支,从而可以根据release模块的更新再更新abc模块,直至到任务包的主模块,这样可以保证每一个增加的模块均可以与任务包中的其他模块进行关联,防止出现游离分支。
上述代码管理方法,为任务包配置了配置文件,配置文件中的模块的代码地址给出了各个模块的代码的存储地址,模块的分支通过模块名称嵌套的方式给出了各个模块所属的分支,从而各个模块可以根据模块名称来得到自己的分支,防止了任务包更新时出现游离分支的情况,且当任务包需要更新时,仅需要根据配置文件中的模块的代码地址和模块的分支对任务包进行更新即可,而不再需要人工对任务包中的模块进行添加操作,提高了任务包更新的效率。
在其中一个实施例中,参与图3,图3为图2所示实施例中的步骤S204的流程,该步骤S204,即检测任务包中是否缺少配置文件中所记录的模块的步骤可以包括:
S302:检测任务包中是否缺少名称与配置文件中所记录的模块的名称相匹配的模块。
具体地,参阅图4,图4为一实施例中任务包的配置文件的示意图,其中配置文件中包含ver字段,即配置文件的版本号,该配置文件的版本号可以对应于应用程序的版本。配置文件中还包括数个模块例如app模块、common模块、framework模块、react_native/node_modules模块、react_native模块以及react_native/packager模块等,在其他的配置文件中还可以包含其他的模块,其中各个模块以模块名称的形式存在于配置文件中。配置文件中的各个模块包括两个配置信息,一个是branch,即分支,其可以表示模块所隶属的分支,例如app模块,隶属于release-1.0.0模块,另外一个是repo,即模块的代码地址,例如app模块的代码地址为http://xxx.xxx.xxx/xxx/app.git。其中release-1.0.0模块种的1.0.0表示release模块的版本,以方便各个模块的更新,从而使得任务包即可以根据任务包的版本号进行整体的更新,还可以根据任务包中各个模块的版本号进行局部的更新,从而使得任务包更新时更加灵活。
S304:当任务包中缺少名称与配置文件中所记录的模块的名称相匹配的模块时,则任务包中缺少配置文件中所记录的模块。
具体地,在判断任务包中是否缺少配置文件中所记录的模块时,首先可以根据模块的名称来判断,即判断任务包中的模块的名称是否均在配置文件中,如果存在某一模块名称在配置文件中出现,但未存在于任务包中,则表示该任务包中缺少该模块,从而计算机设备需要根据配置文件中所记录的该模块的代码地址和模块的分支将该模块更新到任务包中。此外如果某一模块存在于任务包中,但不存在于配置文件中,即任务包中存在某一模块的模块名称与配置文件中所记录的模块名称不匹配,则计算机设备直接删除位于任务包中的该模块即可。
S306:当任务包中不缺少名称与配置文件中所记录的模块的名称相匹配的模块时,则检测任务包中的模块的版本标签与配置文件中所记录的模块的版本标签是否匹配。
具体地,如果任务包中不缺少名称与配置文件中所记录的模块的名称相匹配的模块时,即任务包中的模块与配置文件中所记录的模块的名称均相同,则可以继续监测任务包中模块的标签是否与配置文件中模块的标签一致,例如当任务包中的release模块的的标签为1.2.0,而配置文件中release模块的标签为1.3.0时,此时也会认为任务包中缺少配置文件中所记录的模块。
S308:当任务包中的模块的版本标签与配置文件中所记录的模块的版本标签不匹配时,则任务包中缺少配置文件中所记录的模块。
具体地,当任务包中的模块的版本标签与配置文件所记录的模块的版本标签不匹配时,即模块的版本不一致的,则也会认为任务包中缺少配置文件中所记录的模块,从而需要计算机设备需要根据配置文件中所记录的该模块的代码地址和模块的分支将该模块更新到任务包中。
且如图4中的“release-1.0.0”中的“1.0.0”即为版本标签,这样可以应用到代码查询、代码回滚中,例如在代码回滚时可以包括:获取存储在计算机设备中的目标版本标签;将配置文件中模块的当前版本标签替换为目标版本标签,然后继续当更新任务包时,则读取任务包的配置文件,即可以将任务包中的特定的模块更新到目标版本,而不再需要手动的更改代码等。
上述实施例中,既通过模块名称又通过模块名称中的版本标签来判断任务包中是否缺少配置文件中所记录的模块,从而可以准确地根据配置文件来更新任务包中的模块,不需要人工干预,节省了人力。
在其中一个实施例中,在获取任务包的配置文件的步骤之前还可以包括:获取输入的代码、输入的与输入的代码相对应的模块的名称以及输入的与输入的代码相对应的模块的分支;根据输入的代码的生成代码地址;根据输入的代码的代码地址、输入的模块的名称以及输入的模块的分支,对任务包的配置文件进行修改并提交修改后的配置文件。从而获取任务包的配置文件的步骤,包括:获取任务包的修改后的配置文件。
在其中一个实施例中,对任务包的配置文件进行修改并提交修改后的配置文件的步骤之后,还可以包括:获取任务包的修改后的配置文件与修改前的配置文件的差别;将任务包的修改后的配置文件与修改前的配置文件的差别发送至审查端。从而获取任务包的修改后的配置文件的步骤可以包括:当接收到审查端返回的表示审查通过的确认信息时,则获取任务包的修改后的配置文件。
具体地,参阅图5,图5为一实施例中的修改配置文件步骤的时序图,该修改配置文件的步骤可以包括:
首先获取输入的代码、输入的与输入的代码相对应的模块的名称以及输入的与输入的代码相对应的模块的分支,例如研发人员在计算机设备上开发性的代码,并将新的代码存 储在计算机设备的存储器中,然后打开配置文件,将模块的名称和分支写入配置文件中。此外计算机设备可以根据输入的代码的生成代码地址,从而计算机设备可以将该生成的模块代码地址写入配置文件中,或者研发人员也可以手动将该地址输入到配置文件中。即根据输入的代码的代码地址、输入的模块的名称以及输入的模块的分支,对任务包的配置文件进行修改并提交修改后的配置文件。例如当研发人员修改完配置文件后,需要对配置文件进行提交,以便于审核端的研发人员来审核该修改是否通过。
其次,在研发人员提交了关于配置文件的修改后,计算机设备首先获取任务包的修改后的配置文件与修改前的配置文件的差别,该差别包括配置文件中的新增加的模块名称、新增加的模块的分支以及新增加的模块的代码地址,从而审核端的研发人员可以根据该新增加的代码地址查询到相应的新的代码。该差别还可以包括配置文件中减少的模块的名称、减少的模块的分支以及减少的模块的代码地址,以便于审核端的研发人员可以根据该些信息判断该模块的删除是否正确。此外该差别还可以包括配置文件中更改版本的模块的新的版本和旧的版本,从而审核端的研发人员可以直接看到模块的新版本和旧版本之间的差别。
第三,将任务包的修改后的配置文件与修改前的配置文件的差别发送至审查端。在该实施例中,为了减少数据的传输,只发送修改后的配置文件与修改前的配置文件的差别,且由于审查端一般都会存储每一次的配置文件,因此只发送修改后的配置文件与修改前的配置文件的差别,并不会影响审查端研发人员查看到完整的配置文件,另外,只发送修改后的配置文件与修改前的配置文件的差别,审查端研发人员可以直接获取到本次修改的不同,从而可以缩短审查时间。
第四,审查端接收到修改后的配置文件与修改前的配置文件的差别后,研发人员可以对该差别进行审核,从而来确定本次修改是否可以直接应用。此外为了减少审核端研发人员的审核任务,审核端可以首先自动的检测所发送的差别是否存在语法错误等,如果存在则直接返回计算机设备,本次修改不通过,并将不通过的原因发送至计算机设备,以便于研发人员及时了解,当该差别不存在语法错误时,则可以提交审核端的研发人员进行审核,如果审核通过,则向计算机设备返回确认信息,当计算机接收到审查端返回的表示审查通过的确认信息时,则获取任务包的修改后的配置文件,从而可以进行任务包的更新。
上述实施例中,在任务包更新前,首先对任务包更新所依据的配置文件进行审核,只有审核通过后,计算机设备才会依据修改后的配置文件对任务包进行更新,从而可以保证更新到任务包中的模块的正确性,减少代码回流等情况的发生。
在其中一个实施例中,根据代码地址、模块的名称以及模块的分支,对任务包的配置文件进行修改并提交修改后的配置文件的步骤之后,还包括检测是否接收到针对提交码的修改指令;当接收到针对提交码的修改指令时,则生成关于提交码的修改指令的无效提示。
具体地,由于该代码管理的方法是基于git进行的,git中存在提交码,即commit id的修改,且该commit id修改后,会导致任务包更新时,根据该commit id进行修改,为了 避免该种情况的发生,本实施例中一直将提交码进行固定,例如监测到针对提交码的修改指令时,则提示拒绝提交码的修改,例如可以以弹出框的形式来提示研发人员,从而保证提交码不变,任务包的更新只根据配置文件,而不需要考虑提交码的更新。
上述实施例中,通过检测是否接收到针对提交码的修改指令来拒绝提交码的更新,从而可以保证任务包的更新只根据配置文件,而不需要考虑提交码的更新,保证了任务包更新的准确性。
应该理解的是,虽然图2、图3和图5的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2、图3和图5中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
参阅图6,图6为一实施例中的代码管理装置的框图,该代码管理装置包括:
配置文件获取模块100,用于获取任务包的配置文件,配置文件中包括模块的代码地址以及模块的分支,模块的分支是通过模块名称嵌套表示的。
检测模块200,用于检测任务包中是否缺少配置文件中所记录的模块。
代码获取模块300,用于当任务包中缺少配置文件中所记录的模块时,则根据配置文件中模块的代码地址从代码库中获取任务包中所缺少的模块的代码。及
更新模块400,用于根据配置文件中模块的分支,将获取的代码更新到任务包中。
在其中一个实施例中,检测模块200可以包括:
名称检测单元,用于检测任务包中是否缺少名称与配置文件中所记录的模块的名称相匹配的模块,当任务包中缺少名称与配置文件中所记录的模块的名称相匹配的模块时,则任务包中缺少配置文件中所记录的模块。及
版本标签检测单元,用于当任务包中不缺少名称与配置文件中所记录的模块的名称相匹配的模块时,则检测任务包中的模块的版本标签与配置文件中所记录的模块的版本标签是否匹配;且当任务包中的模块的版本标签与配置文件中所记录的模块的版本标签不匹配时,则任务包中缺少配置文件中所记录的模块。
在其中一个实施例中,该代码管理装置300还可以包括:
输入获取模块,用于获取输入的代码、输入的与输入的代码相对应的模块的名称以及输入的与输入的代码相对应的模块的分支。
生成模块,用于根据输入的代码的生成代码地址。及
修改模块,用于根据输入的代码的代码地址、输入的模块的名称以及输入的模块的分支,对任务包的配置文件进行修改并提交修改后的配置文件。
在其中一个实施例中,该代码管理装置还可以包括:
差别获取模块,用于获取任务包的修改后的配置文件与修改前的配置文件的差别。
发送模块,用于将任务包的修改后的配置文件与修改前的配置文件的差别发送至审查端。及
配置文件获取模块还用于当接收到审查端返回的表示审查通过的确认信息时,则获取任务包的修改后的配置文件。
在其中一个实施例中,该代码管理装置还可以包括:
检测模块,用于检测是否接收到针对提交码的修改指令;当接收到针对提交码的修改指令时,则生成关于提交码的修改指令的无效提示。
上述关于代码管理装置的限定可以参加上文中关于代码管理方法的限定,在此不再赘述。上述代码管理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图7所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种代码管理方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,该存储器存储有计算机程序,该处理器执行计算机程序时实现以下步骤:获取任务包的配置文件,配置文件中包括模块的代码地址以及模块的分支,模块的分支是通过模块名称嵌套表示的;检测任务包中是否缺少配置文件中所记录的模块;当任务包中缺少配置文件中所记录的模块时,则根据配置文件中模块的代码地址从代码库中获取任务包中所缺少的模块的代码;及根据配置文件中模块的分支,将获取的代码更新到任务包中。
在其中一个实施例中,处理器执行计算机可读指令时还可以实现以下步骤:检测任务包中是否缺少名称与配置文件中所记录的模块的名称相匹配的模块;当任务包中缺少名称与配置文件中所记录的模块的名称相匹配的模块时,则任务包中缺少配置文件中所记录的模块;当任务包中不缺少名称与配置文件中所记录的模块的名称相匹配的模块时,则检测 任务包中的模块的版本标签与配置文件中所记录的模块的版本标签是否匹配;及当任务包中的模块的版本标签与配置文件中所记录的模块的版本标签不匹配时,则任务包中缺少配置文件中所记录的模块。
在其中一个实施例中,处理器执行计算机可读指令时还可以实现以下步骤:获取输入的代码、输入的与输入的代码相对应的模块的名称以及输入的与输入的代码相对应的模块的分支;根据输入的代码的生成代码地址;及根据输入的代码的代码地址、输入的模块的名称以及输入的模块的分支,对任务包的配置文件进行修改并提交修改后的配置文件;获取任务包的配置文件的步骤,包括:获取任务包的修改后的配置文件。
在其中一个实施例中,处理器执行计算机可读指令时还可以实现以下步骤:获取任务包的修改后的配置文件与修改前的配置文件的差别;将任务包的修改后的配置文件与修改前的配置文件的差别发送至审查端;及获取任务包的修改后的配置文件的步骤,包括:当接收到审查端返回的表示审查通过的确认信息时,则获取任务包的修改后的配置文件。
在其中一个实施例中,处理器执行计算机可读指令时还可以实现以下步骤:检测是否接收到针对提交码的修改指令;及当接收到针对提交码的修改指令时,则生成关于提交码的修改指令的无效提示。
一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤::获取任务包的配置文件,配置文件中包括模块的代码地址以及模块的分支,模块的分支是通过模块名称嵌套表示的;检测任务包中是否缺少配置文件中所记录的模块;当任务包中缺少配置文件中所记录的模块时,则根据配置文件中模块的代码地址从代码库中获取任务包中所缺少的模块的代码;及根据配置文件中模块的分支,将获取的代码更新到任务包中。
在其中一个实施例中,该计算机可读指令被处理器执行时还可以实现以下步骤:检测任务包中是否缺少名称与配置文件中所记录的模块的名称相匹配的模块;当任务包中缺少名称与配置文件中所记录的模块的名称相匹配的模块时,则任务包中缺少配置文件中所记录的模块;当任务包中不缺少名称与配置文件中所记录的模块的名称相匹配的模块时,则检测任务包中的模块的版本标签与配置文件中所记录的模块的版本标签是否匹配;及当任务包中的模块的版本标签与配置文件中所记录的模块的版本标签不匹配时,则任务包中缺少配置文件中所记录的模块。
在其中一个实施例中,该计算机可读指令被处理器执行时还可以实现以下步骤:获取输入的代码、输入的与输入的代码相对应的模块的名称以及输入的与输入的代码相对应的模块的分支;根据输入的代码的生成代码地址;根据输入的代码的代码地址、输入的模块的名称以及输入的模块的分支,对任务包的配置文件进行修改并提交修改后的配置文件;及获取任务包的配置文件的步骤,包括:获取任务包的修改后的配置文件。
在其中一个实施例中,该计算机可读指令被处理器执行时还可以实现以下步骤:获取任务包的修改后的配置文件与修改前的配置文件的差别;将任务包的修改后的配置文件与 修改前的配置文件的差别发送至审查端;及获取任务包的修改后的配置文件的步骤,包括:当接收到审查端返回的表示审查通过的确认信息时,则获取任务包的修改后的配置文件。
在其中一个实施例中,该计算机可读指令被处理器执行时还可以实现以下步骤:检测是否接收到针对提交码的修改指令;及当接收到针对提交码的修改指令时,则生成关于提交码的修改指令的无效提示。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种代码管理方法,包括:
    获取任务包的配置文件,所述配置文件中包括模块的代码地址以及模块的分支,所述模块的分支是通过模块名称嵌套表示的;
    检测所述任务包中是否缺少所述配置文件中所记录的模块;
    当所述任务包中缺少所述配置文件中所记录的模块时,则根据所述配置文件中模块的代码地址从代码库中获取所述任务包中所缺少的模块的代码;及
    根据所述配置文件中模块的分支,将获取的代码更新到所述任务包中。
  2. 根据权利要求1所述的方法,其特征在于,所述检测所述任务包中是否缺少所述配置文件中所记录的模块,包括:
    检测所述任务包中是否缺少名称与所述配置文件中所记录的模块的名称相匹配的模块;
    当所述任务包中缺少名称与所述配置文件中所记录的模块的名称相匹配的模块时,则所述任务包中缺少所述配置文件中所记录的模块;
    当所述任务包中不缺少名称与所述配置文件中所记录的模块的名称相匹配的模块时,则检测所述任务包中的模块的版本标签与所述配置文件中所记录的模块的版本标签是否匹配;及
    当所述任务包中的模块的版本标签与所述配置文件中所记录的模块的版本标签不匹配时,则所述任务包中缺少所述配置文件中所记录的模块。
  3. 根据权利要求1所述的方法,其特征在于,所述获取任务包的配置文件之前,还包括:
    获取输入的代码、输入的与所述输入的代码相对应的模块的名称以及输入的与所述输入的代码相对应的模块的分支;
    根据所述输入的代码的生成代码地址;
    根据所述输入的代码的代码地址、输入的模块的名称以及输入的模块的分支,对任务包的配置文件进行修改并提交修改后的配置文件;及
    所述获取任务包的配置文件,包括:
    获取任务包的修改后的配置文件。
  4. 根据权利要求3所述的方法,其特征在于,所述对任务包的配置文件进行修改并提交修改后的配置文件之后,还包括:
    获取所述任务包的修改后的配置文件与修改前的配置文件的差别;
    将所述任务包的修改后的配置文件与修改前的配置文件的差别发送至审查端;及
    所述获取任务包的修改后的配置文件,包括:
    当接收到所述审查端返回的表示审查通过的确认信息时,则获取任务包的修改后的配置文件。
  5. 根据权利要求3所述的方法,其特征在于,所述根据所述输入的代码的代码地址、输入的模块的名称以及输入的模块的分支,对任务包的配置文件进行修改并提交修改后的配置文件之后,还包括:
    检测是否接收到针对提交码的修改指令;及
    当接收到针对提交码的修改指令时,则生成关于所述提交码的修改指令的无效提示。
  6. 一种代码管理装置,包括:
    配置文件获取模块,用于获取任务包的配置文件,所述配置文件中包括模块的代码地址以及模块的分支,所述模块的分支是通过模块名称嵌套表示的;
    检测模块,用于检测所述任务包中是否缺少所述配置文件中所记录的模块;
    代码获取模块,用于当所述任务包中缺少所述配置文件中所记录的模块时,则根据所述配置文件中模块的代码地址从代码库中获取所述任务包中所缺少的模块的代码;及
    更新模块,用于根据所述配置文件中模块的分支,将获取的代码更新到所述任务包中。
  7. 根据权利要求6所述的装置,其特征在于,所述检测模块包括:
    名称检测单元,用于检测所述任务包中是否缺少名称与所述配置文件中所记录的模块的名称相匹配的模块,当所述任务包中缺少名称与所述配置文件中所记录的模块的名称相匹配的模块时,则所述任务包中缺少所述配置文件中所记录的模块;及
    版本标签检测单元,用于当所述任务包中不缺少名称与所述配置文件中所记录的模块的名称相匹配的模块时,则检测所述任务包中的模块的版本标签与所述配置文件中所记录的模块的版本标签是否匹配;且当所述任务包中的模块的版本标签与所述配置文件中所记录的模块的版本标签不匹配时,则所述任务包中缺少所述配置文件中所记录的模块。
  8. 根据权利要求6所述的装置,其特征在于,所述装置还包括:
    输入获取模块,用于获取输入的代码、输入的与所述输入的代码相对应的模块的名称以及输入的与所述输入的代码相对应的模块的分支;
    生成模块,用于根据所述输入的代码的生成代码地址;及
    修改模块,用于根据所述输入的代码地址、输入的模块的名称以及输入的模块的分支,对任务包的配置文件进行修改并提交修改后的配置文件。
  9. 根据权利要求8所述的装置,其特征在于,所述装置还包括:
    差别获取模块,用于获取所述任务包的修改后的配置文件与修改前的配置文件的差别;
    发送模块,用于将所述任务包的修改后的配置文件与修改前的配置文件的差别发送至审查端;及
    所述配置文件获取模块还用于当接收到所述审查端返回的表示审查通过的确认信息时,则获取任务包的修改后的配置文件。
  10. 根据权利要求8所述的装置,其特征在于,所述装置还包括:
    检测模块,用于检测是否接收到针对提交码的修改指令;及当接收到针对提交码的修 改指令时,则生成关于所述提交码的修改指令的无效提示。
  11. 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    获取任务包的配置文件,所述配置文件中包括模块的代码地址以及模块的分支,所述模块的分支是通过模块名称嵌套表示的;
    检测所述任务包中是否缺少所述配置文件中所记录的模块;
    当所述任务包中缺少所述配置文件中所记录的模块时,则根据所述配置文件中模块的代码地址从代码库中获取所述任务包中所缺少的模块的代码;及
    根据所述配置文件中模块的分支,将获取的代码更新到所述任务包中。
  12. 根据权利要求11所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时所执行的所述检测所述任务包中是否缺少所述配置文件中所记录的模块,包括:
    检测所述任务包中是否缺少名称与所述配置文件中所记录的模块的名称相匹配的模块;
    当所述任务包中缺少名称与所述配置文件中所记录的模块的名称相匹配的模块时,则所述任务包中缺少所述配置文件中所记录的模块;
    当所述任务包中不缺少名称与所述配置文件中所记录的模块的名称相匹配的模块时,则检测所述任务包中的模块的版本标签与所述配置文件中所记录的模块的版本标签是否匹配;及
    当所述任务包中的模块的版本标签与所述配置文件中所记录的模块的版本标签不匹配时,则所述任务包中缺少所述配置文件中所记录的模块。
  13. 根据权利要求11所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时所执行的所述获取任务包的配置文件之前,还包括:
    获取输入的代码、输入的与所述输入的代码相对应的模块的名称以及输入的与所述输入的代码相对应的模块的分支;
    根据所述输入的代码的生成代码地址;
    根据所述输入的代码的代码地址、输入的模块的名称以及输入的模块的分支,对任务包的配置文件进行修改并提交修改后的配置文件;及
    所述处理器执行所述计算机可读指令时所执行的所述获取任务包的配置文件,包括:
    获取任务包的修改后的配置文件。
  14. 根据权利要求13所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时所执行的所述对任务包的配置文件进行修改并提交修改后的配置文件之后,还包括:
    获取所述任务包的修改后的配置文件与修改前的配置文件的差别;
    将所述任务包的修改后的配置文件与修改前的配置文件的差别发送至审查端;及
    所述处理器执行所述计算机可读指令时所执行的所述获取任务包的修改后的配置文件,包括:
    当接收到所述审查端返回的表示审查通过的确认信息时,则获取任务包的修改后的配置文件。
  15. 根据权利要求13所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时所执行的所述根据所述输入的代码的代码地址、输入的模块的名称以及输入的模块的分支,对任务包的配置文件进行修改并提交修改后的配置文件之后,还包括:
    检测是否接收到针对提交码的修改指令;及
    当接收到针对提交码的修改指令时,则生成关于所述提交码的修改指令的无效提示。
  16. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    获取任务包的配置文件,所述配置文件中包括模块的代码地址以及模块的分支,所述模块的分支是通过模块名称嵌套表示的;
    检测所述任务包中是否缺少所述配置文件中所记录的模块;
    当所述任务包中缺少所述配置文件中所记录的模块时,则根据所述配置文件中模块的代码地址从代码库中获取所述任务包中所缺少的模块的代码;及
    根据所述配置文件中模块的分支,将获取的代码更新到所述任务包中。
  17. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时所实现的所述检测所述任务包中是否缺少所述配置文件中所记录的模块,包括:
    检测所述任务包中是否缺少名称与所述配置文件中所记录的模块的名称相匹配的模块;
    当所述任务包中缺少名称与所述配置文件中所记录的模块的名称相匹配的模块时,则所述任务包中缺少所述配置文件中所记录的模块;
    当所述任务包中不缺少名称与所述配置文件中所记录的模块的名称相匹配的模块时,则检测所述任务包中的模块的版本标签与所述配置文件中所记录的模块的版本标签是否匹配;及
    当所述任务包中的模块的版本标签与所述配置文件中所记录的模块的版本标签不匹配时,则所述任务包中缺少所述配置文件中所记录的模块。
  18. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时所实现的所述获取任务包的配置文件之前,还包括:
    获取输入的代码、输入的与所述输入的代码相对应的模块的名称以及输入的与所述输入的代码相对应的模块的分支;
    根据所述输入的代码的生成代码地址;
    根据所述输入的代码的代码地址、输入的模块的名称以及输入的模块的分支,对任务包的配置文件进行修改并提交修改后的配置文件;及
    所述计算机可读指令被所述处理器执行时所实现的所述获取任务包的配置文件,包括:
    获取任务包的修改后的配置文件。
  19. 根据权利要求18所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时所实现的所述对任务包的配置文件进行修改并提交修改后的配置文件之后,还包括:
    获取所述任务包的修改后的配置文件与修改前的配置文件的差别;
    将所述任务包的修改后的配置文件与修改前的配置文件的差别发送至审查端;及
    所述计算机可读指令被所述处理器执行时所实现的所述获取任务包的修改后的配置文件,包括:
    当接收到所述审查端返回的表示审查通过的确认信息时,则获取任务包的修改后的配置文件。
  20. 根据权利要求18所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时所实现的所述根据所述输入的代码的代码地址、输入的模块的名称以及输入的模块的分支,对任务包的配置文件进行修改并提交修改后的配置文件之后,还包括:
    检测是否接收到针对提交码的修改指令;及
    当接收到针对提交码的修改指令时,则生成关于所述提交码的修改指令的无效提示。
PCT/CN2018/079963 2017-08-25 2018-03-22 代码管理方法、装置、计算机设备和计算机可读存储介质 WO2019037418A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710744853.X 2017-08-25
CN201710744853.XA CN107729031B (zh) 2017-08-25 2017-08-25 代码管理方法、装置、计算机设备和计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2019037418A1 true WO2019037418A1 (zh) 2019-02-28

Family

ID=61205309

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/079963 WO2019037418A1 (zh) 2017-08-25 2018-03-22 代码管理方法、装置、计算机设备和计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN107729031B (zh)
WO (1) WO2019037418A1 (zh)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729031B (zh) * 2017-08-25 2019-08-20 深圳壹账通智能科技有限公司 代码管理方法、装置、计算机设备和计算机可读存储介质
CN109086362A (zh) * 2018-07-19 2018-12-25 北京首汽智行科技有限公司 多模块项目的管理方法
CN111309369B (zh) * 2018-12-12 2024-03-29 北京奇虎科技有限公司 基于Git代码仓库的代码管理方法及装置
CN111324373B (zh) * 2018-12-13 2023-12-05 北京奇虎科技有限公司 多个工程文件上传代码仓库的方法及装置、计算设备
CN111352649B (zh) * 2018-12-24 2023-09-22 北京嘀嘀无限科技发展有限公司 代码处理方法、装置、服务器及可读存储介质
CN109871229A (zh) * 2019-01-16 2019-06-11 平安普惠企业管理有限公司 代码文本的管理方法、装置、存储介质及终端设备
CN110597780A (zh) * 2019-08-09 2019-12-20 甘肃万华金慧科技股份有限公司 基础设置管理系统
CN115543394A (zh) * 2022-12-01 2022-12-30 云账户技术(天津)有限公司 App动态更新管理方法、系统、电子设备和可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929600A (zh) * 2012-06-13 2013-02-13 许继集团有限公司 基于elf的监控系统版本识别方法
US20130326478A1 (en) * 2012-05-31 2013-12-05 International Business Machines Corporation Version labeling in a version control system
CN103677831A (zh) * 2013-12-12 2014-03-26 迈普通信技术股份有限公司 在线代码审查系统及方法
CN106886445A (zh) * 2016-06-23 2017-06-23 阿里巴巴集团控股有限公司 Java数据包生成方法及设备和信息提取方法及设备
CN107729031A (zh) * 2017-08-25 2018-02-23 上海壹账通金融科技有限公司 代码管理方法、装置、计算机设备和计算机可读存储介质

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886420B (zh) * 2017-03-30 2020-10-09 广州柔视智能科技有限公司 一种程序代码管理装置、方法及程序代码管理器

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130326478A1 (en) * 2012-05-31 2013-12-05 International Business Machines Corporation Version labeling in a version control system
CN102929600A (zh) * 2012-06-13 2013-02-13 许继集团有限公司 基于elf的监控系统版本识别方法
CN103677831A (zh) * 2013-12-12 2014-03-26 迈普通信技术股份有限公司 在线代码审查系统及方法
CN106886445A (zh) * 2016-06-23 2017-06-23 阿里巴巴集团控股有限公司 Java数据包生成方法及设备和信息提取方法及设备
CN107729031A (zh) * 2017-08-25 2018-02-23 上海壹账通金融科技有限公司 代码管理方法、装置、计算机设备和计算机可读存储介质

Also Published As

Publication number Publication date
CN107729031A (zh) 2018-02-23
CN107729031B (zh) 2019-08-20

Similar Documents

Publication Publication Date Title
WO2019037418A1 (zh) 代码管理方法、装置、计算机设备和计算机可读存储介质
CN110297813B (zh) 数据迁移方法、装置、计算机设备及存储介质
US10318412B1 (en) Systems, methods, and apparatus for dynamic software generation and testing
US9910941B2 (en) Test case generation
US9430359B1 (en) Identifying and resolving software issues
US9105001B2 (en) Analytic solution integration
US9135146B1 (en) Identifying and resolving software issues
CN111831325B (zh) 应用中配置文件的更新方法、装置、系统和介质
WO2020192141A1 (zh) 接口模拟方法、装置、计算机设备和存储介质
WO2018176812A1 (zh) 静态资源发布方法及装置
US20180267781A1 (en) Code generation for isomorphic data fetching
US11099837B2 (en) Providing build avoidance without requiring local source code
US9378115B2 (en) Base line for code analysis
US8510714B2 (en) Implementing integrated documentation and application testing
US20120054560A1 (en) Verifying correctness of processor transactions
US9009666B1 (en) Systems and methods for testing software and for storing and tracking test assets with the software
US20120221967A1 (en) Dashboard object validation
CN104166541A (zh) 用于更新被测控件库的方法和装置
CN107092671B (zh) 一种元信息管理的方法及设备
US10089213B1 (en) Identifying and resolving software issues
US11301246B2 (en) Automatically generating continuous integration pipelines
US11392371B2 (en) Identification of a partial code to be refactored within a source code
CN114115982A (zh) 代码发布方法、装置、设备及存储介质
US11100131B2 (en) Simulation of a synchronization of records
JP2023000907A (ja) ソースコード修正支援装置及びソースコード修正支援方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18847699

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 08.09.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18847699

Country of ref document: EP

Kind code of ref document: A1