CN108563570B - Method for automatically storing code processing record, readable storage medium and electronic device - Google Patents

Method for automatically storing code processing record, readable storage medium and electronic device Download PDF

Info

Publication number
CN108563570B
CN108563570B CN201810319858.2A CN201810319858A CN108563570B CN 108563570 B CN108563570 B CN 108563570B CN 201810319858 A CN201810319858 A CN 201810319858A CN 108563570 B CN108563570 B CN 108563570B
Authority
CN
China
Prior art keywords
information
code
management tool
message
service
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.)
Active
Application number
CN201810319858.2A
Other languages
Chinese (zh)
Other versions
CN108563570A (en
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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201810319858.2A priority Critical patent/CN108563570B/en
Publication of CN108563570A publication Critical patent/CN108563570A/en
Application granted granted Critical
Publication of CN108563570B publication Critical patent/CN108563570B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method for automatically storing code submission processing records, which comprises the following steps: selecting a code warehouse in a code management tool, setting the type of a trigger event of the code warehouse, and setting an address for timely capturing a transmission service by information; receiving a trigger event associated with input of an operator, triggering a code warehouse, and sending a message containing code processing information to an information timely capturing and transmitting service through an address; processing the message; and submitting the processed message to a schedule management tool. The invention also relates to a related computer readable storage medium and a related electronic device.

Description

Method for automatically storing code processing record, readable storage medium and electronic device
Technical Field
The present invention relates to the field of computer software technologies, and in particular, to a method for automatically storing a code processing record, and a related computer-readable storage medium and an electronic device.
Background
In the process of software development, in order to facilitate managers to evaluate the dimensions such as the working condition and efficiency of developers, the developers are usually required to submit daily reports, weekly reports, even monthly reports or annual summaries to reflect the working conditions. However, in actual operation, the development of the program needs a lot of effort, so that the developer is free from considering report filling and submitting, when the project requirement is urgent, the situation is particularly obvious, and some other objective reasons may also cause that the report of the developer is not filled in time or is not filled in, or is not written in, etc. The result of this is that in the subsequent delivery process, the developer cannot recall the accurate data record, so that the finally summarized report cannot accurately reflect and measure the working condition of the developer, and meanwhile, the manager cannot accurately evaluate and measure the developer.
Therefore, there is an urgent need for a method capable of automatically collecting, processing, recording and presenting the work details of developers.
Disclosure of Invention
To overcome at least one aspect of the above problems, embodiments of the present invention provide a method of automatically storing a code processing record, a computer-readable storage medium, and an electronic device.
According to an aspect of the present invention, there is provided a method of automatically storing a code processing record, comprising the steps of:
selecting a code warehouse in a code management tool, setting the type of a trigger event of the code warehouse, and setting an address for timely capturing a transmission service by information;
receiving a trigger event associated with the input of an operator, triggering a code warehouse, and sending a message containing code processing information to information timely capturing and transmitting service through the address;
processing the message;
and submitting the processed message to a schedule management tool.
According to some embodiments, the method further comprises the following steps after setting the information and grabbing the address of the delivery service in time: and sending a network request to the set address for timely capturing and transmitting the service according to the set triggering event type through a code management tool.
According to some embodiments, the code repository is triggered by the triggering event to invoke information to grab the address of the delivery service in time.
According to some embodiments, processing the message comprises:
filtering information which does not need to be processed in the message; and
and converting the format of the filtered message.
According to some embodiments, converting the format of the filtered message includes converting the format output by the code management tool to a format acceptable to the schedule management tool.
According to some embodiments, submitting the processed message to the calendar management tool comprises:
converting the processed message into an object meeting the format requirement, wherein the object comprises the attribute information of the originally submitted information; and
and inserting the object into the corresponding position of the schedule management tool according to the attribute information.
According to some embodiments, the code management tool comprises a Gitlab application tool and the information crawling transfer service comprises a Webhook service.
According to some embodiments, the schedule management tool includes a google calendar.
According to another aspect of the present invention, there is provided a computer readable storage medium having stored thereon executable instructions which, when executed by a processor, may implement the steps of a method of processing records according to the automatically stored code of any of the above embodiments.
According to still another aspect of the present invention, there is provided an electronic apparatus, comprising:
a memory for storing executable instructions; and
a processor for executing executable instructions stored in the memory to implement the steps of the method of automatically storing code processing records according to any of the above embodiments.
Compared with the prior art, the invention has the following advantages: the trigger event type is set in the code management tool, so that a developer can be informed after performing specific operation on the code, code processing records are automatically stored, and the workload of the developer is greatly reduced; and the data can be more conveniently and intuitively checked and summarized by using the schedule management tool.
Drawings
Other objects and advantages of the present invention will become apparent from the following description of the invention which refers to the accompanying drawings, and may assist in a comprehensive understanding of the invention.
FIG. 1 is an overall flow diagram of a method of implementing a method of automatically storing code processing records according to an embodiment of the invention;
FIG. 2 is a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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, but 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.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. Unless defined otherwise, technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention belongs.
The invention provides a method for automatically storing a code processing record, which comprises the following steps according to the figure 1:
s101, selecting a code warehouse in a code management tool, setting the type of a trigger event of the code warehouse, and setting an address for timely capturing and transmitting information.
Git and Gitlab are widely used code management tools, and in particular Gitlab is widely deployed in internal servers of different companies. In Gitlab, a plurality of projects can be set up for an account, and in order to manage the codes, a code repository is set up for each project, and among these repositories, the repository that needs to track and record the codes is selected.
Then, setting the type of event that may trigger the repository in this repository, for example, in some possible embodiments, the type of event that triggers the repository may include: push events (Push events), Tag events (Tag events), issue events (Issues events), Comment events (Comment events), and Merge request events (Merge request events). Of course, the type of triggering event is not limited to the above-described events. Thus, when a user pushes content to the GitLab, a push event is triggered; when a user creates or deletes a tag in a GitLab, a tag event is triggered; when a user creates a new release or an existing release is updated, closed or reopened, a release event is triggered; when a user creates a new annotation, an annotation event is triggered; when a user is creating a new merge request, a merge request event is triggered. The other trigger events also have corresponding functions.
The event type of the trigger code warehouse is set, and an address of the information timely capturing and transmitting service is also required to be set, wherein the address of the information timely capturing and transmitting service is used for receiving the notice of the event. The information crawling and delivery service here may be webhook. The webhook function of Gitlab allows a specific service address to be set in a specific repository, which may be, for example, a URL, which is an acronym for Uniform Resource Locator (Uniform Resource Locator), and consists of two main parts: a protocol and a destination. The "protocol" section is used to illustrate the type of network resource. The most common of these is the hypertext transfer protocol (http), which means that it is an HTML document that is retrieved from a Web page (Web). Other protocols are gopher, ftp, telnet, etc. The "destination" may be a file name, directory name, or the name of a computer. The destination may be set to a service address here.
In some possible embodiments, http defines different methods for software to interact with a server, so that after an information timely capture and delivery service address is set, the gillab sends a network request to the set information timely capture and delivery service address according to the set trigger event type, so as to implement the function of the URL service. Generally, the network request includes two modes, one is based on a GET request mode, and the other is based on a POST request mode. As the name implies, the GET request mode is to acquire data from a server, and the POST request mode is to transmit data to the server. For the GET request mode, the client needs to submit data through the URL, the amount of transmitted data is only 1024 bytes at most, and the information sent by the GET request is sent in the clear text of the URL, and the parameters of the information are stored in the browser history or the web server, so that the information can generate potential safety hazards. And for the POST request mode, the transmission data volume is large and can even reach 2M, and no trace is left on a browser or a webpage server. Therefore, the POST request is certainly the best choice from the viewpoint of the size of the transfer data amount and the security of the information. Therefore, the network request may select a POST request.
Gitlab provides rich triggering events to count the developer's operations on a selected warehouse in as detail as possible, so that the developer's development effort can be evaluated from multiple dimensions. Meanwhile, the Webhook of the Gitlab and the URL of the received event are completely independent, and the function of the URL service is only needed to be realized, so that the whole realization is clearer and simpler.
S102, receiving a trigger event related to the input of an operator, triggering a code warehouse, and sending a message containing code processing information to information timely capturing and transmitting service through an address.
The event is received by the Gitlab in real time, and when the event arrives, the Gitlab first determines whether the event is a trigger event associated with the input of the operator, where the "trigger event associated with the input of the operator" is the trigger event mentioned in step S101, and is not limited to the above event types. Instead of a trigger event associated with the operator 'S input, the Gitlab discards it, and once this event is one of the types of trigger events that have been set in step S101, or else satisfies "associated with the operator' S input", the selected code repository is triggered. Among the many events, the most important is the code push event, which is also the most interesting event for developers. When the selected code warehouse is triggered, the Gitlab transmits the message containing the code submission information to the service corresponding to the address of the information timely capturing and transmitting service, namely transmits the message to the information timely capturing and transmitting service corresponding to the URL. In some possible embodiments, the event triggers the code repository to invoke the information to grab the address of the delivery service in time.
The submission information of the Gitlab is in a JSON format, and because the main stream programming languages support the JSON format, the familiar programming languages can be selected for subsequent processing and development. For example, developers familiar with Java can select Java for subsequent operations without being restricted by programming languages, thereby greatly improving the efficiency of project development.
And S103, processing the message.
The purpose of processing the message is to make the message concise and easy to read. Here, the message may be processed correspondingly inside the information timely capturing and transmitting service, or the message output from the information timely capturing and transmitting service may be processed through a subsequent processing program. In some possible embodiments, processing the message includes: filtering information which does not need to be processed in the message; and performing format conversion on the filtered message. The "information not requiring processing" herein refers to information unrelated to code processing, and may be information of the non-submitter himself or herself in some possible embodiments, and the processing of the message will be described in detail below by taking an example of filtering information of the non-submitter himself or herself. The message mainly contains the information of the submitter, but because the project is not processed by one person, the submitter may be mixed with the information of other non-submitters when submitting the information. Since the last presented submission record is about the submitter himself, it is necessary to filter out information of non-submitters himself. The commit field in the message records the submitted information in detail, including the content, address, timestamp of the information, name, mailbox and other attributes indicating the identity of the submitter, and in the commit field, the identity information of a specific user is recorded in an author field, so that only the commit array needs to be traversed, the author field belonging to the submitter is found, and the related information of the author field not belonging to the submitter himself in the array element is filtered. Of course, in some other embodiments, information of non-submitters themselves may not be filtered out, but rather, code processing records of an item are put together, and only information that is not relevant to the code processing needs to be filtered out.
Because data that Gitlab passes to services through Webhook is not easy to read, it needs to be processed. The Gitlab transfer data has a set of own rules, and the data processing is to convert the format specified by the Gitlab into a format easy to read, so that the reading is facilitated. Since data needs to be delivered to the schedule management tool, the format specified by Gitlab needs to be converted into a format that can be accepted by the schedule management tool. Because the commit field in the message records the submitted information in detail, it is only necessary to convert the commit field into a format that is acceptable to the calendar management tool. A typical git commit record is as follows:
Author:Try Git<try_git@github.com>
Date:Sat Oct 1008:30:002020-0500
Added cute octocat story
this submission record includes name information and time information of the submitter and is easy to read, so that in practice, the commit field is converted into a format similar to that easy to read, for example, a character string format.
The Webhook information is converted into the history of Git, so that the development personnel can conveniently consult the history, and the submitted information of non-submitters can be filtered out, so that the interference of redundant information can be avoided.
And S104, submitting the processed message to a schedule management tool.
The messages processed in the steps are submitted to a schedule management tool, so that the submitted records can be conveniently checked on the schedule management tool, and meanwhile, data can be induced on the schedule management tool. The Calendar management tool herein may be similar to, but not limited to, Google Calendar (Google Calendar) which provides easy-to-use application program interfaces for various programming languages.
The specific process of submitting processed messages to the schedule management tool is described below by taking google calendar as an example.
Because the added content in Google Calendar is defined as an event, if one wants to add a submission record to Google Calendar, it is necessary to add the submission record as a Google calenar event. In some possible embodiments, adding a commit record as a Google Call event may include the steps of: converting the processed message into an object meeting the format requirement, wherein the object comprises the time of originally submitting the message, the processed message and other attribute information; and then the object is inserted into the corresponding position of the calendar according to the attribute information, such as the time of submitting the message.
Google Calendar is a schedule management tool with wider application, provides an application program interface supporting a plurality of development languages, can well perform function docking and expansion, and displays code submission information in a Calendar mode, so that the query and reading efficiency of data can be obviously improved. The process records are submitted to the Google Calendar, and the data can be stored.
Based on the same inventive concept, as shown in fig. 2, the present invention further provides a computer-readable storage medium 201 having stored thereon executable instructions 202, wherein the executable instructions 202, when executed by a processor, may implement the steps of the method for automatically storing code processing records according to any of the above-mentioned embodiments.
Based on the same inventive concept, referring to fig. 3, the present invention further provides an electronic device 301, where the electronic device 301 includes:
a memory 310 for storing executable instructions 311; and
a processor 320 for executing executable instructions 311 stored in the memory 310 to implement the steps of the method of automatically storing code processing records as described in any of the above embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; 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; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (8)

1. A method for automatically storing a code processing record, comprising the steps of:
selecting a code warehouse in a code management tool, setting an event type for triggering the code warehouse, and setting an address for timely capturing transmission service by information;
receiving a trigger event associated with input of an operator, triggering the code warehouse, and sending a message containing code processing information to the information timely capturing and transmitting service through the address, wherein the code processing information comprises the work detail content of the operator;
processing the message; and
submitting the processed message to a schedule management tool;
wherein processing the message comprises:
filtering information which does not need to be processed in the message; and
and converting the format of the filtered message output by the code management tool into a format acceptable by the schedule management tool.
2. The method of claim 1, further comprising the following steps after setting the information to grab the address of the delivery service in time: and sending a network request to the set address for timely capturing and transmitting the service according to the set type of the trigger event through the code management tool.
3. The method of claim 1, wherein the address of the information-in-time crawling transfer service is invoked when the code repository is triggered by the triggering event.
4. The method of claim 1, wherein submitting the processed message to a calendar management tool comprises:
converting the processed message into an object meeting the format requirement, wherein the object comprises the attribute information of the originally submitted information; and
and inserting the object into a corresponding position of a schedule management tool according to the attribute information.
5. The method of claim 1, wherein the code management tool comprises a Gitlab application tool, and wherein the information crawling and transferring service comprises a Webhook service.
6. The method of claim 1, wherein the schedule management tool comprises a google calendar.
7. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, implement the steps of a method of automatically storing code processing records according to any of claims 1-6.
8. An electronic device, comprising:
a memory for storing executable instructions; and
a processor for executing executable instructions stored in the memory to implement the steps of the method of automatically storing code processing records according to any of claims 1-6.
CN201810319858.2A 2018-04-10 2018-04-10 Method for automatically storing code processing record, readable storage medium and electronic device Active CN108563570B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810319858.2A CN108563570B (en) 2018-04-10 2018-04-10 Method for automatically storing code processing record, readable storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810319858.2A CN108563570B (en) 2018-04-10 2018-04-10 Method for automatically storing code processing record, readable storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN108563570A CN108563570A (en) 2018-09-21
CN108563570B true CN108563570B (en) 2022-02-08

Family

ID=63534746

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810319858.2A Active CN108563570B (en) 2018-04-10 2018-04-10 Method for automatically storing code processing record, readable storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN108563570B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111326035B (en) * 2018-12-13 2022-11-22 腾讯科技(深圳)有限公司 Task synchronization method and remote teaching system
CN109976800A (en) * 2019-03-28 2019-07-05 北京字节跳动网络技术有限公司 Message informing method, device, equipment and storage medium based on Gitlab
CN110674035A (en) * 2019-09-12 2020-01-10 上海麦克风文化传媒有限公司 Automatic code scanning method, system, device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461671A (en) * 2014-12-05 2015-03-25 闻泰通讯股份有限公司 Method and system for periodically managing code modification report
CN107025112A (en) * 2017-04-10 2017-08-08 丹露成都网络技术有限公司 A kind of supervision and tracking based on git hooks and bug management tool

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150094150A1 (en) * 2013-09-30 2015-04-02 Zynga Inc. Operation of a browser-incompatible application within a browser
US10827036B2 (en) * 2016-09-19 2020-11-03 Palantir Technologies Inc. Version control machine

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461671A (en) * 2014-12-05 2015-03-25 闻泰通讯股份有限公司 Method and system for periodically managing code modification report
CN107025112A (en) * 2017-04-10 2017-08-08 丹露成都网络技术有限公司 A kind of supervision and tracking based on git hooks and bug management tool

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"使用Git webhook来展示项目提交记录";miracledan;《SegmentFault思否 https://segmentfault.com/a/1190000003803848》;20151008;第1-4页 *
miracledan."使用Git webhook来展示项目提交记录".《SegmentFault思否 https://segmentfault.com/a/1190000003803848》.2015,第1-4页. *

Also Published As

Publication number Publication date
CN108563570A (en) 2018-09-21

Similar Documents

Publication Publication Date Title
US7644351B1 (en) Data collection and processing system and methods
US10437907B2 (en) Link expansion service
CN101651707B (en) Method for automatically acquiring user behavior log of network
US8112406B2 (en) Method and apparatus for electronic data discovery
CN108563570B (en) Method for automatically storing code processing record, readable storage medium and electronic device
US8731998B2 (en) Three dimensional visual representation for identifying problems in monitored model oriented business processes
US20060069981A1 (en) Data processing systems and methods for automatic entry of user data into an application program
CN112822286B (en) Message pushing method and device
US20080215957A1 (en) Systems and methods for generating technical documentation from enterprise service-oriented architecture content
CN103077107A (en) Method and system for maintaining data
CN101127068B (en) Information processing system is unified information processing method
JP5286946B2 (en) Information processing apparatus, input information restoration method and restoration program
JP2005070835A (en) Test supporting program and test supporting method
JP4073536B2 (en) Securities information display device
US20060015755A1 (en) Data collector systems and methods
CA2428240A1 (en) System and method for interfacing a data processing system to a business-to-business integration system
CN115563423A (en) Data acquisition method and device, computer equipment and storage medium
CN114492358A (en) RPA and AI-based method, device, equipment and medium for processing pre-family notification document
KR20000024120A (en) Apparatus and method for processing a cyber civil appeals
JP5369826B2 (en) Schedule display method and program taking importance into account
CN114238024A (en) Timing diagram generation method and system
CN114328152A (en) Log recording method, device, equipment and medium
KR102668341B1 (en) Method for managing interface, interface governance system, and a storage medium storing a computer-executable program to manage the interface
US7590634B2 (en) Detection of inaccessible resources
KR102668339B1 (en) Method for managing interface, interface governance system, and a storage medium storing a computer-executable program to manage the interface

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
GR01 Patent grant
GR01 Patent grant