CN117785270A - Version delivery information checking method and device, processor and electronic equipment - Google Patents

Version delivery information checking method and device, processor and electronic equipment Download PDF

Info

Publication number
CN117785270A
CN117785270A CN202311828491.4A CN202311828491A CN117785270A CN 117785270 A CN117785270 A CN 117785270A CN 202311828491 A CN202311828491 A CN 202311828491A CN 117785270 A CN117785270 A CN 117785270A
Authority
CN
China
Prior art keywords
version
target
code
identifier
branch
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
CN202311828491.4A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202311828491.4A priority Critical patent/CN117785270A/en
Publication of CN117785270A publication Critical patent/CN117785270A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a method and a device for verifying version delivery information, a processor and electronic equipment. The method relates to the field of software development, and comprises the following steps: receiving version delivery information; determining whether a determination result of the branch position exists in the target code; if the determined result is that the target code has a branch position, determining a branch item corresponding to the branch position; determining a preset identifier corresponding to the branch item; and determining the verification result of the version delivery information according to the target identifier and the preset identifier. The invention solves the technical problem that in the related art, when the code detection is carried out on the delivered code, whether the delivered code has an error or inconsistent code is difficult to quickly detect.

Description

Version delivery information checking method and device, processor and electronic equipment
Technical Field
The present invention relates to the field of software development, and in particular, to a method and apparatus for verifying version delivery information, a processor, and an electronic device.
Background
The version control system (Git) is one of the distributed version control systems currently in wide use, and has efficient branch management, powerful merge function and wide community support, and thus is widely used in many software development projects. However, even under the mature version control system of Git, there are still some potential problems. One of which is the consistency and integrity of code delivery. In the software development process, developers need to deliver codes to target users or systems in time so as to ensure the normal operation and maintenance of the software. However, due to human carelessness, communication problems, or other factors, a code miss-delivery situation may occur, i.e., some altered code is not properly delivered. Therefore, in detecting the code of the delivered code, it may be difficult to quickly detect whether there is an error or inconsistent code in the delivered code.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a processor and electronic equipment for verifying version delivery information, which at least solve the technical problem that in the related art, when a delivered code is detected, whether the delivered code has an error or inconsistent code is difficult to quickly detect.
According to an aspect of the embodiment of the present invention, there is provided a method for verifying version delivery information, including: receiving version delivery information, wherein the version delivery information comprises target codes of target versions, the version annotation information of the target versions comprises branch positions corresponding to change items and target identifiers corresponding to the change items, and the change items are items, in which the codes corresponding to the target versions are changed compared with the codes corresponding to the last version; determining whether a determination result of the branch position exists in the target code; determining a branch item corresponding to the branch position when the determination result is that the branch position exists in the target code; determining a preset identifier corresponding to the branch item; and determining the verification result of the version delivery information according to the target identifier and the preset identifier.
Optionally, after the determining whether the determination result of the branch position exists in the object code, the determining further includes: and obtaining a code incomplete detection result in the version delivery information under the condition that the determined result is the result of the branch position in the target code.
Optionally, the determining the verification result of the version delivery information according to the target identifier and the predetermined identifier includes: comparing the target identifier with the preset identifier to obtain a comparison result; and obtaining a checking result of the error code in the version delivery information under the condition that the comparison result is that the target identifier is inconsistent with the preset identifier.
Optionally, after obtaining the verification result of the error code in the version delivery information when the comparison result is that the target identifier is inconsistent with the predetermined identifier, the method further includes: determining a branch error item for which the target identifier does not correspond to the predetermined identifier, and a branch error location corresponding to the branch error item; and sending code error information to a first terminal, wherein the first terminal carries the branch error item, the branch error position, and the target identifier and the preset identifier.
Optionally, after comparing the target identifier with the predetermined identifier to obtain a comparison result, the method further includes: and under the condition that the comparison result is that the target identifier is consistent with the preset identifier, detecting the code integrity of the target code to obtain an integrity detection result of the target code.
Optionally, after comparing the target identifier with the predetermined identifier to obtain a comparison result, the method further includes: transmitting the target code to a second terminal when the comparison result is that the target identifier is consistent with the predetermined identifier; receiving and responding to a version rollback instruction sent by the second terminal, and determining a last version code corresponding to the target code; and sending the last version code to the second terminal.
Optionally, after receiving the version delivery information, the method further includes: when the version delivery information comprises a plurality of version label information corresponding to the plurality of version delivery information respectively comprises a last version number corresponding to the version label information, determining a plurality of comparison version delivery information with the same last version number corresponding to the version label information from the plurality of version delivery information; and determining the difference between the plurality of comparison version delivery information according to the target identifiers respectively corresponding to the plurality of comparison version delivery information.
According to an aspect of an embodiment of the present invention, there is provided a device for detecting version delivery information, including: the system comprises a receiving module, a receiving module and a processing module, wherein the receiving module is used for receiving version delivery information, the version delivery information comprises target codes of target versions, the version annotation information of the target versions comprises branch positions corresponding to change items and target identifiers corresponding to the change items, and the change items are items in which the codes corresponding to the target versions are changed compared with the codes corresponding to the last version; the first determining module is used for determining whether a determination result of the branch position exists in the target code; a second determining module, configured to determine a branch item corresponding to the branch position when the determination result is that the branch position exists in the object code; a third determining module, configured to determine a predetermined identifier corresponding to the branch item; and a fourth determining module, configured to determine a verification result of the version delivery information according to the target identifier and the predetermined identifier.
According to an aspect of an embodiment of the present invention, there is provided a processor, configured to execute a program, where the program executes the method according to any one of the preceding claims.
According to an aspect of an embodiment of the present invention, there is provided an electronic device including one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of the above.
In the embodiment of the invention, version delivery information is received, wherein the version delivery information comprises target codes of target versions, version marking information of the target versions comprises branch positions corresponding to change items and target identifiers corresponding to the change items, and the change items are items in which codes corresponding to the target versions are changed compared with codes corresponding to the last version. And determining whether a determination result of the branch position exists in the target code, and determining a branch item corresponding to the branch position and a predetermined identifier corresponding to the branch item under the condition that the determination result is the result of the branch position in the target code, so that the aim of determining the test result of the version delivery information according to the target identifier and the predetermined identifier is fulfilled. The branch positions corresponding to the change items are included in the version annotation information, and can be used for developers to quickly position the branch positions to perform the works such as code detection and optimization. Moreover, by comparing the target identifier of the change item with the predetermined identifier of the branch item, whether the delivered version is consistent with the expected code version can be verified, errors of the version are avoided, whether the target code in the delivered version delivery information is consistent can be detected quickly and efficiently by a developer, and further the technical problem that in the related art, when the delivered code is detected, whether the error or inconsistent code exists in the delivered code is difficult to detect quickly is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application, illustrate and explain the application and are not to be construed as limiting the application. In the drawings:
FIG. 1 is a flow chart of a method of detecting version delivery information provided in accordance with an embodiment of the present application;
FIG. 2 is a flow chart of a build code delivery process provided by an alternative embodiment of the present invention;
FIG. 3 is a block diagram of a detection device for version delivery information provided according to an embodiment of the present application;
fig. 4 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that, related information (including, but not limited to, user equipment information, user personal information, etc.) and data (including, but not limited to, data for presentation, analyzed data, etc.) related to the present disclosure are information and data authorized by a user or sufficiently authorized by each party, where the collection, use, and processing of related data is required to comply with related laws and regulations and standards of a related region.
The present invention will be described with reference to preferred implementation steps, and fig. 1 is a flowchart of a method for detecting version delivery information according to an embodiment of the present application, as shown in fig. 1, and includes the following steps:
step S101, receiving version delivery information, wherein the version delivery information comprises target codes of target versions, version marking information of the target versions, the version marking information comprises branch positions corresponding to change items and target identifiers corresponding to the change items, and the change items are items in which the codes corresponding to the target versions are changed compared with the codes corresponding to the last version;
in step S101 of this application, the version delivery information may be a code written for a certain project by a developer and other related information of the code, and may be delivery information for delivering a code version after passing a normal test, where the delivery information includes a target code corresponding to a target version of the project and version marking information corresponding to the target version, and the version marking information includes a branch position corresponding to a change item for modifying a code of a previous version, and a content of modifying the code corresponding to the change item for modifying the code, where the content of modifying the code is a target identifier. By receiving the version delivery information, the efficiency of version management can be improved, so that a developer can conveniently carry out version control and code management, change items of a target version and corresponding target codes can be rapidly positioned, and the working efficiency is improved.
Step S102, determining whether a determination result of a branch position exists in the target code;
in step S102 of this application, the target code of the target version included in the version delivery information is determined, and in the process of executing this step, a determination result of determining whether a branch position exists in the target code may be performed in a predetermined manner, where the determination result may include that a corresponding branch position exists in the target code or that a corresponding branch position does not exist in the target code, by a certain computer execution statement.
It should be noted that, by determining whether the determination result of the branch position exists in the target code, the developer can quickly check the branch condition to which the branch position belongs and whether the code corresponding to the branch accords with the modification expectation, and can quickly locate the branch position to perform the operations of code detection, optimization and the like.
Step S103, when the determined result is the result of the branch position in the target code, determining a branch item corresponding to the branch position;
in step S103 of the application, the branching item may refer to a code segment that determines a match with a branching statement position in the target code, such as: when writing the target code, supposing that the branch item corresponding to the branch position exists in the written code statement is an incoming call, that is, when determining that the corresponding branch position exists in the target code in the determination result, determining the branch item corresponding to the branch position according to the condition judgment of the branch position, for example: the condition judgment can be carried out by judging a plurality of preset keywords such as a condition judgment statement of the branch position and then determining the branch item corresponding to the judgment.
It should be noted that, by determining the branch item corresponding to the branch position, the modification position, modification content, and writing logic of the code of the target code can be more clearly understood, so that the readability and maintainability of the code are improved to a certain extent.
Step S104, determining a predetermined identifier corresponding to the branch item;
in step S104 of the application, the predetermined identifier may be the actual modification content of the target code corresponding to the branch item corresponding to the branch position, for example, at the branch position where the target code modified by the developer is located, on the branch item corresponding to the branch position where the target code is located: for the application scenario of the above steps, it is assumed that there is a code library of version control (Git), and it is assumed that on a certain branch, a developer has submitted code three times recently, and each submission corresponds to an identifier, that is, a hash value, which may be a unique identifier for identifying and distinguishing different branch items, for example, a number, a letter, a character string, or the like, that is, a hash value corresponding to the branch. In this step, the predetermined identifier is determined, which facilitates the developer to quickly locate and understand the relevant part of the code modification, enhancing the searchability and maintainability of the code to some extent.
Step S105, determining the verification result of the version delivery information according to the target identifier and the preset identifier.
In step S101 of the application, the target identifier corresponding to the change item and the predetermined identifier corresponding to the branch item may be compared, and a corresponding comparison result may be determined, where the comparison result is a delivery result of whether the version delivery information received in the previous step is delivered or not, and in this step, the delivery result may be a verification result of determining the version delivery information by detecting a difference between the target identifier and the predetermined identifier.
It should be noted that, by checking the target identifier and the predetermined identifier, it is not only possible to verify whether the version delivered is the same as the expected version, avoiding the version from being wrong, but also possible to perform the rollback operation by the checking result, if a problem is found, it is possible to timely return the version to modify, avoiding unnecessary influence on the project.
Through the steps, version delivery information is received, wherein the version delivery information comprises target codes of target versions, version marking information of the target versions comprises branch positions corresponding to change items and target identifiers corresponding to the change items, and the change items are items, in which the codes corresponding to the target versions are changed compared with the codes corresponding to the last version. And determining whether a determination result of the branch position exists in the target code, and determining a branch item corresponding to the branch position and a predetermined identifier corresponding to the branch item under the condition that the determination result is the result of the branch position in the target code, so that the aim of determining the test result of the version delivery information according to the target identifier and the predetermined identifier is fulfilled. The branch positions corresponding to the change items are included in the version annotation information, and can be used for developers to quickly position the branch positions to perform the works such as code detection and optimization. Moreover, by comparing the target identifier of the change item with the preset identifier of the branch item, whether the delivered version is consistent with the expected code version can be verified, errors of the version are avoided, rollback operation can be performed through the detection result, if a problem is found, the version can be returned in time for modification, and to a certain extent, a developer can quickly and efficiently detect whether the target code in the delivered version delivery information is consistent, so that the technical problem that in the related art, when the delivered code is detected, whether the delivered code is wrong or inconsistent is difficult to quickly detect is solved.
As an alternative embodiment, after determining whether there is a determination result of the branch position in the object code, the method further includes: and under the condition that the determined result is the result of the target code and the branch position does not exist, obtaining a detection result of incomplete code in the version delivery information.
In this embodiment, in the case of determining the branch position, there may be a missing or incomplete code in the target code, which may be caused by an error or omission occurring when the developer merges the branches or submits the code, and in this case, a verification result of the incomplete code in the version delivery information is obtained, that is, there is a missing or incomplete portion in the target code.
It should be noted that, by determining the incomplete code verification result in the version delivery information, the incomplete code part can be conveniently and timely checked for a developer, so as to ensure that the code in the re-delivered version is complete and reliable, and to a certain extent, the condition of inconsistent code version or operation error caused by missing or incomplete code is avoided.
As an alternative embodiment, determining the verification result of the version delivery information based on the target identifier and the predetermined identifier includes: comparing the target identifier with a preset identifier to obtain a comparison result; and if the comparison result is that the target identifier is inconsistent with the preset identifier, obtaining a check result of the error code in the version delivery information.
In this embodiment, before determining the verification result of the version delivery information, the target identifier corresponding to the change item and the predetermined identifier corresponding to the branch item need to be compared, and if the obtained comparison result is that the target identifier is consistent with the predetermined identifier, it is indicated that the version delivery information is correct and complete, that is, the verification result is a passing result; if the obtained comparison result target identifier is inconsistent with the preset identifier, the fact that the version delivery information has wrong delivery information is indicated, and the fact that errors occur is further determined, wherein the error conditions may include other error conditions such as version number errors, code file missing, code file content errors and the like, namely, the checking result is a failed result.
By comparing the target identifier with the preset identifier, a developer can timely find and repair errors in version delivery information, the efficiency of software development is improved, and better software experience is provided for users, so that the users can use and develop secondarily.
As an alternative embodiment, after obtaining the verification result that the error code exists in the version delivery information when the comparison result is that the target identifier is inconsistent with the predetermined identifier, the method further includes: determining a branch error item of which the target identifier is inconsistent with the predetermined identifier, and a branch error location corresponding to the branch error item; and sending code error information to the first terminal, wherein the first terminal carries a branch error item, a branch error position, a target identifier and a preset identifier.
In this embodiment, after determining that the error code exists in the version delivery information, it is further required to determine a target identifier corresponding to the change item and a branch error item inconsistent with a predetermined identifier corresponding to the branch item, where the branch error item may refer to a portion where the target identifier is not matched with the predetermined identifier, and may be an inconsistent branch error item caused by a lack of mismatch. The first terminal at this time may be a developer, or may be a processing terminal for the developer to process the code, which is not limited herein, and may be set in a customized manner according to a specific scenario and application.
It should be noted that, through the determined branch error item and the branch error position corresponding to the branch error item, accurate and detailed positioning is provided for the code error information to a certain extent, so that the first terminal can process the error information more quickly, and the time and effort cost of manually checking errors by a developer are reduced.
As an alternative embodiment, comparing the target identifier with the predetermined identifier, after obtaining the comparison result, further includes: and under the condition that the comparison result is that the target identifier is consistent with the preset identifier, performing code integrity detection on the target code to obtain an integrity detection result of the target code.
In this embodiment, according to the description of the previous step, in addition to the case that the comparison result is that the target identifier is inconsistent with the predetermined identifier, the case that the target identifier is consistent with the predetermined identifier, that is, the target identifier is identical to the predetermined identifier, is consistent with expectations, in which case the integrity of the code may be detected on the target code, to obtain a corresponding integrity detection result.
It should be noted that, by detecting the integrity of the target code, to a certain extent, possible errors or potential problems in the target code can be found and corrected in time, so as to ensure the correctness and reliability of the target code, and meanwhile, the integrity pays the version marking information of the target version and the target code of the target version, which is beneficial to the high efficiency of code management in the software development process and improves the user experience.
As an alternative embodiment, comparing the target identifier with the predetermined identifier, after obtaining the comparison result, further includes: if the comparison result shows that the target identifier is consistent with the preset identifier, sending the target code to the second terminal; receiving and responding to a version back instruction sent by the second terminal, and determining a last version code corresponding to the target code; and transmitting the last version code to the second terminal.
In this embodiment, the second terminal may be a predetermined terminal for receiving the object code by the user, which is not limited herein, and is based on a customized setting according to a specific scenario and application.
For the above steps, based on the fact that the comparison result is that the target identifier is consistent with the predetermined identifier, the target code is sent to the second terminal, then the second terminal receives the target code which is verified that the target identifier is consistent with the predetermined identifier, that is, the code which passes through the integrity detection, and then the second terminal feeds back a version back instruction, and considers that the received target code is a code which meets the expectations and can be continuously put into production for use, therefore, the last version code corresponding to the target code is further determined, and the last version code is directly sent to the second terminal for use by the second terminal.
It should be noted that, by sending the target code under the condition that the target identifier is consistent with the predetermined identifier, and automatically performing version comparison and code sending, risks caused by manual operation can be reduced to a certain extent, so that developers can manage and control different versions of the code conveniently, meanwhile, the efficiency of updating and rollback of the code is improved, and time and energy are saved.
As an alternative embodiment, after receiving the version delivery information, the method further includes: when the version delivery information comprises a plurality of version label information corresponding to the plurality of version delivery information respectively comprises a last version number corresponding to the version label information, determining a plurality of comparison version delivery information with the same last version number corresponding to the version label information from the plurality of version delivery information; and determining the difference between the plurality of comparison version delivery information according to the target identifiers respectively corresponding to the plurality of comparison version delivery information.
In this embodiment, according to the received version delivery information, a plurality of version marking information may be extracted, where each version marking information includes a corresponding last version number. The table is used for determining a plurality of comparison version delivery information with the same version number from a plurality of version delivery information, and then according to target identifiers in the comparison version delivery information, differences among the comparison version delivery information can be determined, and possible differences comprise modification of codes, addition of new functions, repair of defects and the like, so that the change condition among each version can be known conveniently to a certain extent, and the software development process can be managed and controlled better.
Based on the foregoing embodiments and optional embodiments, an optional implementation is provided, and is specifically described below.
In the related art, when detecting a code of a delivered code, it is difficult to quickly detect whether there is an error or inconsistent code in the delivered code.
Version control is a critical task in the field of software development. It helps developers manage the evolution of code, collaborative development, track change history, and resolve code conflicts. The version control system Git is one of the distributed version control systems widely used at present, and has efficient branch management, powerful merging function and wide community support, so that the version control system Git is widely applied to many software development projects. The version control method based on the Git library has wide application prospect, and can be applied to various software development projects, whether personal projects or large team cooperation projects. The method can effectively improve the efficiency and quality of software development, reduce errors and inconsistencies caused by code delivery, and simultaneously is conveniently integrated with the existing Git library without modifying the existing code management flow and method in a large amount.
Based on this background, the method provided in the related art may cause missing code delivery due to human negligence, communication problem or other factors when a developer delivers a written code to a target user or system in a software development process, but it is difficult to quickly detect whether an error or inconsistent code exists in the delivered code when detecting the delivered code.
In view of this, an alternative embodiment of the present invention provides a method for verifying version delivery information, and an alternative embodiment of the present application is described in detail below.
S1, receiving version delivery information;
s2, determining that the version delivery information comprises a target code of a target version, and version marking information of the target version, wherein the version marking information comprises a branch position corresponding to a change item and a target identifier corresponding to the change item, and the change item is an item of which the code corresponding to the target version is changed compared with the code corresponding to the last version;
it should be noted that, the target code may be obtained after version compiling, or may be determined for version compiling, and the version marking information may include the target code and information corresponding to the target version of the code library, where the version marking information includes tag information, for example: the tag information may include a version store name, a branch name, a compiling date, a version type, and the like, such as abc_release_20230708_20230610_snapshot_0001, where abc is a store name, release_20230708 is a branch name, 20230614 represents a compiling date, and snapshot_0001 represents a version.
S3, determining whether a determination result of the branch position exists in the target code;
it should be noted that, when the determined result is that the target code has no branch position, a test result of incomplete code in the version delivery information is obtained, then a branch error item whose target identifier is inconsistent with the predetermined identifier and a branch error position corresponding to the branch error item are determined, and code error information is sent to a developer to remind the developer to process the code error information in time.
S4, determining a branch item corresponding to the branch position when the determined result is the result of the branch position in the target code;
s5, determining a preset identifier corresponding to the branch item, and comparing the target identifier with the preset identifier to obtain a comparison result;
it should be noted that the comparison results are divided into two cases: 1) Obtaining a checking result of error codes in the version delivery information under the condition that the comparison result is that the target identifier is inconsistent with the preset identifier; 2) And under the condition that the comparison result is that the target identifier is consistent with the preset identifier, performing code integrity detection on the target code to obtain an integrity detection result of the target code.
For the above steps, code may be pulled from the version store by using the Git command and switched to the branch specified by the tag (as with the branch term described above), for example:
git clone<repository_url>;
cd<repository_directory>;
git checkout<branch>;
based on the branch item and the change item in the previous step, determining a target identifier corresponding to the change item and a predetermined identifier corresponding to the branch item, further, comparing the submitted hash (with the target identifier) of the tag with the HEAD hash (with the predetermined identifier) of the branch by using the Git command, and checking whether an undelivered code exists. For example:
git diff<tag_commit_hash>HEAD;
further, if there is a discrepancy, indicating that there is an undelivered code, an undelivered code list may be generated based on the discrepancy and the user may be alerted to repackage and commit.
Based on the comparison result that the target identifier is consistent with the preset identifier, sending the target code to the target user, reminding the target user of receiving the verified target code, enabling the target user to prompt a version rollback instruction, namely executing rollback operation, further reminding a developer of determining a last version code corresponding to the target code, and resending the determined last version code to the target user for the target user to use the code.
For implementing the steps of the method described above, the steps may be implemented by using a flowchart of a code delivery process, and fig. 2 is a flowchart of a code delivery process provided in an alternative embodiment of the present invention, where the flowchart includes: a git warehouse, a continuous integration/continuous delivery platform (CI/CD platform), an article warehouse, a delivery article management system. The development stage is completed by a developer and the service code development and the source code pushing to the code repository. In the construction and deployment stage, a configuration manager configures a construction and deployment pipeline in a CI/CD platform and initiates execution pipeline operation, in the pipeline execution process, a label is marked on a git warehouse at the same time, the label is carried in the version marking information, the label comprises branches for packaging warehouse names, namely version delivery information, the version delivery information is generated into products, and the products are pushed to the product warehouse. And delivered to the delivery article management system after the test passes. The code detection platform acquires label information contained in the version marking information from the delivery product management, pulls a substitute code library according to the code library name and the branch name in the label, switches branches, and compares a branch head hash (with the preset identifier) with a label hash (with the target identifier) by adopting a file difference checking command statement (gitdiff) to obtain an incremental code list, so that the development of which codes are not delivered is reminded.
The git warehouse, the CI/CD platform, the product warehouse and the delivery product management system in the steps are described in detail:
GIT warehouse: a version control system for storing and managing code versions.
CI/CD platform: continuous integration and continuous delivery platform. And providing a software project code construction packaging and deployment delivery function. The configuration manager uses the platform to configure the pipeline and completes construction, deployment and delivery in the development of the software project.
Product warehouse: a server for storing and managing program products in the development of software projects is provided.
Delivery article management system: delivery artifacts, including code, build products, documents, etc., used in managing and tracking software development processes.
In the above procedure, the developer periodically checks the undelivered code:
1) A timed task or trigger is set to periodically perform the code consistency verification step of the delivery phase.
2) And automatically acquiring the latest delivery object and label information and comparing codes when each execution is performed.
3) If undelivered code exists, a reminder mechanism is triggered informing the developer to make the replenishment and delivery.
Code management may also be performed: in addition to verifying the consistency and integrity of the code through the tag, the invention also provides for obtaining version modified code information through the tag comparison of two versions to facilitate code management.
Such as: the code differences between two tags can be compared using the following commands:
gitdiff < tag 1> < tag 2>;
the command will compare the code differences between submissions corresponding to the two tags and display the file and content of the differences. Code modification information between versions, such as newly added, deleted and modified files and specific code line changes, can be obtained by comparing the labels.
This tag contrast functionality can be used in various scenarios of code management, such as:
1) Version change record: by comparing the labels of different versions, code changes between each version can be known, including new functions, bug fixes, performance optimizations, and the like. This helps developers and teams to understand the evolution and changes of the code.
2) Rollback operation: if a problem occurs in a certain version, a rollback to a previous version is required, and code differences between the rolled-back version and the target version can be checked by comparing labels, thereby helping to locate and solve the problem.
3) Code inspection: by comparing the labels, code examination can be performed to check the difference between the code submitted by the developer and the previous version, and code modification is ensured to meet the specification and the requirement.
The code information of version modification is obtained through comparing the labels, so that the efficiency and reliability of code management can be improved, a development team can be helped to better understand code change, track problems and conduct code examination.
The specific steps of the tag comparison are as follows:
1) The tag information is read from the delivery article management system.
2) And extracting the names of the code libraries in the labels and pulling.
3) And extracting the branch names in the labels, and switching the branches.
4) And acquiring the head hash value of the branch where the code library is located and the hash of the tag or the tag hash between the two versions.
5) The delta file between the two hashes is obtained using the gitdiff.
Based on what is depicted in fig. 2, and the foregoing method steps, the following problems can be solved:
(1) The problem of code missing delivery is solved: in the software development process, the situation that a developer forgets to deliver the code often occurs, so that the code version is inconsistent or incomplete. The invention aims to detect and remind a developer of undelivered codes through an automatic method so as to avoid risks and problems caused by missed delivery of the codes.
(2) Ensuring code consistency and integrity: by tagging the Git library at each version compilation and delivering the tag information with the code, the present invention ensures that the delivered code version is consistent with the version represented by the corresponding tag. Meanwhile, the consistency and the integrity of the code can be further verified by comparing the submitting hash of the label with the HEAD hash of the code library.
(3) The code management efficiency is improved: by providing a convenient version library pulling and branch switching mode and an automatic undelivered code detection mechanism, the invention can quickly and accurately discover undelivered codes and prompt developers to timely supplement and deliver. And by comparing the two version tag information, the code file modified by each version can be easily obtained. The developer can conveniently use the Git command and tool to conduct code management and maintenance, including version change checking, comparison difference checking, rollback operation checking and the like, which is helpful for improving the efficiency of code management and reducing errors and delays caused by manual missed judgment and negligence.
(4) Improvement of software development efficiency and quality: the technical method of the invention effectively manages and maintains the code change record, reduces confusion and errors of code submission and improves the efficiency and quality of software development. The developer can conveniently track version change records, quickly locate problems and ensure the reliability and stability of codes.
(5) The team cooperation and communication effect is improved: the technical method of the invention provides clear version control mechanism and label information, and is beneficial to collaboration and communication among team members. The developers can easily share the tag information, understand and track the code change, reduce the communication error and improve the collaboration effect of the team.
By the alternative embodiments, at least the following advantages can be achieved:
(1) Because the branch item is determined under the condition that the branch position exists in the target code, namely, the modification position, the modification content and the writing logic of the target code can be more clearly understood by determining the branch item corresponding to the branch position, the readability and the maintainability of the code are improved to a certain extent;
(2) Because the target identifier corresponds to the change item and the predetermined identifier corresponds to the branch item, namely, by checking the target identifier and the predetermined identifier, whether the version delivered is the expected version is consistent or not can be verified, errors of the version are avoided, rollback operation can be performed through a checking result, developers can timely find and repair the errors in version delivery information, efficiency of software development is improved, better software experience is provided for users, and convenience is brought to the users for use and secondary development;
(3) The incomplete code checking result in the version delivery information is determined under the condition that the branch position does not exist in the target code, namely, the incomplete code checking result in the version delivery information is determined, so that the incomplete code part can be conveniently checked in time for a developer, the complete and reliable code in the re-delivered version is ensured, and the condition of inconsistent code version or operation error caused by missing or incomplete code is avoided to a certain extent.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the various embodiments of the present invention.
According to an embodiment of the present invention, there is further provided an apparatus for implementing the method for detecting version delivery information, and fig. 3 is a block diagram of a structure of the apparatus for detecting version delivery information provided according to an embodiment of the present application, as shown in fig. 3, where the apparatus includes: the receiving module 301, the first determining module 302, the second determining module 303, the third determining module 304, and the fourth determining module 305 are described in detail below.
The receiving module 301 is configured to receive version delivery information, where the version delivery information includes a target code of a target version, version label information of the target version, the version label information includes a branch position corresponding to a change item, and a target identifier corresponding to the change item, and the change item is an item in which a code corresponding to the target version is changed compared with a code corresponding to a previous version; a first determining module 302, coupled to the receiving module 301, for determining whether a determination result of the branch position exists in the target code; a second determining module 303, coupled to the first determining module 302, for determining a branch item corresponding to the branch position when the determination result is that the branch position exists in the object code; a third determining module 304, connected to the second determining module 303, for determining a predetermined identifier corresponding to the branch item; a fourth determining module 305, coupled to the third determining module 304, for determining a verification result of the version delivery information according to the target identifier and the predetermined identifier.
Here, the receiving module 301, the first determining module 302, the second determining module 303, the third determining module 304, and the fourth determining module 305 correspond to steps S101 to S105 in the detection method of implementing version delivery information, and the plurality of modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to those disclosed in the foregoing embodiments.
The version delivery information detection device provided by the embodiment of the application receives the version delivery information, wherein the version delivery information comprises target codes of target versions, version marking information of the target versions, the version marking information comprises branch positions corresponding to change items and target identifiers corresponding to the change items, and the change items are items in which the codes corresponding to the target versions are changed compared with the codes corresponding to the last version. And determining whether a determination result of the branch position exists in the target code, and determining a branch item corresponding to the branch position and a predetermined identifier corresponding to the branch item under the condition that the determination result is the result of the branch position in the target code, so that the aim of determining the test result of the version delivery information according to the target identifier and the predetermined identifier is fulfilled. The branch positions corresponding to the change items are included in the version annotation information, and can be used for developers to quickly position the branch positions to perform the works such as code detection and optimization. Moreover, by comparing the target identifier of the change item with the preset identifier of the branch item, whether the delivered version is consistent with the expected code version can be verified, errors of the version are avoided, rollback operation can be performed through the detection result, if a problem is found, the version can be returned in time for modification, and to a certain extent, a developer can quickly and efficiently detect whether the target code in the delivered version delivery information is consistent, so that the technical problem that in the related art, when the delivered code is detected, whether the delivered code is wrong or inconsistent is difficult to quickly detect is solved.
The detecting device for version delivery information comprises a processor and a memory, wherein the modules are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one kernel parameters, and the technical problem that whether the delivered code has errors or inconsistent codes is difficult to quickly detect when the delivered code is detected in the related art is solved by adjusting the kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the invention provides a computer readable storage medium, on which a program is stored, which when executed by a processor, implements a method for detecting version delivery information.
The embodiment of the invention provides a processor which is used for running a program, wherein the program runs to execute a version delivery information detection method.
Fig. 4 is a schematic diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 4, the embodiment of the present invention provides an electronic device, where the device includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements the following steps when executing the program: receiving version delivery information, wherein the version delivery information comprises target codes of target versions, version marking information of the target versions comprises branch positions corresponding to change items and target identifiers corresponding to the change items, and the change items are items in which the codes corresponding to the target versions are changed compared with the codes corresponding to the last version; determining whether a determination result of the branch position exists in the target code; if the determined result is that the target code has a branch position, determining a branch item corresponding to the branch position; determining a preset identifier corresponding to the branch item; and determining the verification result of the version delivery information according to the target identifier and the preset identifier.
Optionally, after determining whether the determination result of the branch position exists in the object code, the method further includes: and under the condition that the determined result is the result of the target code and the branch position does not exist, obtaining a detection result of incomplete code in the version delivery information.
Optionally, determining the verification result of the version delivery information according to the target identifier and the predetermined identifier includes: comparing the target identifier with a preset identifier to obtain a comparison result; and if the comparison result is that the target identifier is inconsistent with the preset identifier, obtaining a check result of the error code in the version delivery information.
Optionally, after obtaining the verification result of the error code in the version delivery information when the comparison result is that the target identifier is inconsistent with the predetermined identifier, the method further includes: determining a branch error item of which the target identifier is inconsistent with the predetermined identifier, and a branch error location corresponding to the branch error item; and sending code error information to the first terminal, wherein the first terminal carries a branch error item, a branch error position, a target identifier and a preset identifier.
Optionally, comparing the target identifier with the predetermined identifier, and after obtaining the comparison result, further includes: and under the condition that the comparison result is that the target identifier is consistent with the preset identifier, performing code integrity detection on the target code to obtain an integrity detection result of the target code.
Optionally, comparing the target identifier with the predetermined identifier, and after obtaining the comparison result, further includes: if the comparison result shows that the target identifier is consistent with the preset identifier, sending the target code to the second terminal; receiving and responding to a version back instruction sent by the second terminal, and determining a last version code corresponding to the target code; and transmitting the last version code to the second terminal.
Optionally, after receiving the version delivery information, the method further includes: when the version delivery information comprises a plurality of version label information corresponding to the plurality of version delivery information respectively comprises a last version number corresponding to the version label information, determining a plurality of comparison version delivery information with the same last version number corresponding to the version label information from the plurality of version delivery information; and determining the difference between the plurality of comparison version delivery information according to the target identifiers respectively corresponding to the plurality of comparison version delivery information.
The device herein may be a server, PC, PAD, cell phone, etc.
The present application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with the method steps of: receiving version delivery information, wherein the version delivery information comprises target codes of target versions, version marking information of the target versions comprises branch positions corresponding to change items and target identifiers corresponding to the change items, and the change items are items in which the codes corresponding to the target versions are changed compared with the codes corresponding to the last version; determining whether a determination result of the branch position exists in the target code; if the determined result is that the target code has a branch position, determining a branch item corresponding to the branch position; determining a preset identifier corresponding to the branch item; and determining the verification result of the version delivery information according to the target identifier and the preset identifier.
Optionally, after determining whether the determination result of the branch position exists in the object code, the method further includes: and under the condition that the determined result is the result of the target code and the branch position does not exist, obtaining a detection result of incomplete code in the version delivery information.
Optionally, determining the verification result of the version delivery information according to the target identifier and the predetermined identifier includes: comparing the target identifier with a preset identifier to obtain a comparison result; and if the comparison result is that the target identifier is inconsistent with the preset identifier, obtaining a check result of the error code in the version delivery information.
Optionally, after obtaining the verification result of the error code in the version delivery information when the comparison result is that the target identifier is inconsistent with the predetermined identifier, the method further includes: determining a branch error item of which the target identifier is inconsistent with the predetermined identifier, and a branch error location corresponding to the branch error item; and sending code error information to the first terminal, wherein the first terminal carries a branch error item, a branch error position, a target identifier and a preset identifier.
Optionally, comparing the target identifier with the predetermined identifier, and after obtaining the comparison result, further includes: and under the condition that the comparison result is that the target identifier is consistent with the preset identifier, performing code integrity detection on the target code to obtain an integrity detection result of the target code.
Optionally, comparing the target identifier with the predetermined identifier, and after obtaining the comparison result, further includes: if the comparison result shows that the target identifier is consistent with the preset identifier, sending the target code to the second terminal; receiving and responding to a version back instruction sent by the second terminal, and determining a last version code corresponding to the target code; and transmitting the last version code to the second terminal.
Optionally, after receiving the version delivery information, the method further includes: when the version delivery information comprises a plurality of version label information corresponding to the plurality of version delivery information respectively comprises a last version number corresponding to the version label information, determining a plurality of comparison version delivery information with the same last version number corresponding to the version label information from the plurality of version delivery information; and determining the difference between the plurality of comparison version delivery information according to the target identifiers respectively corresponding to the plurality of comparison version delivery information. It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (10)

1. A method for verifying version delivery information, comprising:
receiving version delivery information, wherein the version delivery information comprises target codes of target versions, the version annotation information of the target versions comprises branch positions corresponding to change items and target identifiers corresponding to the change items, and the change items are items, in which the codes corresponding to the target versions are changed compared with the codes corresponding to the last version;
determining whether a determination result of the branch position exists in the target code;
determining a branch item corresponding to the branch position when the determination result is that the branch position exists in the target code;
determining a preset identifier corresponding to the branch item;
and determining the verification result of the version delivery information according to the target identifier and the preset identifier.
2. The method of claim 1, wherein after determining whether the determination of the branch location exists in the object code, further comprising:
and obtaining a code incomplete detection result in the version delivery information under the condition that the determined result is the result of the branch position in the target code.
3. The method of claim 1, wherein said determining a verification result of said version delivery information based on said target identifier and said predetermined identifier comprises:
comparing the target identifier with the preset identifier to obtain a comparison result;
and obtaining a checking result of the error code in the version delivery information under the condition that the comparison result is that the target identifier is inconsistent with the preset identifier.
4. The method according to claim 3, wherein, after obtaining the result of the verification that the error code exists in the version delivery information in the case that the comparison result is that the target identifier is not identical to the predetermined identifier, further comprising:
determining a branch error item for which the target identifier does not correspond to the predetermined identifier, and a branch error location corresponding to the branch error item;
and sending code error information to a first terminal, wherein the first terminal carries the branch error item, the branch error position, and the target identifier and the preset identifier.
5. A method according to claim 3, wherein said comparing said target identifier with said predetermined identifier, after which a comparison result is obtained, further comprises:
And under the condition that the comparison result is that the target identifier is consistent with the preset identifier, detecting the code integrity of the target code to obtain an integrity detection result of the target code.
6. A method according to claim 3, wherein said comparing said target identifier with said predetermined identifier, after which a comparison result is obtained, further comprises:
transmitting the target code to a second terminal when the comparison result is that the target identifier is consistent with the predetermined identifier;
receiving and responding to a version rollback instruction sent by the second terminal, and determining a last version code corresponding to the target code;
and sending the last version code to the second terminal.
7. The method according to any one of claims 1 to 6, further comprising, after receiving the version delivery information:
when the version delivery information comprises a plurality of version label information corresponding to the plurality of version delivery information respectively comprises a last version number corresponding to the version label information, determining a plurality of comparison version delivery information with the same last version number corresponding to the version label information from the plurality of version delivery information;
And determining the difference between the plurality of comparison version delivery information according to the target identifiers respectively corresponding to the plurality of comparison version delivery information.
8. A version delivery information detection apparatus, comprising:
the system comprises a receiving module, a receiving module and a processing module, wherein the receiving module is used for receiving version delivery information, the version delivery information comprises target codes of target versions, the version annotation information of the target versions comprises branch positions corresponding to change items and target identifiers corresponding to the change items, and the change items are items in which the codes corresponding to the target versions are changed compared with the codes corresponding to the last version;
the first determining module is used for determining whether a determination result of the branch position exists in the target code;
a second determining module, configured to determine a branch item corresponding to the branch position when the determination result is that the branch position exists in the object code;
a third determining module, configured to determine a predetermined identifier corresponding to the branch item;
and a fourth determining module, configured to determine a verification result of the version delivery information according to the target identifier and the predetermined identifier.
9. A processor for running a program, wherein the program when run performs the method of any one of claims 1 to 7.
10. An electronic device comprising one or more processors and memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-7.
CN202311828491.4A 2023-12-27 2023-12-27 Version delivery information checking method and device, processor and electronic equipment Pending CN117785270A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311828491.4A CN117785270A (en) 2023-12-27 2023-12-27 Version delivery information checking method and device, processor and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311828491.4A CN117785270A (en) 2023-12-27 2023-12-27 Version delivery information checking method and device, processor and electronic equipment

Publications (1)

Publication Number Publication Date
CN117785270A true CN117785270A (en) 2024-03-29

Family

ID=90383081

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311828491.4A Pending CN117785270A (en) 2023-12-27 2023-12-27 Version delivery information checking method and device, processor and electronic equipment

Country Status (1)

Country Link
CN (1) CN117785270A (en)

Similar Documents

Publication Publication Date Title
US10459695B2 (en) Correction of code errors using machine learning
US9372784B2 (en) Test system configuration method and system
US20170372247A1 (en) Methods, systems, and articles of manufacture for implementing software application development and releases
US9207933B2 (en) Identifying authors of changes between multiple versions of a file
US8473916B2 (en) Method and system for providing a testing framework
US8495564B2 (en) Automated merging in a software development environment
EP3265916B1 (en) A method for identifying a cause for a failure of a test
US20080086660A1 (en) Test data management
US9069902B2 (en) Software test automation
CN104407973A (en) Automatic unit test realizing method and device
CN107169000B (en) Static resource dissemination method and device
US11055078B2 (en) Systems and methods for deploying software products to environments
CN111694612A (en) Configuration checking method, device, computer system and storage medium
CN106681783A (en) Detection method and system for SVN code
CN111158730A (en) System updating method and device, electronic equipment and readable storage medium
CN113448862A (en) Software version testing method and device and computer equipment
CN112799718A (en) Enumerated document generation method and device, electronic equipment and storage medium
CN111813382A (en) Intangible asset management system and method
CN110865806A (en) Code processing method, device, server and storage medium
US20160085659A1 (en) Base Line for Code Analysis
CN110716804A (en) Method and device for automatically deleting useless resources, storage medium and electronic equipment
CN112069073A (en) Test case management method, terminal and storage medium
CN117785270A (en) Version delivery information checking method and device, processor and electronic equipment
CN112256365B (en) Method and terminal for automatically managing multi-language versions
CN113918162A (en) Front-end code automatic checking method based on centralized management mode

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