Code submission description processing method and device and electronic equipment
By deploying the format verification script on the server side, the problem of inconsistent format verification on the client side is solved, ensuring that the code submission instructions comply with the standard format before entering the code repository, and improving the standardization and portability of the code repository.
Patent Information
- Application Number
- CN202310728263.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-19
- Publication Date
- 2024-12-20
AI Technical Summary
In the prior art, since the format verification on the client side is chosen by the user independently, it is impossible to ensure that each user will perform format verification on the code submission description, which causes the code submission description combined into the code warehouse to be unable to ensure that it meets the standard format.
Deploy the format verification script on the server side, receive the code submission instructions sent by the client, and perform the format specification verification by executing the format verification script to ensure that the code submission instructions meet the standard format before they are merged into the code repository.
Regardless of whether the user performs format verification on the client or not, the server will perform format verification on the code submission instructions to ensure that the code submission instructions incorporated into the code repository comply with the standard format, which improves the standardization and portability of the code repository.
Smart Images

Figure CN119166195A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to a method, device and electronic device for processing code submission instructions. Background Art
[0002] A well-formatted code submission message can help developers improve the efficiency of code maintenance and upgrades, facilitate quick information search, and generate change logs directly from submissions.
[0003] Currently, before submitting code information and corresponding code submission instructions to the code repository, users can perform format verification on the client side. However, since the format verification on the client side is optional, it is not possible to guarantee that every user will perform format verification on the code submission instructions before submitting them, which will result in the inability to ensure that the code submission instructions merged into the code repository conform to the standard format. Summary of the invention
[0004] In view of this, the present application provides a method, device and electronic device for processing code submission instructions. The main purpose is to improve the current existing technology. Since the format verification on the client side is optional for the user, it is actually impossible to guarantee that every user will perform format verification on the code submission instructions before submitting them, which will lead to the technical problem of being unable to ensure that the code submission instructions merged into the code repository conform to the standard format.
[0005] In a first aspect, the present application provides a method for processing code submission instructions, which can be applied to server-side execution, including:
[0006] Receive code submission instructions sent by the client;
[0007] Sending a request for obtaining a format verification script to the client, so as to receive a format verification script corresponding to the code submission instructions and sent by the client in response to the request;
[0008] By executing the format verification script, the code submission instructions are verified for format compliance;
[0009] If the code submission description complies with the standard format specification, the code submission description and the code information corresponding to the code submission description will be merged into the code repository.
[0010] Optionally, before executing the format verification script to verify the format of the code submission description, the method further includes:
[0011] Deploy the format verification script in the CI / CD pipeline;
[0012] By executing the format verification script, the code submission instructions are formatted and verified, including:
[0013] Execute the format verification script in the CI / CD pipeline to verify the format of the code submission instructions.
[0014] Optionally, the code submission description is sent by the client after the client determines that the code submission description complies with the standard format specification by executing a format verification script.
[0015] In a second aspect, the present application provides a method for processing code submission instructions, which can be applied to client execution, including:
[0016] Send the code submission instructions edited for the code information to the server;
[0017] Receive the request for obtaining the format verification script sent by the server;
[0018] In response to the request, a format verification script corresponding to the code submission instructions is sent to the server, so that the server verifies the format of the code submission instructions by executing the format verification script, and if the code submission instructions comply with the standard format specifications, the code submission instructions and code information are merged into the code repository.
[0019] Optionally, before sending the code submission instructions edited for the code information to the server, the method further includes:
[0020] Call the format verification script to perform format verification on the code submission instructions;
[0021] If the code submission description complies with the standard format specification, the code submission description is sent to the server.
[0022] Optionally, before sending the code submission instructions edited by the user for the code information to the server, the method further includes:
[0023] Get the configuration template script;
[0024] By executing the configuration template script, a submission template with filling prompt information is output. The submission template is the template corresponding to the format verification script;
[0025] Send the code submission instructions edited for the code information to the server, including:
[0026] Send the code submission instructions edited in the submission template to the server.
[0027] Optionally, the format verification script is saved in a preset directory;
[0028] The sending of the format verification script corresponding to the code submission instructions to the server includes:
[0029] The format verification script is obtained from the preset directory and sent to the server.
[0030] In a third aspect, the present application provides a device for processing code submission instructions, which can be applied to a server, including:
[0031] A receiving module, configured to receive a code submission instruction sent by a client;
[0032] An acquisition module is configured to send a request for acquiring a format verification script to a client, so as to receive a format verification script corresponding to the code submission instructions and sent by the client in response to the request;
[0033] A verification module is configured to verify the format of the code submission instructions by executing a format verification script;
[0034] The merging module is configured to merge the code submission description and the code information corresponding to the code submission description into the code repository if the code submission description complies with the standard format specification.
[0035] In a fourth aspect, the present application provides a device for processing code submission instructions, which can be applied to a client, including:
[0036] A sending module, configured to send the code submission instructions edited by the user for the code information to the server;
[0037] A receiving module, configured to receive a request for obtaining a format verification script sent by a server;
[0038] The sending module is also configured to send a format verification script corresponding to the code submission instructions to the server in response to the request, so that the server verifies the format of the code submission instructions by executing the format verification script, and merges the code submission instructions and code information into the code repository if the code submission instructions comply with the standard format specifications.
[0039] In a fifth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method described in the first aspect or the method described in the second aspect is implemented.
[0040] In a sixth aspect, the present application provides an electronic device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the method of the first aspect or the method of the second aspect when executing the computer program.
[0041] In a seventh aspect, the present application provides a system for processing code submission instructions, comprising: a server and a client; wherein the server executes the method of the first aspect described above; and the client executes the method of the second aspect described above.
[0042] By means of the above technical scheme, the present application provides a method, device and electronic device for processing code submission instructions. Compared with the existing processing method of code submission instructions, the present application deploys verification of code submission instructions on the server side to ensure that the code submission instructions merged into the code warehouse conform to the standard format. Specifically, the server side receives the code submission instructions sent by the client; sends a request for obtaining a format verification script to the client to receive the format verification script corresponding to the code submission instructions sent by the client in response to the request; then, by executing the format verification script, the code submission instructions are format-verified; if the code submission instructions conform to the standard format specifications, the code submission instructions and the code information corresponding to the code submission instructions are merged into the code warehouse. The present application deploys the process of format specification verification of the code submission instructions on the server side. In this case, when the server side receives the code submission instructions sent by the client, before merging the code information and the corresponding code submission instructions into the code warehouse, the format verification script obtained from the client side is used to verify the format specifications of the code submission instructions. If it conforms to the standard format specifications, the code information and the corresponding code submission instructions are merged into the code warehouse. By applying the technical solution of the present application, regardless of whether the user uses the client to perform format compliance verification on the code submission instructions, the server will perform format compliance verification on the code submission instructions before merging the code and the code submission instructions into the code repository to ensure that the code submission instructions merged into the code repository conform to the standard format.
[0043] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1A schematic diagram of a process for processing code submission instructions provided in an embodiment of the present application is shown;
[0047] Figure 2 A schematic diagram of a process for processing code submission instructions provided in an embodiment of the present application is shown;
[0048] Figure 3 A schematic diagram of a process flow of an application example provided by an embodiment of the present application is shown;
[0049] Figure 4 A schematic diagram of the structure of a device for processing code submission instructions provided in an embodiment of the present application is shown;
[0050] Figure 5 A schematic diagram of the structure of a device for processing code submission instructions provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0051] In order to be able to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that, in the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other. In addition, in order to be able to understand the characteristics and technical content of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings, and the attached drawings are only for reference purposes and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided by multiple details. However, in the absence of these details, one or more embodiments can still be implemented. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0052] In order to improve the current existing technology, since the format check on the client side is optional for users, it is actually impossible to guarantee that every user will perform format check on the code submission description before submitting it, which will lead to the technical problem that it is impossible to ensure that the code submission description merged into the code repository conforms to the standard format. This embodiment provides a method for processing code submission descriptions, which can be applied to the server side, such as Figure 1 As shown, the method includes:
[0053] Step 101: Receive the code submission instructions sent by the client.
[0054] Optionally, step 101 may specifically include: the code submission description may be sent by the client after the client determines that the code submission description complies with the standard format specification by executing a format verification script.
[0055] The code submission description is used to describe the purpose of this submission. In the client, Git must write a code submission description every time it submits code, otherwise the submission will not be allowed.
[0056] Git is a mainstream distributed version control tool used for code storage and version control. Git is a version control tool developed based on the Linux kernel. Unlike commonly used version control tools such as CVS and Subversion, it uses a distributed version library approach and does not require server-side software support, making source code publishing and communication extremely convenient. Git is very fast and has strong merge tracking capabilities.
[0057] In the embodiment of the present application, the server receives the code submission instructions sent by the client after the client executes a format verification script and performs format verification on the code submission instructions.
[0058] Step 102: Send a request for obtaining a format verification script to the client, so as to receive a format verification script corresponding to the code submission instructions and sent by the client in response to the request.
[0059] Script is an extension of batch file, a program saved in plain text. Computer script is a combination of a series of operations that control the computer to perform operations, in which certain logical branches can be implemented. Script is closer to natural language than general program development, and can be interpreted and executed without compilation, which is conducive to rapid development or some lightweight control.
[0060] In an embodiment of the present application, since the server needs to perform format compliance verification on the code submission instructions sent by the client, the server needs to obtain the code submission instructions sent by the client and obtain the corresponding format verification script to perform format compliance verification on the code submission instructions sent by the client.
[0061] In an embodiment of the present application, the format verification script is a script used to verify whether the format of the code submission instructions is correct. Optionally, the client will perform format verification on the code submission instructions before submitting the code, which needs to be executed by the format verification script. The server obtains the format verification script from the client, which refers to the format of the code submission instructions submitted this time, and obtains the format verification script corresponding to the client.
[0062] Step 103: Verify the format of the code submission instructions by executing a format verification script.
[0063] Optionally, before step 103, the method further includes: deploying the format verification script in the CI / CD pipeline.
[0064] CI / CD refers to a software development practice that improves delivery efficiency and quality by introducing automated processes. CI stands for Continuous Integration, which is the process of automatically detecting, pulling, building, and (in most cases) performing unit testing after source code changes.
[0065] The goal is to quickly ensure that newly submitted changes by developers are good and suitable for further use in the code base.
[0066] CD stands for Continuous Delivery and Continuous Deployment.
[0067] Continuous delivery usually refers to the entire process chain (pipeline) that automatically detects source code changes and runs them through build, test, packaging and related operations to produce deployable versions, basically without any human intervention. The goals of continuous delivery in the software development process are automation, efficiency, reliability, repeatability and quality assurance (through continuous testing).
[0068] Continuous deployment refers to the idea of being able to automatically provide releases from a continuous delivery pipeline to end users. Depending on how the user installs it, this could be automatic deployment in a cloud environment, app upgrades (such as an app on a phone), updating a website, or just updating a list of available versions.
[0069] Pipeline: Multiple different tasks and jobs that transform source code into releasable products are usually connected in series into a software "pipeline". After an automatic process is successfully completed, the next process in the pipeline will be started. These pipelines have many different names, such as continuous delivery pipelines, deployment pipelines, and software development pipelines. Pipeline is a series of processes related to CI / CD.
[0070] In an embodiment of the present application, the format verification script on the server side needs to be deployed in the CI / CD pipeline.
[0071] Optionally, step 103 may specifically include: executing a format verification script in the CI / CD pipeline to verify the format of the code submission instructions.
[0072] In an embodiment of the present application, in CI / CD, a format verification script is executed to perform format verification on the code submission instructions sent by the client.
[0073] In this embodiment, the code will pass through the CI / CD pipeline before being merged into the warehouse. By executing the above steps and executing the format verification script in the pipeline, it can be ensured that each code submission description that needs to be merged into the warehouse will be checked for format verification, avoiding the occurrence of missed code submission descriptions, and realizing accurate format specification verification of batch code submission descriptions. When a large amount of code information is currently stored in the code warehouse, the format specification verification of the code submission description of each code information can be standardized in the form of the CI / CD pipeline to reduce the occurrence of data processing errors.
[0074] Step 104: If the code submission description complies with the standard format specification, the code submission description and the code information corresponding to the code submission description are merged into the code repository.
[0075] Code repository is also called storage library, resource library, resource library, version library, code library, storage library. In the version control system, it refers to the data structure on disk storage, which contains files, directories and metadata. Code repository is a public or private place to store a large amount of source code. Most repositories are used for backup and version control. In multi-development projects, they help deal with various code version issues, such as conflicts caused by developers modifying source code at the same time. Nowadays, it is popular to use tools such as Subversion, Git and Mercurial to build repositories and handle the above things, which is very popular in open source projects.
[0076] The code base usually does not contain source code files or binary files (object files) generated by tools, because they can be built from manually written source code and there is no need to add them to the code base. However, the code base usually includes configuration files and property files, because these files are essential data for building.
[0077] Writing standardized code submission instructions can help developers improve the efficiency of code maintenance and upgrades, facilitate quick information search, and generate change records directly from submissions, which is especially important for large-scale projects developed by multiple people. Currently, the more popular one is the Angular specification, which is a semantic submission specification (Semantic CommitMessages).
[0078] Semanticization of code submission instructions means that the code submission instructions will be classified into a meaningful type to describe the submission.
[0079] Code submission description standardization means that code submission descriptions follow pre-defined specifications. For example, the format of code submission descriptions is fixed and belongs to a certain type. These specifications can be recognized not only by developers but also by tools.
[0080] In the Angular specification, the code submission description contains three parts: Header, Body, and Footer.
[0081] To ensure that the submitted code submission instructions conform to the "standard format", there are currently several control measures:
[0082] Install the commitizen plug-in. When submitting using commitizen, the system will guide the developer to fill in all the necessary submission fields according to the specifications. However, the installation steps of commitizen are complicated, and the developer needs to interact with it to fill in the content every time a submission is made, which is troublesome to use. More importantly, there is no guarantee that the developer will submit through the commitizen tool.
[0083] Use git hooks commit check to perform format check when submitting locally. This method also cannot ensure that the developer has configured git hooks commit check in accordance with the specification requirements locally.
[0084] Configure code submission description format verification in the code repository. This method can ensure that the code submission description merged into the repository must comply with the specification, but different code management platforms (such as gitlab, github, gerrit) have different configuration methods and poor portability. The key is that the platform configuration is often a simple regular match, and it is difficult to implement more complex verification logic. This configuration often requires a higher level of administrator privileges.
[0085] In the embodiment of the present application, if the code submission instructions uploaded by the client meet the format verification standards, the code submission instructions and the code information corresponding to the code submission instructions will be merged into the code warehouse. If the code submission instructions uploaded by the client do not meet the format verification standards, the code submission instructions and the code information corresponding to the code submission instructions will not be allowed to be merged into the code warehouse, ensuring that the code information merged into the code warehouse meets the format specification standards. The unified format of the code submission instructions is clearer and easier to read. The purpose of this submission can be understood through the code submission instructions, which can be used for better CR and refactoring, and it is easier to understand changes, locate and discover problems. Each code submission instruction is well thought out, which improves the submission quality and is more conducive to generating change records.
[0086] In this embodiment, after receiving the code submission instructions sent by the client, the server sends a request to the client for obtaining the format verification script corresponding to the received code submission instructions. The server receives the format verification script sent by the client, deploys the format verification script in the CI / CD pipeline, and performs format verification on the received submission instructions. The code submission instructions that meet the format specifications after format verification are merged into the code repository. The format verification process is deployed on the server, which can ensure that regardless of whether the user performs format compliance verification on the code submission instructions on the client, the server will perform format compliance verification on the code submission instructions before merging the code into the code repository, to ensure that the code submission instructions merged into the code repository meet the standard format.
[0087] Compared with the current existing technology, in the process of format checking the code submission instructions, the format checking of the code submission instructions deployed on the client side can be configured by the user, and the user cannot be forced to perform format checking on the code submission instructions. In this embodiment, the code submission instruction standardization control scheme is deployed on both the local and remote warehouse ends. In the process of format checking the code submission instructions, regardless of whether the format standardization of the code submission instructions is checked on the client side, the format standardization of the code submission instructions will be checked on the server side. Because the client must pass the CI / CD pipeline of the server side before merging the code submission instructions into the server-side code repository, the format check will be configured in the CI / CD pipeline on the server side, which can ensure that the submission instructions of each code uploaded by the client are format-standardized, thereby ensuring that the code submission instructions merged into the code repository comply with the standard format, which not only ensures the convenience and standardization of local submission, but also ensures that any submitted code merged into the target repository meets the specification requirements; and it has good portability and reproducibility.
[0088] In order to illustrate the processing process of the client, further, this embodiment also provides a method for processing code submission instructions, which is applied to the client, such as Figure 2 As shown, the method includes:
[0089] Step 201: Send code submission instructions for code information editing to the server.
[0090] Optionally, before step 201, the process also includes: obtaining a configuration template script; and outputting a submission template with filling prompt information by executing the configuration template script.
[0091] The submission template is a template corresponding to the format verification script.
[0092] In an embodiment of the present application, executing the configuration template script can fill prompt information in the submission template. The prompt information may include format information, content information, etc., which is not specifically limited here.
[0093] In an embodiment of the present application, the format verification script needs to be saved in a preset directory, and the specific preset directory may be the .git / hooks directory.
[0094] Git has the function of executing specific script code before or after a specific event occurs (conceptually, it is similar to listening to events, triggers, etc.). Git Hooks are scripts that are triggered to run after Git executes specific events (such as commit, push, receive, etc.). According to the location of the Git Hooks script, it can be divided into two categories: local Hooks, which trigger events such as commit, merge, etc. Server-side Hooks, which trigger events such as receive, etc. Git Hooks are customized script programs, so the functions they implement are related to the corresponding git actions. Before submitting a commit, the hook has the ability to do a lot of work, such as checking the snapshot of the things to be submitted to ensure that nothing is missing in the submission, whether the file name complies with the specifications, whether the submission has been tested, whether the code style meets the team requirements, and so on.
[0095] Optionally, save the format verification script in the hooks directory. When the code is submitted, the format verification script can be executed to perform format verification on the code submission description.
[0096] Optionally, before step 201 , the process may include: calling a format verification script to perform format verification on the code submission instructions.
[0097] Optionally, step 201 may specifically include: if the code submission description complies with the standard format specification, sending the code submission description to the server.
[0098] In the embodiment of the present application, the client configures a format verification script to perform format verification on the input code submission instructions.
[0099] Optionally, step 201 specifically includes: sending the code submission instructions edited in the submission template to the server.
[0100] Step 202: Receive a request for obtaining a format verification script sent by the server.
[0101] Step 203: In response to the request, a format verification script corresponding to the code submission instructions is sent to the server, so that the server verifies the format of the code submission instructions by executing the format verification script, and merges the code submission instructions and code information into the code repository if the code submission instructions comply with the standard format specifications.
[0102] In the embodiment of the present application, the format verification script of the client is saved in the hooks directory. When the server obtains the format verification script for the current code submission instructions, it needs to obtain the format verification script in the hooks directory.
[0103] Optionally, the client sends the submission instructions edited for the code information to the server, receives the request for obtaining the format verification script sent by the server, and sends the format verification script corresponding to the sent code submission instructions to the server. The format verification script sent by the client to the server is saved in a preset directory after configuration. If the user configures the format verification script on the client, when the client submits the submission instructions of the code, the client can automatically perform format verification on the submission instructions to be submitted. Then, when the server performs format verification, it can pass the verification quickly, which can greatly improve the efficiency of merging the code submission instructions into the code repository.
[0104] Compared with the current existing technology, in the process of format checking the code submission instructions, the format checking of the code submission instructions deployed on the client side can be configured by the user, and the user cannot be forced to perform format checking on the code submission instructions. In this embodiment, the code submission instruction standardization control scheme is deployed on both the local and remote warehouse ends. In the process of format checking the code submission instructions, regardless of whether the format standardization of the code submission instructions is checked on the client side, the format standardization of the code submission instructions will be checked on the server side. Because the client must pass the CI / CD pipeline of the server side before merging the code submission instructions into the server-side code repository, the format check will be configured in the CI / CD pipeline on the server side, which can ensure that the submission instructions of each code uploaded by the client are format-standardized, thereby ensuring that the code submission instructions merged into the code repository comply with the standard format, which not only ensures the convenience and standardization of local submission, but also ensures that any submitted code merged into the target repository meets the specification requirements; and it has good portability and reproducibility.
[0105] In order to fully illustrate the specific implementation process of the method of this embodiment, this embodiment provides the following examples, but is not limited thereto: Figure 3 The flowchart of the example is shown.
[0106] Write commit checks and templates locally and push them to the code repository. A commit check is actually a script that performs a code commit description format check; a template is a commit template. Write an initialization script and push it to the code repository. The script configures the commit template and copies the commit check to the .git / hooks directory. It is recommended to execute the initialization script after git copies the repository.
[0107] When submitting code, the system will automatically fill in the submission template. Developers can edit the code submission instructions according to the template prompts. After completing the code submission instructions, the system will automatically call the submission check to perform a specification check. If it does not meet the specifications, the submission will be rejected.
[0108] The CI / CD pipeline deployment code in the remote repository is verified according to the specification of the submission description, and the submission check script is reused to keep the verification rules of the local and remote repositories consistent. Submissions that do not meet the specifications will cause the pipeline to fail, thereby preventing the code from being merged into the repository.
[0109] This embodiment mainly integrates and optimizes the local setting submission template, configures git hooks submission check and CI / CD deployment code submission description check tasks, to achieve convenient and compliant submission and ensure that any submission merged into the target repository must meet the specification requirements.
[0110] Compared with the current existing technology, in the process of format checking the code submission instructions, the format checking of the code submission instructions deployed on the client side can be configured by the user, and the user cannot be forced to perform format checking on the code submission instructions. In this embodiment, the code submission instruction standardization control scheme is deployed on both the local and remote warehouse ends. In the process of format checking the code submission instructions, regardless of whether the format standardization of the code submission instructions is checked on the client side, the format standardization of the code submission instructions will be checked on the server side. Because the client must pass the CI / CD pipeline of the server side before merging the code submission instructions into the server-side code repository, the format check will be configured in the CI / CD pipeline on the server side, which can ensure that the submission instructions of each code uploaded by the client are format-standardized, thereby ensuring that the code submission instructions merged into the code repository comply with the standard format, which not only ensures the convenience and standardization of local submission, but also ensures that any submitted code merged into the target repository meets the specification requirements; and it has good portability and reproducibility.
[0111] Further, as Figure 1 The specific implementation of the method shown in the embodiment provides a processing device for code submission instructions, which can be applied to the server, such as Figure 4 As shown, the device includes: a receiving module 31, an acquiring module 32, a checking module 33, and an incorporating module 34.
[0112] The receiving module 31 is configured to receive the code submission instructions sent by the client;
[0113] The acquisition module 32 is configured to send a request for acquiring a format verification script to the client, so as to receive a format verification script corresponding to the code submission instructions and sent by the client in response to the request;
[0114] The verification module 33 is configured to verify the format of the code submission instructions by executing the format verification script;
[0115] The merging module 34 is configured to merge the code submission description and the code information corresponding to the code submission description into the code repository if the code submission description complies with the standard format specification.
[0116] The verification module 33 is also configured to deploy the format verification script in the CI / CD pipeline.
[0117] In a specific application scenario, the verification module 33 is specifically configured to execute the format verification script in the CI / CD pipeline to verify the format of the code submission instructions.
[0118] In a specific application scenario, the code submission description is sent by the client after the client determines that the code submission description complies with the standard format specification by executing the format verification script.
[0119] It should be noted that for other corresponding descriptions of the functional units involved in the processing device for code submission instructions provided in this embodiment, reference can be made to Figure 1 The corresponding description in will not be repeated here.
[0120] Further, as Figure 2 The specific implementation of the method shown in the embodiment provides a device for processing code submission instructions, which can be applied to a client, such as Figure 5 As shown, the device includes: a sending module 41 and a receiving module 42.
[0121] A sending module 41 is configured to send a code submission instruction for editing the code information to the server;
[0122] The receiving module 42 is configured to receive a request for obtaining a format verification script sent by the server;
[0123] The sending module 41 is also configured to send a format verification script corresponding to the code submission instructions to the server in response to the request, so that the server can verify the format of the code submission instructions by executing the format verification script, and merge the code submission instructions and the code information into the code repository if the code submission instructions comply with the standard format specifications.
[0124] The sending module 41 is further configured to call the format verification script to perform format verification on the code submission instructions;
[0125] In a specific application scenario, the sending module 41 is specifically configured to send the code submission instruction to the server if the code submission instruction complies with the standard format specification.
[0126] The sending module 41 is further configured to obtain a configuration template script; and output a submission template with filling prompt information by executing the configuration template script, wherein the submission template is a template corresponding to the format verification script;
[0127] For example, a configuration template script is obtained; by executing the configuration template script, prompt information for filling in the template is filled in the output submission template, and the submission template is a template corresponding to the format verification script.
[0128] In a specific application scenario, the sending module 41 is further configured to send the code submission instructions edited by the user in the submission template to the server.
[0129] In specific application scenarios, the format verification script is saved in the preset directory.
[0130] In a specific application scenario, the sending module 41 is further configured to obtain the format verification script from the preset directory and send the script to the server.
[0131] It should be noted that for other corresponding descriptions of the functional units involved in the processing device for code submission instructions provided in this embodiment, reference can be made to Figure 2 The corresponding description in will not be repeated here.
[0132] Based on the above Figure 1 The method shown in the embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned Figure 1 and Figure 2 Based on the above method. Figure 2 The method shown in the embodiment also provides another computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned Figure 2 The method shown.
[0133] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0134] Based on the above Figure 1 The method shown, and Figure 4 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides an electronic device, which can be configured on the server side, and the device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 The method shown.
[0135] Based on the above Figure 2 The method shown, and Figure 5 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides an electronic device, which can be configured on the client side, and the device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 2 The method shown.
[0136] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0137] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.
[0138] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0139] Based on the contents of the above embodiments, the embodiment of the present application also provides a system for processing code submission instructions, including: a client and a server. Specifically, the server can execute the following Figure 1 The client can execute the method shown in Figure 2 The method described.
[0140] For example, the client sends the code submission instructions edited for the code information to the server; the server receives the code submission instructions sent by the client; sends a request to the client to obtain a format verification script; accordingly, the client receives the request to obtain a format verification script sent by the server; and sends the format verification script corresponding to the code submission instructions to the server. Accordingly, the server receives the format verification script corresponding to the code submission instructions sent by the client in response to the request; the format verification script is executed to verify the format of the code submission instructions; if the code submission instructions meet the standard format specifications, the code submission instructions and the code information corresponding to the code submission instructions are merged into the code repository.
[0141] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or by hardware. By applying the solution of this embodiment, compared with the current existing technology, in the process of format checking the code submission instructions, the format checking of the code submission instructions deployed on the client can be configured by the user, and the user cannot be forced to perform format checking on the code submission instructions. This embodiment deploys code submission instruction standardization control solutions on both the local and remote warehouse ends. In the process of format checking the code submission instructions, regardless of whether the format standardization of the code submission instructions is checked on the client, the format standardization of the code submission instructions will be checked on the server. Because the client must pass through the CI / CD pipeline of the server before merging the code submission instructions into the server code repository, the format check will be configured in the CI / CD pipeline on the server, which can ensure that the submission instructions of each code uploaded by the client are format-standardized. Verification, thereby ensuring that the code submission instructions merged into the code repository conform to the standard format, which not only ensures the convenience and standardization of local submission, but also ensures that any submitted code merged into the target repository meets the specification requirements; and has good portability and reproducibility.
[0142] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0143] The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features applied for herein.
Claims
1. A method for processing code submission instructions, characterized in that: Applied to the server, the method includes: Receive code submission instructions sent by the client; Sending a request for obtaining a format verification script to the client, so as to receive a format verification script corresponding to the code submission instructions and sent by the client in response to the request; By executing the format verification script, the code submission instructions are verified for format specifications; If the code submission description complies with the standard format specification, the code submission description and the code information corresponding to the code submission description are merged into the code repository.
2. The method according to claim 1, characterized in that Before executing the format verification script to verify the format of the code submission instructions, the method further includes: Deploy the format verification script in the CI / CD pipeline; The step of executing the format verification script to verify the format of the code submission instructions includes: The format verification script is executed in the CI / CD pipeline to verify the format of the code submission instructions.
3. The method according to claim 1 or 2, characterized in that: The code submission description is sent by the client after the client determines that the code submission description complies with the standard format specification by executing the format verification script.
4. A method for processing code submission instructions, characterized in that: Applied to a client, the method comprises: Send the code submission instructions edited for the code information to the server; Receiving a request for obtaining a format verification script sent by the server; A format verification script corresponding to the code submission instructions is sent to the server, so that the server verifies the format of the code submission instructions by executing the format verification script, and merges the code submission instructions and the code information into the code repository if the code submission instructions comply with the standard format specifications.
5. The method according to claim 4, characterized in that Before sending the code submission instructions for editing the code information to the server, the method further includes: Calling the format verification script to perform format verification on the code submission instructions; The code submission instructions for editing the code information are sent to the server, including: If the code submission description complies with the standard format specification, the code submission description is sent to the server.
6. The method according to claim 4, characterized in that Before sending the code submission instructions edited by the user for the code information to the server, the method further includes: Get the configuration template script; By executing the configuration template script, a submission template with filling prompt information is output, and the submission template is a template corresponding to the format verification script; The code submission instructions for editing the code information are sent to the server, including: The code submission instructions edited in the submission template are sent to the server.
7. A device for processing code submission instructions, characterized in that: Applied to the server, including: A receiving module, configured to receive a code submission instruction sent by a client; an acquisition module configured to send a request for acquiring a format verification script to the client, so as to receive a format verification script corresponding to the code submission instructions and sent by the client in response to the request; A verification module is configured to verify the format of the code submission instructions by executing the format verification script; The merging module is configured to merge the code submission description and the code information corresponding to the code submission description into the code repository if the code submission description complies with the standard format specification.
8. A device for processing code submission instructions, characterized in that: Applied to the client, including: A sending module, configured to send the code submission instructions edited by the user for the code information to the server; A receiving module, configured to receive a request for obtaining a format verification script sent by the server; The sending module is further configured to send a format verification script corresponding to the code submission instructions to the server in response to the request, so that the server verifies the format of the code submission instructions by executing the format verification script, and merges the code submission instructions and the code information into the code repository if the code submission instructions comply with the standard format specifications.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Code management method and device, electronic equipment and computer readable storage medium
CN120821491A
