Code repository reference management method, server and storage medium
By reviewing the operation instructions of the code repository and creating review tasks based on user permissions and operation types, the problem of confusing reference management in the code repository is solved, and effective control of all references is achieved and management processes are simplified.
Patent Information
- Application Number
- CN202310792343.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2025-01-07
AI Technical Summary
The existing technology has confusion in reference management in code repository, making it difficult to effectively control reference updates, forced updates, creation and deletion operations. It requires pre-configuration of complex rules and frequent maintenance, which makes it difficult to control coverage and accuracy, which can easily lead to Misoperation and reference confusion.
By reviewing the operation instructions of the code repository, creating review tasks based on user permissions and operation types, the review results determine whether to allow operations to be executed, thereby enabling control of references and avoiding the need to pre-configure rules.
It realizes effective control of all references in the code repository, avoids misoperation and reference confusion, simplifies the management process, and does not require pre-configuration of complex rules.
Smart Images

Figure CN119271226A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of code management, and more specifically, to a method, server and storage medium for managing references of a code repository. Background Art
[0002] A difficult problem that plagues the field of version control is the control of references in code repositories, that is, how to better manage the update, forced update, creation, and deletion of references in code repositories. In practice, pre-configured rules are usually used to control references in code repositories. For example, rules are configured to prohibit users from performing specific operations on specific references. If prohibited operations really need to be performed in special scenarios, the administrator needs to manually disable the corresponding rules, or the operation can only be performed by the administrator.
[0003] However, the above solution requires pre-configuration of complex rules and regular maintenance of the rules. The coverage and accuracy of the rules are difficult to control, which can easily lead to confusion in the reference of the code repository. Summary of the invention
[0004] The present application provides a method, server, and storage medium for managing references of a code repository to avoid confusion in references of a code repository.
[0005] In a first aspect, the present application provides a method for managing references of a code repository, including:
[0006] In response to an operation instruction referenced to a code repository, determining whether to review an operation corresponding to the operation instruction;
[0007] If it is determined to review the operation corresponding to the operation instruction, then creating a review task corresponding to the operation instruction according to the type of the operation instruction, and the review result of the review task is used to indicate whether the operation corresponding to the operation instruction is allowed to be executed;
[0008] When the review task is completed and the review result indicates that execution is allowed, the operation corresponding to the operation instruction is executed.
[0009] In a feasible implementation, the determining whether to review the operation corresponding to the operation instruction includes:
[0010] Whether to review the operation corresponding to the operation instruction is determined according to an option for indicating whether to review carried in the operation instruction and / or configuration information of a user who triggers the operation instruction.
[0011] In a feasible implementation, the creating a review task corresponding to the operation instruction according to the type of the operation instruction includes:
[0012] Authenticating the user who triggered the operation instruction;
[0013] If the user has at least browser authority, a review task corresponding to the operation instruction is created according to the type of the operation instruction.
[0014] In a feasible implementation, if the operation instruction is a command line pushed by a client, before creating a review task corresponding to the operation instruction according to the type of the operation instruction, the method further includes:
[0015] Parsing the command line to determine the type of the operation instruction, where the type of the operation instruction includes one or more of the following: reference update, reference forced update, reference creation, and reference deletion;
[0016] If the operation instruction is triggered through a client web page, the type of the operation instruction includes reference creation and / or reference deletion.
[0017] In a feasible implementation, the type of the operation instruction includes reference update, and the review task corresponding to the operation instruction includes a code review task, and the code review task is used to review the code update corresponding to the reference update.
[0018] In a feasible implementation, the type of the operation instruction includes one or more of forced reference update, reference creation, and reference deletion, and the review task corresponding to the operation instruction includes a reference review task.
[0019] In a feasible implementation, when the review task is completed and the review result indicates that the execution is allowed, executing the operation corresponding to the operation instruction includes:
[0020] When the review task is completed and the review result indicates that execution is allowed, in response to an instruction to determine the execution of the operation, the operation corresponding to the operation instruction is executed.
[0021] In a feasible implementation, the present invention further includes:
[0022] If it is determined that the operation corresponding to the operation instruction is not to be reviewed, the operation corresponding to the operation instruction is executed.
[0023] In a feasible implementation manner, the executing the operation corresponding to the operation instruction includes:
[0024] Authenticating the user who triggered the operation instruction;
[0025] If the user has at least developer authority, the operation corresponding to the operation instruction is performed.
[0026] In a second aspect, the present application provides a server, including: a memory and a processor;
[0027] The memory is used to store computer programs;
[0028] The processor is used to execute a computer program stored in the memory, and when the computer program is run, the processor is caused to execute the method according to the first aspect.
[0029] In a third aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the method described in the first aspect.
[0030] In the code repository reference management method, server, and storage medium provided in the present application, by introducing a review of operations corresponding to operation instructions for references, and using the review results to indicate whether corresponding operations on references are allowed, all references in the code repository are managed and controlled. This does not require pre-configured rules, and can effectively avoid misoperations and avoid confusion in code repository references. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0032] Figure 1 This is a flow diagram of a method for managing references to a code repository provided in an embodiment of the present application. Figure 1 ;
[0033] Figure 2 This is a flow diagram of a method for managing references to a code repository provided in an embodiment of the present application. Figure 2 ;
[0034] Figure 3 It is a structural diagram of a code repository reference management device provided in an embodiment of the present application;
[0035] Figure 4 It is a schematic block diagram of the server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0037] First, the terms involved in the embodiments of the present application are introduced.
[0038] Git: An open source version management tool. Currently, most code platforms are implemented based on Git technology.
[0039] Code repository: The entity where Git stores project data, which includes metadata of project data such as source code and documents and all their change history, as well as management metadata such as branches and tags.
[0040] Reference: A data structure in the Git code repository, named with a path beginning with "refs / ", pointing to a commit or tag object in the repository. Different types of references have different prefixes, branches are prefixed with "refs / heads / ", and tags are prefixed with "refs / tags / ".
[0041] Branch: A pointer to a specific commit. A branch represents an independent line of development.
[0042] Tags: Equivalent to snapshots created for specific commits, mnemonics, often used to mark code snapshots that match project milestones.
[0043] Life cycle of a reference: The creation, update, and deletion of a reference is called the life cycle of a reference.
[0044] Fast-forward push: Pushing new commits to an existing branch in the code repository will update the pointer to the corresponding branch in the repository. If the original commits of the pushed branch are included in the history of the new commits, this push behavior will not cause the loss of the original commits of the corresponding branch. This is called fast-forward push.
[0045] Forced push: In contrast to fast-forward push, if the pushed commit history does not contain the original commit pointed to by the repository branch, the push operation will cause the loss of the original commit in the repository. Therefore, non-fast-forward push is a dangerous operation and is prohibited by default. If the client adds the --force parameter when pushing, non-fast-forward push is allowed by default. This push behavior with the "--force" parameter added is called forced push.
[0046] Reference review: Review the forced push, creation, and deletion of references. The difference from code review is that code review is for the review of new submissions to a branch, while reference review is for the forced push, creation, and deletion of one or more references (including branches and tags).
[0047] The control of references to the code repository, that is, the lifecycle management of references, is currently commonly used to control references through setting management, for example:
[0048] Set authorization rules, set different user permissions for different references, and restrict users from creating, forcing, and deleting specific references.
[0049] Set push rules and use corresponding switches to limit users' forced push behavior on references. If special scenarios require forced push of code repositories, administrators need to manually turn off push rules.
[0050] Set branch protection rules to protect branches that match the rules, prohibit creating branches, prohibit force pushing, and prohibit deleting branches. If special scenarios require force pushing or deletion, the administrator needs to manually turn off the branch protection rules before implementation, or only allow administrators to perform corresponding operations.
[0051] The disadvantages of the above method are that it requires administrators to pre-configure complex rules and maintain the rules regularly. The coverage and accuracy of the rules are difficult to control. In addition, this rule-based solution can only protect important references covered by the rules. There is no control over references that are not within the scope of the rules. Developers with write permissions can create references, delete references, and force push overwrite references in the code repository. In addition, the above method cannot prevent administrators or high-privilege users from misoperating. Therefore, it is easy to cause unexpected reference creation, deletion, and overwriting, resulting in reference confusion in the code repository.
[0052] In view of this, a method for managing references to a code repository is proposed in an embodiment of the present application. A review task is created for an operation on a reference in a code repository. The review task is used to review whether the operation is allowed to be performed. Only when the review is passed does the code platform perform the corresponding operation on the reference. The collaborative management of the code repository is achieved through the review task as a medium. There is no need to set complex rules, and all references in the code repository can be protected, thereby avoiding misoperation and reference confusion in the code repository.
[0053] Figure 1 This is a flow diagram of a method for managing references to a code repository provided in an embodiment of the present application. Figure 1 This method is applied to the code platform, which can also be called the server. Figure 1 As shown, the method includes:
[0054] S101. In response to an operation instruction for a reference to a code repository, determine whether to review an operation corresponding to the operation instruction.
[0055] The operation instruction in the embodiment of the present application can be a command line pushed by the user through the client, for example, the user inputs the "git push" instruction through the client, or the operation instruction can be an operation request triggered by the user through the client web page, for example, the user creates a reference on the web page. In response to the operation instruction for the reference, the code platform first determines whether to review the operation corresponding to the operation instruction. For the operation determined to be reviewed, the code platform will not directly execute the operation, but needs to determine whether to allow the operation to be executed based on the review result.
[0056] Optionally, the code platform determines whether to review the operation corresponding to the operation instruction according to the option for indicating whether to review carried in the operation instruction and / or the configuration information of the user who triggered the operation instruction. For example, in the case where the operation instruction is a command line, the command line may carry a command parameter for whether to review, that is, an option for whether to review. For example, in the command line "git push-o review=new", the push option of review=new indicates to review. For another example, in the case where the operation instruction is an operation request triggered by a client web page, when the user creates a reference on the web page, the option of whether to review can be selected. For example, when creating a reference on the web page, review and no review correspond to different operation buttons, respectively, so that the operation request triggered by the web page carries an identification of whether to review. For another example, the user's configuration information can be pre-configured in the code platform. The configuration information can be an environment variable or a Git configuration variable, etc. The configuration information can indicate whether to review the operation corresponding to the user's operation instruction.
[0057] Optionally, the code platform may first judge the option carried in the operation instruction for indicating whether to conduct a review. If the option does not indicate a review, the code platform further judges the configuration information of the user who triggers the operation instruction. If the configuration information indicates a review, it is determined that the operation corresponding to the operation instruction is to be reviewed. If the configuration information also does not indicate a review, it is determined that the operation corresponding to the operation instruction is not to be reviewed.
[0058] S102: If it is determined to review the operation corresponding to the operation instruction, a review task corresponding to the operation instruction is created according to the type of the operation instruction, and the review result of the review task is used to indicate whether the operation corresponding to the operation instruction is allowed to be executed.
[0059] The types of operation instructions may include one or more of the following: reference update, reference forced update, reference creation, and reference deletion. Among them, reference update refers to the fast-forward push of references, and reference forced update refers to the forced push of references. For example, if the operation instruction is a command line pushed by the client, the code platform parses the command line to determine the type of operation instruction, and the type of operation instruction may include one or more of the following: reference update, reference forced update, reference creation, and reference deletion. If the operation instruction is triggered by a client web page, the type of operation instruction may include reference creation and / or reference deletion.
[0060] Based on the type of operation instruction, a corresponding review task is created to review the operation corresponding to the operation instruction, and determine whether the operation corresponding to the operation instruction is allowed to be executed. In the case where the type of operation instruction is reference update, the review task corresponding to the operation instruction includes a code review task, and the code review task is used to review the code update corresponding to the reference update. In the case where the type of operation instruction includes one or more of forced reference update, reference creation, and reference deletion, the review task corresponding to the operation instruction includes a reference review task. Compared with the code review task which focuses on the review of the code, the reference review task focuses more on the review of the operation on the reference.
[0061] Optionally, in an embodiment of the present application, in response to an operation instruction, the code platform determines whether to review the operation corresponding to the operation instruction, and further authenticates the user who triggers the operation instruction to ensure that whether or not to review, the code platform performs subsequent processing after determining that the user has the corresponding authority. Optionally, in the case of determining to review the operation corresponding to the operation instruction, the code platform authenticates the user who triggers the operation instruction; if the user has at least browser authority, a review task corresponding to the operation instruction is created according to the type of the operation instruction, wherein the user has at least browser authority means that the user has browser authority, or the user has authority higher than the browser authority, such as the user has developer authority, administrator authority, etc. Optionally, in the case of determining not to review the operation corresponding to the operation instruction, the code platform authenticates the user who triggers the operation instruction, and if the user has at least developer authority, the operation corresponding to the operation instruction is executed, wherein the user has at least browser authority means that the user has developer authority, or the user has authority higher than the developer authority, such as the user has administrator authority, etc.
[0062] S103. When the review task is completed and the review result indicates that execution is allowed, execute the operation corresponding to the operation instruction.
[0063] When the review task is completed and the review result indicates that execution is allowed, the code platform can execute the operation corresponding to the operation instruction. In an optional implementation, when the review task is completed and the review result indicates that execution is allowed, the user can determine again whether to execute the operation, for example, by prompting the user with the review result through the client, and displaying an operation button / operation option for determining the execution of the operation through the client, etc. The user can determine the execution of the operation through the operation button / operation option, and the code platform responds to the instruction to determine the execution of the operation and executes the operation corresponding to the operation instruction.
[0064] The method for managing references of a code repository provided in an embodiment of the present application introduces a review of operations corresponding to operation instructions for references, and uses the review results to indicate whether corresponding operations on references are allowed, thereby achieving management and control of all references in the code repository without the need for pre-configuration of rules, effectively avoiding misoperations, and avoiding reference confusion in the code repository.
[0065] Each step in the code repository reference management method provided in the embodiment of the present application can be implemented using corresponding functional modules. Figure 2 Provide explanation.
[0066] like Figure 2 As shown, the code platform may include the following modules: command filter module, authorization check module, command parser module, code review module, reference review module and report module. When a user executes a command line to push a command to the code platform, the push command (including reference update, reference forced update, reference creation, reference deletion, etc.) passes through the modules illustrated in the figure in turn, and finally or directly executes the operation on the code platform to complete the reference update, reference forced update, reference creation, reference deletion and other operations; or creates a code review on the code platform to review the reference update operation; or creates a reference review on the code platform to review the forced update, reference creation, reference deletion and other operations. When a user performs operations such as branch creation, branch deletion, tag creation, and tag deletion in the Web interface, a reference review can also be created on the code platform through the authorization check module and the reference review module to review the corresponding operations. The following is a description of each module.
[0067] 1. Command filter module: By checking command line parameters, environment variables, Git configuration variables, etc., it determines whether the operation corresponding to the command line needs to be reviewed. For operations that do not need to be reviewed, the Git default process will execute the operation. For operations that need to be reviewed, the command parser module will continue to process to create a review task.
[0068] For example, the user uses the Git client command "git push-o review=no" to pass the push options code of "review=no" to the server. When the command filter module matches the push options, the Git default process is executed, that is, an authorization check is performed, and the command is executed after the check passes, and the corresponding reference update, forced update, reference creation or reference deletion operations are completed on the code platform. When no relevant push options or other settings are detected, the Git client push command is handed over to the command parser module for subsequent processing.
[0069] 2. Command parser module: parses Git client push commands and classifies them according to reference update, reference forced update, reference creation, reference deletion, etc., and then passes them to subsequent modules for processing.
[0070] For reference update operations, call the code review module to complete the creation of the code review task, or update the existing code review task.
[0071] For mandatory citation update, citation creation, or citation deletion operations, the citation review module is called to complete the creation of the citation review task.
[0072] In actual applications, the creation of a code review task or a reference review task may include generating a corresponding review link, and the reviewer may view the review task through the review link and perform corresponding review processing.
[0073] 3. Citation Review Module: Create a review task record for one or more operations (forced citation update, citation creation, citation deletion, etc.).
[0074] The difference between reference review and code review is that code review is a review of new submissions to a branch, while reference review is a review of force push, creation, and deletion operations on one or more references (including branches and tags).
[0075] When a citation review task is created, it enters the review state; when a citation review task completes the review, it enters the executable state, and a corresponding operation button can be generated in the review link. The user can click the corresponding operation button to confirm the execution of the operation associated with the citation review, that is, complete the corresponding forced citation update, citation creation or citation deletion operations.
[0076] 4. Report module: The code platform needs to report the execution status of each operation instruction to the client one by one. For example, the code platform can use the report-status-v2 format for reporting.
[0077] Introducing the reference review process in the code platform to control dangerous operations such as reference creation, reference deletion, and forced push can achieve collaborative management between code repository developers without administrators. The collaborative management process is similar to code review, and semi-automatic or fully automated review can be achieved through the number of reviewers, reviewer whitelist, or webhook connection. Through reference review, on the one hand, the management cost of the project is greatly reduced, and operations that could only be completed by a few people before can be completed through team collaboration. On the other hand, it effectively realizes the control of warehouse branches and tags, avoiding the proliferation of references in the warehouse and the degradation of performance when accessing the warehouse.
[0078] Figure 3 Schematic diagram of a code repository reference management device provided in an embodiment of the present application. Figure 3 As shown, the reference management device of the code repository includes:
[0079] A judgment module 301 is used to judge whether to review the operation corresponding to the operation instruction in response to the operation instruction referenced by the code repository;
[0080] The review module 302 is used to create a review task corresponding to the operation instruction according to the type of the operation instruction if it is determined to review the operation corresponding to the operation instruction, and the review result of the review task is used to indicate whether the operation corresponding to the operation instruction is allowed to be executed;
[0081] The execution module 303 is used to execute the operation corresponding to the operation instruction when the review task is completed and the review result indicates that the execution is allowed.
[0082] In a feasible implementation, the determination module 301 is used to:
[0083] Whether to review the operation corresponding to the operation instruction is determined according to the option for indicating whether to review carried in the operation instruction and / or the configuration information of the user who triggers the operation instruction.
[0084] In a feasible implementation, the review module 302 is used to:
[0085] Authenticate the user who triggered the operation instruction;
[0086] If the user has at least viewer authority, a review task corresponding to the operation instruction is created according to the type of the operation instruction.
[0087] In a feasible implementation, the method further includes: a parsing module, which is used to:
[0088] Parse the command line to determine the type of the operation instruction, where the type of the operation instruction includes one or more of the following: reference update, reference forced update, reference creation, and reference deletion;
[0089] If the operation instruction is triggered through a client web page, the type of the operation instruction includes reference creation and / or reference deletion.
[0090] In a feasible implementation, the type of the operation instruction includes reference update, and the review task corresponding to the operation instruction includes a code review task, and the code review task is used to review the code update corresponding to the reference update.
[0091] In a feasible implementation, the type of the operation instruction includes one or more of forced reference update, reference creation, and reference deletion, and the review task corresponding to the operation instruction includes a reference review task.
[0092] In a feasible implementation, the execution module 303 is used to:
[0093] When the review task is completed and the review result indicates that execution is allowed, in response to an instruction to determine the execution of the operation, the operation corresponding to the operation instruction is executed.
[0094] In a feasible implementation, the execution module 303 is used to:
[0095] If it is determined that the operation corresponding to the operation instruction is not to be reviewed, the operation corresponding to the operation instruction is executed.
[0096] In a feasible implementation, the execution module 303 is used to:
[0097] Authenticate the user who triggered the operation instruction;
[0098] If the user has at least developer permissions, the operation corresponding to the operation instruction is performed.
[0099] The device of the embodiment of the present application is used to implement the method in the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0100] Figure 4 is a schematic block diagram of a server provided in an embodiment of the present application. Figure 4 As shown, the server 400 may include at least one processor 401 for implementing the method provided in the embodiment of the present application. The server 400 may be the code platform in the aforementioned embodiment.
[0101] Optionally, the server 400 also includes at least one memory 402 for storing program instructions and / or data. The memory 402 is coupled to the processor 401. The coupling in the embodiment of the present application is an indirect coupling or communication connection between devices, units or modules, which can be electrical, mechanical or other forms, and is used for information exchange between devices, units or modules. The processor 401 may operate in conjunction with the memory 402. The processor 401 may execute program instructions stored in the memory 402. At least one of the at least one memory may be included in the processor.
[0102] Optionally, the server 400 further includes a communication interface 403 for communicating with other devices via a transmission medium, so that the server 400 can communicate with other devices. The communication interface 403 can be, for example, a transceiver, an interface, a bus, a circuit, or a device capable of implementing a transceiver function. The processor 401 can use the communication interface 403 to send and receive data and / or information, and is used to implement the method provided in the embodiment of the present application. Please refer to the detailed description in the above embodiment for details, which will not be repeated here.
[0103] The specific connection medium between the processor 401, the memory 402 and the communication interface 403 is not limited in the embodiment of the present application. Figure 4 In the embodiment, the processor 401, the memory 402 and the communication interface 403 are connected via a bus 404. The bus 404 is Figure 4 The connection between other components is only for illustration and is not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0104] It should be understood that the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor can be combined to perform. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0105] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0106] The present application also provides a computer-readable storage medium, which stores a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method in any of the above embodiments.
[0107] The terms "unit", "module" and the like used in this specification may be used to represent a computer-related entity, hardware, firmware, a combination of hardware and software, software, or software in execution.
[0108] It will be appreciated by those skilled in the art that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in combination with computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. In the several embodiments provided in this application, it should be understood that the disclosed devices, equipment and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the unit is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0109] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0110] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0111] In the above-described embodiments, the functions of each functional unit can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions (programs). When the computer program instructions (programs) are loaded and executed on a computer, the flow or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0112] If this function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0113] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0114] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for managing references of a code repository, characterized in that: include: In response to an operation instruction referenced to a code repository, determining whether to review an operation corresponding to the operation instruction; If it is determined to review the operation corresponding to the operation instruction, then creating a review task corresponding to the operation instruction according to the type of the operation instruction, and the review result of the review task is used to indicate whether the operation corresponding to the operation instruction is allowed to be executed; When the review task is completed and the review result indicates that execution is allowed, the operation corresponding to the operation instruction is executed.
2. The method according to claim 1, characterized in that The determining whether to review the operation corresponding to the operation instruction includes: Whether to review the operation corresponding to the operation instruction is determined according to an option for indicating whether to review carried in the operation instruction and / or configuration information of a user who triggers the operation instruction.
3. The method according to claim 1, characterized in that The step of creating a review task corresponding to the operation instruction according to the type of the operation instruction includes: Authenticating the user who triggered the operation instruction; If the user has at least browser authority, a review task corresponding to the operation instruction is created according to the type of the operation instruction.
4. The method according to any one of claims 1 to 3, characterized in that: If the operation instruction is a command line pushed by a client, before creating a review task corresponding to the operation instruction according to the type of the operation instruction, the method further includes: Parsing the command line to determine the type of the operation instruction, where the type of the operation instruction includes one or more of the following: reference update, reference forced update, reference creation, and reference deletion; If the operation instruction is triggered through a client web page, the type of the operation instruction includes reference creation and / or reference deletion.
5. The method according to claim 4, characterized in that If the type of the operation instruction includes reference update, the review task corresponding to the operation instruction includes a code review task, and the code review task is used to review the code update corresponding to the reference update.
6. The method according to claim 4, characterized in that The type of the operation instruction includes one or more of forced reference update, reference creation and reference deletion, and the review task corresponding to the operation instruction includes a reference review task.
7. The method according to claim 1, characterized in that When the review task is completed and the review result indicates that the execution is allowed, executing the operation corresponding to the operation instruction includes: When the review task is completed and the review result indicates that execution is allowed, in response to an instruction to determine the execution of the operation, the operation corresponding to the operation instruction is executed.
8. The method according to claim 1, characterized in that Also includes: If it is determined that the operation corresponding to the operation instruction is not to be reviewed, the operation corresponding to the operation instruction is executed.
9. The method according to claim 8, characterized in that The operation corresponding to the execution of the operation instruction includes: Authenticating the user who triggered the operation instruction; If the user has at least developer authority, the operation corresponding to the operation instruction is performed.
10. A server, characterized in that: include: Memory and processor; The memory is used to store computer programs; The processor is configured to execute a computer program stored in the memory, and when the computer program is executed, the processor is enabled to execute the method according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the method according to any one of claims 1 to 9.