CN112435007A - Js-based code submission method, device, computer equipment and storage medium - Google Patents

Js-based code submission method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN112435007A
CN112435007A CN202011354694.0A CN202011354694A CN112435007A CN 112435007 A CN112435007 A CN 112435007A CN 202011354694 A CN202011354694 A CN 202011354694A CN 112435007 A CN112435007 A CN 112435007A
Authority
CN
China
Prior art keywords
code
node
code submission
submission
interactive interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011354694.0A
Other languages
Chinese (zh)
Inventor
刘泽运
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011354694.0A priority Critical patent/CN112435007A/en
Publication of CN112435007A publication Critical patent/CN112435007A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/101Collaborative creation, e.g. joint development of products or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • General Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to the technical field of distributed management, in particular to a node.js-based code submission method, a node.js-based code submission device, node.js-based code submission equipment and a storage medium. The node.js-based code submission method comprises the steps of executing a node.js script and outputting a first visual interactive interface; wherein a plurality of selectable workitem IDs are displayed in the first visual interactive interface; receiving a target work item ID according to a selection instruction triggered by the first visual interactive interface; receiving code submission information corresponding to the ID of the target work item and a target code; executing the submission command, and simultaneously triggering a client hook to verify the code submission information to obtain a verification result; and if the verification result is that the verification is passed, successfully submitting the target code to a code management system. The invention also relates to the field of blockchains, and the object code can be further stored into blockchains. The node.js-based code submission method can effectively solve the problem of low submission efficiency of the current code.

Description

Js-based code submission method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of distributed management technologies, and in particular, to a node.
Background
At present, generally, a demand defect management system manages demand defects and a code management system manages the previous codes submitted by developers, correlation can be carried out between the demand defect management system and the code management system through a unique work item ID in the demand defects, so that a tester can track the codes submitted by the developers according to the demand defect management system, and meanwhile, the developers can track the corresponding demand defects according to the previous code submission records and correlate the demand defects with the codes.
However, in the conventional association between the demand defect management system and the code management system, when a developer submits a code, the developer needs to log in the demand defect management system to inquire the required work item ID, and then manually copy and paste the work item ID into the code management system to submit the code, so that the code submission efficiency is reduced, and the possibility of manual operation errors exists.
Disclosure of Invention
Embodiments of the present invention provide a node.js-based code submission method, apparatus, computer device, and storage medium, so as to solve the problem that the conventional code submission depends on manual operation and the code submission efficiency is low.
Js-based code submission method, comprising:
executing the node.js script and outputting a first visual interactive interface; wherein a plurality of selectable workitem IDs are displayed in the first visual interactive interface;
receiving a target work item ID according to a selection instruction triggered by the first visual interactive interface;
receiving code submission information corresponding to the ID of the target work item and a target code;
executing the submission command, and simultaneously triggering a client hook to verify the code submission information to obtain a verification result;
and if the verification result is that the verification is passed, successfully submitting the target code to a code management system. Js-based code submission apparatus, comprising:
the first visual interface output module is used for executing the node.js script and outputting a first visual interactive interface; wherein a plurality of selectable workitem IDs are displayed in the first visual interactive interface;
the target work item ID receiving module is used for receiving the ID of the target work item according to the selection instruction triggered by the first visual interactive interface;
the data receiving module is used for receiving code submission information corresponding to the ID of the target work item and the target code;
the verification module is used for executing the submission command and triggering the client hook at the same time so as to verify the code submission information to obtain a verification result;
and the code submitting module is used for successfully submitting the target code to the code management system if the verification result is that the verification is passed.
A computer device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, said processor implementing the steps of the node.
A computer storage medium, the computer storage medium storing a computer program that, when executed by a processor, performs the steps of the node.
In the node.js-based code submission method, the node.js-based code submission device, the computer equipment and the storage medium, the node.js script is executed, and a first visual interactive interface is output; the node.js script is a script written in advance according to a node.js tool, an http request module and a js visualization module are provided in the node.js tool so as to request a plurality of selectable work item IDs from a demand defect management system through the http request module, and the node.js tool is a Javascript interpreter which adopts a grammar rule of Javascript, so that js codes can be directly written to realize a visual interaction interface, the plurality of selectable work item IDs are displayed on a first visual interaction interface so as to be used for developers to select the required target work item IDs, the traditional requirement that the developers need to log in the demand defect management system to manually copy the required work item IDs to a terminal is abandoned, and the code submission efficiency can be effectively improved. And then, receiving code submission information and a target code corresponding to the target work item ID, executing a submission command, and simultaneously triggering a client hook to verify the code submission information to obtain a verification result, so that the code submission information is normalized in a multi-user collaboration project, later-stage collaboration and Bug processing are more convenient, and consistency of problem properties corresponding to the submitted code and the target work item ID is ensured. If the verification result is that the verification is passed, the target code is successfully submitted to the code management system, so that the possibility of manual operation errors is reduced, and meanwhile, closed-loop control over the whole code submitting process can be realized by requiring communication between the defect management system and the code management system.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
Fig. 1 is a schematic diagram of an application environment of a node.js-based code submission method in an embodiment of the present invention;
fig. 2 is a flow chart of a node.js-based code submission method in an embodiment of the present invention;
FIG. 3 is a detailed flowchart of step S201 in FIG. 2;
FIG. 4 is a detailed flowchart of step S301 in FIG. 3;
FIG. 5 is a detailed flowchart of step S203 in FIG. 2;
fig. 6 is a flow chart of a node.js-based code submission method in an embodiment of the present invention;
fig. 7 is a flow chart of a node.js-based code submission method in an embodiment of the present invention;
FIG. 8 is a detailed flowchart of step S204 in FIG. 2;
fig. 9 is a schematic diagram of a node.js-based code submission apparatus in an embodiment of the present invention;
FIG. 10 is a schematic diagram of a computer device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Js-based code submission method may be applied in an application environment such as that of fig. 1, where a computer device communicates with a server over a network. The computer device may be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server may be implemented as a stand-alone server.
In an embodiment, as shown in fig. 2, a node.
S201: executing the node.js script and outputting a first visual interactive interface; wherein a plurality of selectable workitem IDs are displayed in the first visual interactive interface.
The embodiment can be applied to a Terminal (Terminal), and can display a plurality of selectable work item IDs of a developer in a demand defect management system through a first visual interactive interface so that the developer can select the selectable work item IDs, so that the conventional method that the developer needs to log in the demand defect management system to manually copy the required work item IDs to the Terminal to submit codes corresponding to the work item IDs to a code management system is eliminated, and the possibility of manual operation errors is reduced. The node.js script is a shell script written by a node.js tool in advance, and the communication between the terminal and the demand management defect system can be realized through the node.js script. The first visual interactive interface is used for displaying a plurality of work item IDs so as to realize visual interaction with a target user. The target user is the developer.
For example, in the project development, different developers are responsible for different work items, so when a certain part of codes has a BUG or a new requirement, the developer responsible for writing the part of codes needs to repair the BUG or shatter the new requirement to write the codes, and push up the new version codes of the repaired BUG or the upgraded version codes of the new requirement to the code management system, so that the code management system manages the codes of different branches in the project. Each BUG to be repaired or the newly added requirement corresponds to a work item ID, and the work item ID is generated by a requirement management defect system.
S202: and receiving the ID of the target work item according to a selection instruction triggered by the first visual interactive interface.
S203: and receiving code submission information corresponding to the ID of the target work item and the target code.
The code submission information includes, but is not limited to, submission type, description information, and the like. The commit types include, but are not limited to, the following: feature (new function), fix (patch bug), documentation, style (format, i.e. change that does not affect the running of code) refactor (reconstruction, i.e. change of code that does not modify bug, nor add function), test (add test), and chore (change of build process or auxiliary tool). The code description information is the description of the range, variation and the like of the code submitted this time.
Specifically, the first visual interactive interface may display a plurality of selectable work item IDs corresponding to the target user, so that the developer may select a desired work item ID as the target work item ID, fill in code submission information of the code, and upload the modified code, i.e., the target code, so that the server receives the target work item ID, the code submission information corresponding to the target work item ID, and the target code, which are input by the target user.
It is emphasized that the object code may also be stored in a node of a block chain in order to further ensure privacy and security of the object code.
S204: and executing the submission command, and simultaneously triggering the client hook to verify the code submission information to obtain a verification result.
Wherein, the submit command is git commit, and the submit command is used for submitting the target code to the code management system. The client hook refers to the git client hook. The terminal can automatically execute the submission command when receiving the target work item ID input by the agent, the code submission information corresponding to the target work item ID and the target code, and does not need to manually input the submission command when the developer submits each time, so that the repetitive workload is reduced, and the code submission efficiency is improved.
Specifically, the implementation depends on a git tool (a distributed version control tool for managing the release and communication of the source code), a git hook can be configured in the git tool, and the git hooks are some self-defined scripts for controlling the flow of git work and are divided into a client hook and a server hook. The client hook (e.g., commit-msg) is mainly used to control the commit workflow of the client git. The server hook is invoked primarily when the server receives the commit object, before it is pushed to the server. In this embodiment, when the terminal executes the commit command of git commit, the client hook, i.e., the commit-msg hook, is triggered to check the code commit information, so as to obtain a check result. Different check logics can be configured in the commit-msg hook, and the extensibility is strong.
In the embodiment, a client hook is introduced to a traditional code submission program to check the format normalization of the code submission information, so that the code submission information is normalized in a multi-user cooperation project, and the post-cooperation and Bug processing are more convenient; meanwhile, the consistency of the submitted code and the problem property corresponding to the work item ID can be ensured through the verification of the code submission information.
S205: and if the verification result is that the verification is passed, successfully submitting the target code to the code management system.
Specifically, when the code submission information conforms to the code submission specification, a verification result that the verification is passed is obtained, and when the verification is passed, the target code can be successfully submitted to the code management system. The code submission specification can be configured in a script configuration file of the node.
In this embodiment, a node.js script is executed, and a first visual interactive interface is output, so that a plurality of selectable workitem IDs of a developer in a requirement defect management system are displayed on the first visual interactive interface, so that the developer can select a target workitem ID, and the conventional requirement that the developer needs to log in the requirement defect management system to manually copy a required workitem ID to a terminal is eliminated, thereby improving the code submission efficiency. And then, receiving code submission information and a target code corresponding to the target work item ID, executing a submission command, and simultaneously triggering a client hook to verify the code submission information to obtain a verification result, so that the code submission information is normalized in a multi-user collaboration project, later-stage collaboration and Bug processing are more convenient, and consistency of problem properties corresponding to the submitted code and the target work item ID is ensured. If the verification result is that the verification is passed, the target code is successfully submitted to the code management system, so that the possibility of manual operation errors is reduced, and meanwhile, closed-loop control over the whole code submitting process can be realized by requiring communication between the defect management system and the code management system.
In an embodiment, as shown in fig. 3, in step 201, namely, executing a node. js script, and outputting a first visual interactive interface, the method specifically includes the following steps:
s301: and executing the node.js script, sending an http request to a demand defect management system, and acquiring a plurality of optional work item IDs of the target user.
Specifically, in the node.js script, an http request (e.g., a get request) may be sent to a specified link through an http request module in the node.js tool, so as to implement communication between the terminal and the demand defect management system, thereby obtaining a plurality of to-be-repaired work item IDs corresponding to the developer (i.e., a target user) in the demand defect management system.
S302: and displaying a plurality of selectable workitem IDs in the first visual interactive interface according to a preset display style.
The preset display style is a display style which is written in advance by a developer and can display a plurality of work item IDs on a terminal. The display style may be in a table form or other forms, and is not limited herein. Specifically, by executing steps S301-S302 and steps S202-S205 at the terminal, the communication between the required defect management system and the code management system can be realized, and the closed-loop control of the whole code submission process can be realized.
The node.js script is executed to realize communication between the terminal and the demand defect management system, the work item ID in the demand defect management system is obtained, the first visual interactive interface is output in the terminal, so that developers can select the required work item ID, and the required work item ID does not need to be manually copied to the terminal by logging in the demand defect management system, so that the code submission efficiency is improved.
In an embodiment, as shown in fig. 4, in step S301, that is, executing a node. js script, sending an http request to a defect management system, and acquiring a plurality of selectable workitem IDs of a target user, specifically includes the following steps:
s401: and executing the node.js script and outputting a login interface.
S402: and receiving the user ID and the password of the target user according to the login interface.
S403: and sending an http request to a demand defect management system according to the user ID and the password to obtain a plurality of optional work item IDs of the target user.
In particular, when the node. js script is executed, a login interface can be output for the developer to input a user name (user ID) and a password, wherein the user ID is consistent with the user ID of the developer in the requirement defect management system. Specifically, a user ID and a password are input in the terminal, so that an http request is sent to the demand defect management system through the user ID and the password, a plurality of work item IDs of a target user are obtained for a developer to select, and the real validity of the work item IDs is guaranteed.
It can be understood that all the working item IDs under the development condition can be obtained by sending an http request to the requirement defect management system by adopting the user ID and the password, and the working item IDs under the name can be directly selected during selection, so that the consistency of the working item IDs and the user can be ensured, and the condition that the code submission is disordered due to the fact that the user selects the working item IDs under other development names by mistake can be avoided.
In an embodiment, as shown in fig. 5, in step S203, that is, receiving the code submission information and the target code corresponding to the target work item ID, the method specifically includes the following steps:
s501: acquiring a script configuration file; and the script configuration file comprises a code submission information template corresponding to the ID of the target work item.
And a plurality of code submission information templates are stored in the script configuration file. Different specifications of code submission information (i.e., code submission information templates) may be configured for different work items. Specifically, after the developer selects the target work item ID of the code to be submitted, the terminal reads the code submission information template corresponding to the target work ID in the script configuration file, so that the subsequent second visual interactive interface corresponding to the target work item ID is output according to the code submission information template.
S502: submitting an information template according to the codes and outputting a second visual interactive interface; and displaying a plurality of to-be-edited code submission items in the code submission information template in the second visual interactive interface.
And the second visual interactive interface is used for displaying the content in the code submission information template for the user to select and edit. It is understood that the to-be-edited mode in this embodiment may include a selection or editing mode, and for a partial code submission item, such as a submission type, a plurality of corresponding selectable types may be set for selection by a user, so as to reduce errors in manual editing operations. For another partial code submission item, such as body, the text content edited by the developer may be received directly.
The submission type corresponds to a plurality of optional types, namely Feature (new function), fix (patch bug), documentation, style (format, i.e. change which does not affect code operation), refactor (reconstruction, i.e. not newly added function, or code change which modifies bug), test (add test), and chore (change of construction process or auxiliary tool).
Wherein, the code submission information template may include three parts: head, body, and foot. The head section includes, but is not limited to, a commit type, scope (code scope of influence, such as data layer, control layer, view layer, etc.), and subject (brief description of this commit). The body part is used for filling in the detailed description submitted this time, and should include the change description, the reason for the change, and the like. The foot section is used to fill in a description of some code changes when the current version of code is not compatible with the previous version of code.
It is understood that the code submission terms include, but are not limited to, type, scope, subject, body, and foot as described above.
S503: receiving code submission information according to the second visual interactive interface; the code submission information comprises a code submission item and a target attribute value corresponding to the code submission item.
Specifically, the developer can edit a plurality of to-be-edited code submission items displayed in the second visual interactive interface, and code submission information does not need to be edited manually, so that the code submission efficiency is ensured.
Illustratively, a plurality of submission types are displayed in the second visual interactive interface according to the template for the developer to select, and after the submission types are selected, the corresponding description information is filled in a body part, so that the terminal receives the code submission information.
S504: the calling code submission interface receives the object code.
Wherein the code submission interface is an interface for receiving the object code. Specifically, when executing the node. js script, the terminal may directly call the code submission interface to receive the object code.
In one embodiment, as shown in fig. 6, the method further comprises the steps of:
s601: and if the verification result is that the verification fails, repeatedly executing the node.
Specifically, the code submission information template includes a plurality of code submission items to be edited, which carry sequence identifiers, and a plurality of selectable attribute values corresponding to each code submission item;
s602: and receiving the ID of the target work item according to a selection instruction triggered by the first visual interactive interface.
Specifically, step S602 is consistent with step S202, and is not described herein again to avoid repetition.
S603: acquiring a script configuration file; and the script configuration file comprises a code submission information template corresponding to the ID of the target work item.
Specifically, step S603 and step S501 are consistent, and are not described herein again to avoid repetition.
S604: determining a first display sequence according to the sequence identification of each code submission item to be edited; and the first display sequence is used for indicating the second visual interactive interface to display the code submission items according to the sequence identification.
S605: sorting the selectable attribute values according to the time difference between the use time of each selectable attribute value and the current time, and determining a second display sequence; and the second display sequence is used for indicating the second visual interactive interface to display the selectable attribute values in the sequence from small to large according to the time difference.
S606: and displaying the code submission items and the selectable attribute values in the second visual interactive interface according to the first display order and the second display order. And displaying a plurality of to-be-edited code submission items in the code submission information template in the second visual interactive interface.
Specifically, when the verification fails, the steps S201 to S205 may be repeatedly performed to re-execute the code submission process. Further, in the process, the second visual interactive interface can be dynamically displayed according to the history record of the submission failure.
The code submission information template comprises a plurality of code submission items to be edited, which carry sequence identifiers, and a plurality of selectable attribute values corresponding to each code submission item. The sequence identifier refers to a display sequence (i.e., a first display sequence) of each editing code item specified in the code submission information template. The selectable attribute values, that is, the attribute values that can be selected by the user and are displayed corresponding to the code submission items, for example, multiple submission types corresponding to type or historical record values corresponding to scope, and the like. It is to be understood that the first display order and the second display order are used to determine the display order of the code submission items and the selectable attribute values in the second visual interactive interface.
Specifically, for each selectable attribute value corresponding to each code submission item, the use time corresponds to one use time, and when the time difference between the use time and the current time is in a descending order, the selectable attribute values are sorted, so that the history record closest to the current time is arranged at the top, developers can quickly select the attribute value, and the code submission efficiency is ensured.
S607: receiving code submission information according to the second visual interactive interface; the code submission information comprises a code submission item and a target attribute value corresponding to the code submission item;
specifically, step S607 is consistent with step S503, and is not described herein again to avoid repetition.
S608: the calling code submission interface receives the object code.
Specifically, step S608 is consistent with step S504, and is not described herein again to avoid repetition.
S609: and executing the submission command, and simultaneously triggering the client hook to verify the code submission information to obtain a verification result.
Specifically, step S609 is consistent with step S204, and is not described herein again to avoid repetition.
S610: and if the verification result is that the verification is passed, successfully submitting the target code to the code management system.
Specifically, step S610 is consistent with step S205, and is not described herein again to avoid repetition.
Further, as shown in fig. 7, the method further includes the steps of:
s701: executing the node.js script and outputting a first visual interactive interface; wherein a plurality of selectable workitem IDs are displayed in the first visual interactive interface.
Specifically, step S701 is consistent with step S201, and is not described herein again to avoid repetition.
S702: and receiving the ID of the target work item according to a selection instruction triggered by the first visual interactive interface.
Specifically, step S702 is consistent with step S202, and is not described herein again to avoid repetition.
S703: and receiving code submission information corresponding to the ID of the target work item and the target code.
Specifically, step S703 is consistent with step S203, and is not described herein again to avoid repetition.
S704: and writing the target ID and the corresponding code submission information into a storage file as historical data.
Specifically, after the verification fails, in order to enable the developer to input only the part with the editing error without having to walk the whole code submission process again, in this embodiment, after the target ID and the corresponding code submission information are acquired, the part of information may be written into the storage file as the historical data, so that after the subsequent developer corrects the problem node with the editing error, the data in the storage file may be directly called, the submission command is executed, and the code is submitted.
S705: and executing the submission command, and simultaneously triggering the client hook to verify the code submission information to obtain a verification result.
Specifically, step S702 is consistent with step S204, and is not described herein again to avoid repetition.
S706: and if the verification result is verification failure, acquiring a failure reason returned by the hook of the client.
S707: and positioning the problem node according to the failure reason, and receiving the modification submission information corresponding to the problem node.
Specifically, the failure reason may be determined by checking a failed regular expression. Specifically, when format verification is performed by adopting preset regular expressions with different verification conditions, corresponding verification results and failure reasons can be returned, and the problem nodes can be located through the failure reasons.
Illustratively, if the preset regular expression detects that the multiple influence ranges are not replaced by the multiple influence ranges when the scope code submission item is verified, an error is reported, that is, the verification fails, at this time, the failure reason can be obtained as that the attribute value corresponding to the scope code submission item is not replaced by the multiple influence ranges, and the problem node can be positioned as an editing error of the scope code submission item. Or, after the format is checked, a layer of check can be further added to further ensure the consistency of the work item ID and the submitted code, namely, the semantic similarity between the work item description information corresponding to the work ID and the code description information can be checked by calling a semantic identification interface, whether the semantics of the two information are similar is judged, if the semantic similarity is lower than a certain threshold value, the description of the work item ID and the submitted code submission information is not consistent, and the problem node can be positioned as the selection of the work item ID and the error of the code description information.
S708: and replacing the attribute value corresponding to the problem node in the historical data according to the modified submission information, and acquiring the modified code submission information.
S709: and repeatedly executing the submission command, and triggering the client hook to verify the code submission information to obtain a verification result.
S710: and if the verification result is that the verification is passed, successfully submitting the target code to the code management system.
Specifically, step S710 is consistent with step S205, and is not described herein again to avoid repetition.
It can be understood that, since the embodiment is executed in the terminal, and the terminal needs to execute the script in sequence when executing the script, in order to further save time in the embodiment, after the verification fails, the developer can only input the part with the editing error, and smoothly execute the submission command by reading the pre-stored data and the modified data, so as to submit the object code corresponding to the object ID to the code management system.
Specifically, after receiving the modified submission information corresponding to the problem node, if the problem node is an editing error of the scope code submission item, the attribute value of the scope code submission item part of the code submission information in the read historical data can be covered or reassigned, and the rest information is kept unchanged to obtain the modified code pricing information, so that the submission command can be smoothly executed, and the target code corresponding to the target ID is submitted to the code management system.
In an embodiment, as shown in fig. 8, in step S204, the code submission information is verified to obtain a verification result, which specifically includes the following steps:
s801: and acquiring a preset regular expression corresponding to the code submission information template based on the code submission information template.
The code submission information template is a template which is established in advance according to a unified standard specified in an enterprise and is used for standardizing the code submission information. And different codes submit different format checks corresponding to the information template, namely corresponding different preset regular expressions. The preset regular expression is a regular expression which is configured in advance according to different code submission information templates and is used for carrying out format verification. It can be understood that multiple regular expressions can be configured in the script corresponding to the client hook to perform format checking.
S802: and carrying out format verification on the code submission information by adopting a preset regular expression to obtain a verification result.
For example, the format check in this embodiment may include, but is not limited to, the following check conditions (different check conditions correspond to different regular expressions): 1) for code submission types, including only multiple optional types of settings, namely Feature, fix, documentation, style, refactor, test, and chord, for other characters, an error may be returned. 2) If there are scope code submissions, if there are more than one scope of the code, then it needs to be replaced by a star, and it must be filled in after type and within the small brackets. 3) When filling in the body code submission entry, the first person now describes it. And must be separated from the head portion by an empty line, and must wrap every character exceeding 72. 4) When the root code submission item is filled, the root code submission item is filled according to the following format, namely BREAKING CHANGE + colon + blank + CHANGE description, CHANGE reason and migration method. In the embodiment, the format of the code submission information is verified through the preset regular expression, so that the literal meaning can be quickly verified.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In an embodiment, a node.js-based code submitting apparatus is provided, and the node.js-based code submitting apparatus corresponds to the node.js-based code submitting method in the above embodiment one to one. As shown in fig. 9, the node.js-based code submitting apparatus includes a first visual interface output module 10, a target work item ID receiving module 20, a data receiving module 30, a verifying module 40, and a code submitting module 50. The functional modules are explained in detail as follows:
a first visual interface output module 10, configured to execute the node.js script and output a first visual interactive interface; wherein a plurality of selectable workitem IDs are displayed in the first visual interactive interface.
And the target work item ID receiving module 20 is configured to receive a target work item ID according to a selection instruction triggered by the first visual interactive interface.
And the data receiving module 30 is configured to receive the code submission information corresponding to the target work item ID and the target code.
And the checking module 40 is used for executing the submitting command and triggering the client hook at the same time so as to check the code submitting information to obtain a checking result.
And the code submitting module 50 is used for successfully submitting the target code to the code management system if the verification result is that the verification is passed.
Specifically, the first visual interface output module comprises a selectable work item ID acquisition unit and a display unit.
And the optional work item ID acquisition unit is used for executing the node.js script, sending an http request to the demand defect management system and acquiring a plurality of optional work item IDs of the target user.
And the display unit is used for displaying the plurality of selectable workitem IDs in the first visual interactive interface according to a preset display style.
Specifically, the optional work item ID acquisition unit includes a login interface output subunit, a data receiving subunit, and an optional work item ID acquisition subunit.
And the login interface output subunit is used for executing the node.
And the data receiving subunit is used for receiving the user ID and the password of the target user according to the login interface.
And the optional work item ID acquisition subunit is used for sending an http request to the demand defect management system according to the user ID and the password to acquire a plurality of optional work item IDs of the target user.
Specifically, the data receiving module comprises a script configuration file acquiring unit, a second visual interactive interface output unit, a code submission information receiving unit and an object code receiving unit.
The script configuration file acquisition unit is used for acquiring a script configuration file; and the script configuration file comprises a code submission information template corresponding to the ID of the target work item.
And the second visual interactive interface output unit is used for outputting a second visual interactive interface according to the code submission information template. And displaying a plurality of to-be-edited code submission items in the code submission information template in the second visual interactive interface.
The code submission information receiving unit is used for receiving the code submission information according to the second visual interactive interface; the code submission information comprises a code submission item and a target attribute value corresponding to the code submission item.
And the target code receiving unit is used for calling the code submitting interface to receive the target code.
Specifically, the node.js-based code submitting device further comprises a verification failure processing module, a first display order determining module, a second display order determining module and a second visual interactive interface output module.
And the verification failure processing module is used for repeatedly executing the node.js script and outputting the first visual interactive interface if the verification result is that the verification fails.
The first display sequence determining module is used for determining a first display sequence according to the sequence identifier of each code submission item to be edited; and the first display sequence is used for indicating the second visual interactive interface to display the code submission items according to the sequence identification.
The second display sequence determining module is used for sequencing the selectable attribute values according to the time difference between the use time of each selectable attribute value and the current time to determine a second display sequence; and the second display sequence is used for indicating the second visual interactive interface to display the selectable attribute values in the sequence from small to large according to the time difference.
And the second visual interactive interface output module displays the code submission item and the selectable attribute value in a second visual interactive interface according to the first display sequence and the second display sequence.
Specifically, the node.js-based code submitting device further comprises a storage module, a check failure processing module, a problem positioning module, a code submitting information acquiring module and a checking module.
And the storage module is used for writing the target ID and the corresponding code submission information into a storage file as historical data.
And the verification failure processing module is used for acquiring a failure reason returned by the hook of the client if the verification result is verification failure.
And the problem positioning module is used for positioning the problem node according to the failure reason and receiving the modification submission information corresponding to the problem node.
And the code submission information acquisition module is used for replacing the attribute value corresponding to the problem node in the historical data according to the modified submission information to acquire the modified code submission information.
And the checking module is used for repeatedly executing the submitting command and triggering the client hook to check the code submitting information to obtain a checking result.
Specifically, the verification module comprises a preset regular expression acquisition unit and a verification unit.
And the preset regular expression obtaining unit is used for obtaining the preset regular expression corresponding to the code submission information template based on the code submission information template.
And the verification unit is used for carrying out format verification on the code submission information by adopting a preset regular expression to obtain a verification result.
For the specific limitation of the node.js-based code submitting device, reference may be made to the above limitation of the node.js-based code submitting method, which is not described herein again. The various modules in the node. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 10. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a computer storage medium and an internal memory. The computer storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the computer storage media. The database of the computer device is used for storing data, such as historical data, generated or obtained during the execution of the node. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a node.
In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the steps of the node. Or, when the processor executes the computer program, the functions of each module/unit in the node.
In an embodiment, a computer storage medium is provided, where a computer program is stored on the computer storage medium, and when executed by a processor, the computer program implements the steps of the node. Alternatively, the computer program, when executed by the processor, implements the functions of each module/unit in the above node.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A node.js-based code submission method, comprising:
executing the node.js script and outputting a first visual interactive interface; wherein a plurality of selectable workitem IDs are displayed in the first visual interactive interface;
receiving a target work item ID according to a selection instruction triggered by the first visual interactive interface;
receiving code submission information corresponding to the ID of the target work item and a target code;
executing the submission command, and simultaneously triggering a client hook to verify the code submission information to obtain a verification result;
and if the verification result is that the verification is passed, successfully submitting the target code to a code management system.
2. The node.js-based code submission method of claim 1, wherein the executing the node.js script, outputting the first visual interactive interface, comprises:
executing the node.js script, sending an http request to a demand defect management system, and acquiring a plurality of selectable workitem IDs of the target user;
and displaying the plurality of selectable workitem IDs in the first visual interactive interface according to a preset display style.
3. The node.js-based code submission method of claim 2, wherein the executing the node.js script sends an http request to a demand defect management system to obtain a plurality of optional workitem IDs of the target user, comprises:
executing the node.js script and outputting a login interface;
receiving a user ID and a password of a target user according to the login interface;
and sending an http request to the demand defect management system according to the user ID and the password, and acquiring a plurality of optional work item IDs of the target user.
4. The node.js-based code submission method of claim 1, wherein the receiving of the code submission information and the target code corresponding to the target work item ID includes:
acquiring a script configuration file; the script configuration file comprises a code submission information template corresponding to the target work item ID;
outputting a second visual interactive interface according to the code submission information template; displaying a plurality of to-be-edited code submission items in a code submission information template in the second visual interactive interface;
receiving the code submission information according to the second visual interactive interface; the code submission information comprises the code submission item and a target attribute value corresponding to the code submission item;
and calling a code submission interface to receive the target code.
5. The node.js-based code submission method of claim 4, wherein after the submitting command is executed and the client hook is triggered to verify the code submission information and obtain the verification result, further comprising:
if the verification result is verification failure, repeatedly executing the execution node.js script and outputting a first visual interactive interface;
outputting a second visual interactive interface according to the code submission information template, wherein the second visual interactive interface comprises:
determining a first display sequence according to the sequence identifier of each code submission item to be edited; wherein the first display order is used for instructing the second visual interactive interface to display the code submission items according to the order identification;
sorting the selectable attribute values according to the time difference between the use time and the current time of each selectable attribute value, and determining a second display sequence; the second display sequence is used for indicating the second visual interactive interface to display the selectable attribute values according to the sequence of the time difference from small to large;
and displaying the code submission items and the selectable attribute values in the second visual interactive interface according to the first display order and the second display order.
6. The node.js-based code submission method of claim 4, wherein, after receiving the code submission information in accordance with the second visual interactive interface, further comprising:
writing the target ID and the corresponding code submission information into a storage file as historical data;
after the submitting command is executed and the client hook is triggered to verify the code submitting information and obtain a verification result, the method further comprises the following steps:
if the verification result is verification failure, acquiring a failure reason returned by the client hook;
positioning a problem node according to the failure reason, and receiving modification submission information corresponding to the problem node;
according to the modified submission information, replacing the attribute value corresponding to the problem node in the historical data to obtain modified code submission information;
and repeatedly executing the execution submission command, and triggering a client hook to verify the code submission information to obtain a verification result.
7. The node.js-based code submission method of claim 1, wherein the verifying the code submission information to obtain a verification result includes:
acquiring a preset regular expression corresponding to the code submission information template based on the code submission information template;
and carrying out format verification on the code submission information by adopting the preset regular expression to obtain a verification result.
8. Js-based code submission apparatus, comprising:
the first visual interface output module is used for executing the node.js script and outputting a first visual interactive interface; wherein a plurality of selectable workitem IDs are displayed in the first visual interactive interface;
the target work item ID receiving module is used for receiving the ID of the target work item according to the selection instruction triggered by the first visual interactive interface;
the data receiving module is used for receiving code submission information corresponding to the ID of the target work item and the target code;
the verification module is used for executing the submission command and triggering the client hook at the same time so as to verify the code submission information to obtain a verification result;
and the code submitting module is used for successfully submitting the target code to the code management system if the verification result is that the verification is passed.
9. A computer arrangement comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the node.
10. A computer storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the node.
CN202011354694.0A 2020-11-26 2020-11-26 Js-based code submission method, device, computer equipment and storage medium Pending CN112435007A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011354694.0A CN112435007A (en) 2020-11-26 2020-11-26 Js-based code submission method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011354694.0A CN112435007A (en) 2020-11-26 2020-11-26 Js-based code submission method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112435007A true CN112435007A (en) 2021-03-02

Family

ID=74697916

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011354694.0A Pending CN112435007A (en) 2020-11-26 2020-11-26 Js-based code submission method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112435007A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114397927A (en) * 2021-12-21 2022-04-26 无锡新辉龙科技有限公司 Heater adjusting method and handset

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095681A (en) * 2016-06-14 2016-11-09 深圳市彬讯科技有限公司 A kind of SVN integrated JSHint code detection method and system thereof
CN109284225A (en) * 2018-08-22 2019-01-29 深圳点猫科技有限公司 A kind of quality determining method and electronic equipment of multi-person synergy exploitation programming code
CN111031005A (en) * 2019-11-22 2020-04-17 上海景域文化传播股份有限公司 Js-based reverse proxy server and reverse proxy method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095681A (en) * 2016-06-14 2016-11-09 深圳市彬讯科技有限公司 A kind of SVN integrated JSHint code detection method and system thereof
CN109284225A (en) * 2018-08-22 2019-01-29 深圳点猫科技有限公司 A kind of quality determining method and electronic equipment of multi-person synergy exploitation programming code
CN111031005A (en) * 2019-11-22 2020-04-17 上海景域文化传播股份有限公司 Js-based reverse proxy server and reverse proxy method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114397927A (en) * 2021-12-21 2022-04-26 无锡新辉龙科技有限公司 Heater adjusting method and handset
CN114397927B (en) * 2021-12-21 2023-05-26 无锡新辉龙科技有限公司 Heater adjusting method and handheld machine

Similar Documents

Publication Publication Date Title
CN109087054B (en) Collaborative office data stream processing method, device, computer equipment and storage medium
CN110209650B (en) Data normalization and migration method and device, computer equipment and storage medium
US7937455B2 (en) Methods and systems for modifying nodes in a cluster environment
CN109308285A (en) Database script management method, device, computer equipment and storage medium
CA3131079A1 (en) Test case generation method and device, computer equipment and storage medium
US9892019B2 (en) Use case driven stepping component automation framework
CN110764998A (en) Data comparison method, device and equipment based on Django framework and storage medium
CN111931471A (en) Form collection method and device, electronic equipment and storage medium
CN110597714A (en) Kafka message testing method and device, computer equipment and storage medium
CN115617780A (en) Data import method, device, equipment and storage medium
CN111708971A (en) Page configuration method and device, computer equipment and storage medium
CN112435007A (en) Js-based code submission method, device, computer equipment and storage medium
CN113505057A (en) Configuration baseline management tool
CN112416350A (en) View page construction method and device, computer equipment and storage medium
CN112215015A (en) Translation text revision method, translation text revision device, computer equipment and storage medium
CN113094251A (en) Embedded system testing method and device, computer equipment and storage medium
CN115934129A (en) Software project updating method and device, computer equipment and storage medium
CN115185821A (en) Version labeling method, system, equipment and storage medium in program test
CN110597874B (en) Data analysis model creation method and device, computer equipment and storage medium
CN115061698A (en) Method, apparatus, device and medium for constructing local development environment
CN110327626B (en) Virtual server creation method and device
CN113918594A (en) Method and device for generating structured query statement and computer equipment
JP2023000907A (en) Source code correction support device and source code correction support method
WO2021234019A1 (en) Database management methods and associated apparatus
CN113064698A (en) Method for providing product environment and corresponding device, system, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination