CN114860296A - Software continuous integration method, device and storage medium - Google Patents

Software continuous integration method, device and storage medium Download PDF

Info

Publication number
CN114860296A
CN114860296A CN202210285601.6A CN202210285601A CN114860296A CN 114860296 A CN114860296 A CN 114860296A CN 202210285601 A CN202210285601 A CN 202210285601A CN 114860296 A CN114860296 A CN 114860296A
Authority
CN
China
Prior art keywords
code
software
integration
historical
current
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
CN202210285601.6A
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.)
Beijing Shareit Information Technology Co Ltd
Original Assignee
Beijing Shareit Information 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 Beijing Shareit Information Technology Co Ltd filed Critical Beijing Shareit Information Technology Co Ltd
Priority to CN202210285601.6A priority Critical patent/CN114860296A/en
Publication of CN114860296A publication Critical patent/CN114860296A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure provides a software persistent integration method, apparatus, and storage medium. The method is performed by an integration platform, the method comprising: when the submitted current code is received, performing software integration on the current code to obtain a software integration result of the current code; acquiring a software integration result of a pre-stored historical code according to the version information of the designated historical code; comparing and analyzing the software integration result of the current code with the software integration result of the historical code to generate an analysis result; and outputting an analysis result. Because the software integration result of the historical code is stored in advance, the integration platform only needs to perform software integration once on the current code, and then the software integration result of the current code and the software integration result corresponding to the historical code can be automatically compared and analyzed, so that automatic analysis of code integration is realized, developers can find the problem caused by the code integration after the integration once, the problems can be repaired in time, and the integration delivery time can be shortened.

Description

Software continuous integration method, device and storage medium
Technical Field
The present disclosure relates to the field of software technologies, and in particular, to a method, an apparatus, and a storage medium for continuously integrating software.
Background
Continuous Integration (CI) is the delivery of a part of personal development of software to an integral part of the software. Members of a software development team often need to integrate their code writing tasks, usually at least once per day per member, meaning that multiple integrations may occur per day. The purpose of continuous integration is to find out the code integration error as early as possible, and avoid or reduce the code integration problem.
At present, only the condition factors of the integration are usually considered during each code integration, the problems of overlarge volume of an integrated software installation package and the like may exist after one integration is successful, and the problems can be discovered after multiple times of integration delivery, so that the development efficiency is low, and the integration delivery time is too long.
Disclosure of Invention
The embodiment of the disclosure provides a software continuous integration method, a device and a storage medium.
The technical scheme of the disclosure is realized as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a software persistent integration method, performed by an integration platform, the method including:
when a submitted current code is received, performing software integration on the current code to obtain a software integration result corresponding to the current code;
acquiring a software integration result corresponding to a pre-stored historical code according to version information of the specified historical code;
comparing and analyzing the software integration result corresponding to the current code with the software integration result corresponding to the historical code to generate an analysis result;
and outputting the analysis result.
In the above technical solution, the obtaining a software integration result corresponding to a pre-stored history code according to version information of a specified history code includes:
inquiring the submission identification of the historical code from a code warehouse according to the version information of the historical code;
and acquiring a software integration result corresponding to the historical code pre-stored in the code warehouse according to the submission identifier of the historical code.
In the above technical solution, the performing software integration on the current code to obtain a software integration result corresponding to the current code includes:
when the current code and a pre-designated code to be merged need to be merged, a merged code is generated according to the current code and the code to be merged; wherein the execution function of the current code is different from the execution function of the code to be merged;
compiling the merged code to obtain a compiling result of the merged code;
when the compiling result of the merged code indicates that the compiling is passed, acquiring a software integration result corresponding to the current code according to the compiling result of the merged code;
and when the compiling result of the combined code indicates that the compiling is not passed, acquiring a software integration result corresponding to the current code according to the compiling result obtained by compiling the current code.
In the above technical solution, the method further includes:
receiving identification information of the specified code to be merged, wherein the identification information is used for determining the storage position of the code to be merged in a code warehouse;
and acquiring the codes to be merged from the code warehouse according to the identification information of the codes to be merged.
In the above technical solution, the method further includes:
and storing the software integration result corresponding to the current code.
In the above technical solution, the method further includes:
and when the software integration result corresponding to the historical code is not stored in advance, performing software integration on the historical code to obtain the software integration result corresponding to the historical code.
In the above technical solution, the comparing and analyzing the software integration result corresponding to the current code and the software integration result corresponding to the historical code to generate an analysis result includes:
and comparing and analyzing the software integration result corresponding to the current code and the software integration result corresponding to the historical code according to preset code evaluation parameters to generate the analysis result.
In the above technical solution, the code evaluation parameter includes at least one of:
time consuming software integration;
volume of the software installation package;
an on-state parameter of resource obfuscation;
a first ordering parameter, wherein the first ordering parameter is used for determining the first N files in the incremental resource files, which are ordered according to the file sizes;
and a second sorting parameter, wherein the second sorting parameter is used for determining the first N files sorted according to the file sizes in the incremental program files, and N is a positive integer.
In the above technical solution, the method further includes:
determining whether the current code can be used for continuous delivery according to the analysis result.
According to a second aspect of embodiments of the present disclosure, there is provided a software persistent integration apparatus, the apparatus including:
the integration module is used for carrying out software integration on the current code when the submitted current code is received, and obtaining a software integration result corresponding to the current code;
the acquisition module is used for acquiring a pre-stored software integration result corresponding to the historical code according to the version information of the specified historical code;
the analysis module is used for comparing and analyzing the software integration result corresponding to the current code with the software integration result corresponding to the historical code to generate an analysis result;
and the output module is used for outputting the analysis result.
In the above technical solution, the obtaining module is specifically configured to:
inquiring the submission identification of the historical code from a code warehouse according to the version information of the historical code;
and acquiring a software integration result corresponding to the historical code pre-stored in the code warehouse according to the submission identifier of the historical code.
In the above technical solution, the integrated module is specifically configured to:
when the current code and a pre-designated code to be merged need to be merged, a merged code is generated according to the current code and the code to be merged; wherein the execution function of the current code is different from the execution function of the code to be merged;
compiling the merged code to obtain a compiling result of the merged code;
when the compiling result of the merged code indicates that the compiling is passed, acquiring a software integration result corresponding to the current code according to the compiling result of the merged code;
and when the compiling result of the combined code indicates that the compiling is not passed, acquiring a software integration result corresponding to the current code according to the compiling result obtained by compiling the current code.
In the above technical solution, the integration module is further configured to:
receiving identification information of the specified code to be merged, wherein the identification information is used for determining the storage position of the code to be merged in a code warehouse;
and acquiring the codes to be merged from the code warehouse according to the identification information of the codes to be merged.
In the above technical solution, the apparatus may further include:
and the storage module is used for storing the software integration result corresponding to the current code.
In the above technical solution, the integration module is further configured to:
and when the software integration result corresponding to the historical code is not stored in advance, performing software integration on the historical code to obtain the software integration result corresponding to the historical code.
In the above technical solution, the analysis module is specifically configured to:
and comparing and analyzing the software integration result corresponding to the current code and the software integration result corresponding to the historical code according to preset code evaluation parameters to generate the analysis result.
In the above technical solution, the code evaluation parameter includes at least one of:
time consuming software integration;
volume of the software installation package;
an on-state parameter of resource obfuscation;
a first ordering parameter, wherein the first ordering parameter is used for determining the first N files in the incremental resource files, which are ordered according to the file sizes;
and a second sorting parameter, wherein the second sorting parameter is used for determining the first N files sorted according to the file sizes in the incremental program files, and N is a positive integer.
In some embodiments, the apparatus may further comprise:
and the determining module is used for determining whether the current code can be used for continuous delivery according to the analysis result.
According to a third aspect of the embodiments of the present disclosure, there is provided a computer device, including a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the software persistent integration method according to any one of the first aspect when executing the program.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored, the computer program, when executed by a processor, implementing the steps of the software persistent integration method of any one of the first aspect.
The embodiment of the disclosure provides a software continuous integration method, a device and a storage medium, wherein the software continuous integration method is executed by an integration platform, and a software integration result of a current code is obtained by performing software integration on the current code when the submitted current code is received; acquiring a software integration result of a pre-stored historical code according to the version information of the designated historical code; comparing and analyzing the software integration result of the current code with the software integration result of the historical code to generate an analysis result; and outputting an analysis result. Because the software integration result corresponding to the historical code is stored in advance, the integration platform only needs to perform software integration on the current code once, the software integration result of the current code and the software integration result corresponding to the historical code can be automatically compared and analyzed, and the analysis result is output, so that automatic analysis of code integration is realized, developers can find the problem caused by the code integration after the integration once, the problems can be repaired in time, the development efficiency can be improved, and the integration delivery time is shortened.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a schematic flow chart diagram illustrating a method for continued integration of software in accordance with an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart diagram illustrating another method of software persistent integration according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart diagram illustrating yet another method for continued integration of software according to an embodiment of the present disclosure;
FIG. 4 is a flow diagram illustrating yet another method for persistent integration of software according to an embodiment of the present disclosure;
FIG. 5 is a schematic flow chart diagram illustrating yet another software persistent integration method according to an embodiment of the present disclosure;
FIG. 6 is a detailed flow diagram illustrating a method for persistent integration of software according to an embodiment of the present disclosure;
FIG. 7 is a block diagram illustrating a software persistent integration apparatus according to an embodiment of the present disclosure;
fig. 8 is a block diagram illustrating a configuration of a computer device according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with embodiments of the invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of embodiments of the invention, as detailed in the following claims.
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 embodiments of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms "first", "second", etc. may be used in embodiments of the present invention to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of embodiments of the present invention. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Fig. 1 is a schematic flow chart diagram illustrating a software persistent integration method according to an embodiment of the present disclosure. The software continuous integration method can be executed by an integration platform, the integration platform can be realized by a server, and the server can be an independent physical server, a server cluster or distributed system formed by a plurality of physical servers, and a cloud server.
Referring to fig. 1, a method for continuously integrating software provided by an embodiment of the present disclosure may include the following steps:
101, when receiving the submitted current code, performing software integration on the current code to obtain a software integration result corresponding to the current code.
After the developer completes the development of the current code of the specified function in the application program in the local development environment, the current code can be submitted to the integration platform.
The current code may be code that specifies a function in the application. An application may provide a number of functions, each of which may be implemented with corresponding code. The current code may be code for a new function in the application or code for updating an existing function in the application. Here, the existing function may be any one of the functions in the history version of the application program. Version iteration of the application program is realized by adding functions to the application program or updating the existing functions.
Specifically, when the integration platform receives the submitted current code, the current code can be integrated into the software code by Jenkins according to a preset script according to the current code and version information of the current code, and a software integration result corresponding to the current code is generated. The version information of the current code may include, but is not limited to: the version number of the application program to which the current code belongs, the snapshot version number of the current code, and the like.
Jenkins is an open source automation tool written in Java with plug-ins for persistent integration that can handle any type of build or persistent integration.
The software integration result corresponding to the current code may include: a current software installation package, current code evaluation data, wherein the current code evaluation data may include at least one of: the time consumed by current software integration, the volume of a current software installation package, the opening state parameter of current resource confusion, the file name of a current incremental resource, the file name of a current incremental program and the like.
In some embodiments, in step 101, when the submitted current code is received, it may be determined whether the current code is a code to be integrated, and when the current code is a code to be integrated, software integration is performed on the current code.
For example, it may be determined whether the current code is a code to be integrated according to whether a specified character string is added to the current code. Wherein the specified string may be added when the current code is submitted and used to indicate that the submitted current code needs to be integrated.
In some embodiments, in step 101, when the submitted current code is received, whether a code defect exists in the current code may be detected according to a preset rule; and when the current code has no code defects, performing software integration on the current code. Wherein the code defects include, but are not limited to: call errors, syntax errors, etc.
Therefore, the defect detection can be carried out on the codes to be integrated before the codes are integrated, so that developers can find and solve the code problems as early as possible, and the development efficiency can be improved.
102, acquiring a software integration result corresponding to a pre-stored history code according to the version information of the designated history code.
The history code is a code of an existing function in the history version of the application program.
It will be appreciated that the historical version of the application is a published version, and the historical version of the application to which the historical code belongs is lower than the current version of the application to which the current code belongs.
Here, the version information of the designated history code may include, but is not limited to: the version number of the application program to which the history code belongs, the snapshot version number of the history code, and the like. The designated historical code may be designated by a developer of the current code when submitting the current code, or may be designated by the integration platform among a plurality of historical codes, and is not specifically limited herein.
Here, the software integration result corresponding to the history code may be obtained by performing software integration on the history code when the history code is submitted via the integration platform, and may be stored in advance via the integration platform.
The software integration result corresponding to the history code may include: historical software installation packages, historical code evaluation data, wherein the historical code evaluation data may include at least one of: the time consumed by historical software integration, the volume of a historical software installation package, the starting state parameter of historical resource confusion, the file name of a historical incremental resource, the file name of a historical incremental program and the like.
Specifically, the integration platform may obtain a storage path of a software integration result corresponding to the history code according to the version information of the specified history code, and then obtain the software integration result corresponding to the history code according to the storage path.
And 103, comparing and analyzing the software integration result corresponding to the current code with the software integration result corresponding to the historical code to generate an analysis result.
Specifically, the current code evaluation data in the software integration result corresponding to the current code may be compared with the historical code evaluation data in the software integration result corresponding to the historical code, so as to obtain an analysis result.
And 104, outputting the analysis result.
Specifically, the analysis result may be sent to a relevant user terminal, such as a terminal of a developer of the current code. Here, the analysis result may be presented in a graph form at the user terminal.
The analysis result can be used to describe an influence result of the current code on the application program, such as a volume change of the software installation package.
The embodiment of the disclosure provides a software continuous integration method, which is executed by an integration platform, and performs software integration on a current code when the submitted current code is received to obtain a software integration result of the current code; acquiring a software integration result of a pre-stored historical code according to the version information of the designated historical code; comparing and analyzing the software integration result of the current code with the software integration result of the historical code to generate an analysis result; and outputting an analysis result. Because the software integration result corresponding to the historical code is stored in advance, the integration platform only needs to perform software integration on the current code once, the software integration result of the current code and the software integration result corresponding to the historical code can be automatically compared and analyzed, and the analysis result is output, so that automatic analysis of code integration is realized, developers can find the problem caused by the code integration after the integration once, the problems can be repaired in time, the development efficiency can be improved, and the integration delivery time is shortened.
In some embodiments, as shown in fig. 2, the obtaining, according to the version information of the designated history code in step 102, a software integration result corresponding to the history code stored in advance may include:
201, inquiring the submission identifier of the history code from a code warehouse according to the version information of the history code;
the code repository may be a data repository for storing and managing codes.
Here, the code repository may be a data repository for implementing code management by a special code management tool, and the code management tool may be a distributed version control system, such as Git, or a centralized version control system, such as svn, etc.
In addition, the code warehouse may be a data warehouse or the like that is built by a developer.
Here, in addition to the code, the code repository may also store a software integration result corresponding to the code, version information of the code, identification information of the code, and the like, where the identification information of the code, for example, a submission identification of the code.
Wherein the submitted identification of the code is a hash value generated according to the submitted code content. The Hash value may be generated by using a preset Hash Algorithm, such as SHA-1 Hash (Secure Hash Algorithm 1 ).
202, obtaining a software integration result corresponding to the historical code pre-stored in the code warehouse according to the submission identifier of the historical code.
Specifically, the integration platform may query, from the code repository, a software integration result corresponding to a pre-stored historical code according to the submission identifier of the historical code.
In the embodiment of the disclosure, since the software integration result corresponding to the historical code is pre-stored, the submission identifier of the historical code is queried according to the version information of the historical code, and the software integration result corresponding to the historical code is queried according to the submission identifier of the historical code, so that the integration platform does not need to perform software integration on the historical code any more, and only needs to perform software integration once on the current code, and the software integration result of the current code and the software integration result corresponding to the historical code can be automatically compared and analyzed, and the analysis efficiency can be effectively improved.
In some embodiments, as shown in fig. 3, the performing software integration on the current code in step 101 to obtain a software integration result corresponding to the current code may include:
301, when the current code needs to be merged with a pre-specified code to be merged, generating a merged code according to the current code and the code to be merged; wherein the execution function of the current code is different from the execution function of the code to be merged.
Here, the application version to which the pre-specified code to be merged belongs is the same as the application version to which the current code belongs. The pre-designated submission time of the code to be merged is earlier than the submission time of the current code.
Code that implements different functions in the same application may be represented as different branches. In an actual application program development process, each development project is often required to be completed by a plurality of developers together, so that the development projects are decomposed into different branches for development, and the different developers are responsible for the different branches of the software development project.
In this step, a temporary branch of merged code may be generated according to the code branch of the current code and the code branch of the code to be merged. For example: the current branch is feature _ commit, the branch that is expected to merge is devielop, and the generated temporary branch is: refs/changes/feature _ commit _ devielop _ tmp/feature _ commit.
And 302, compiling the merged code to obtain a compiling result of the merged code.
Independently compiling each temporary branch once and storing a compiling result, wherein the compiling result comprises: application installation packages, performance analysis files, and the like.
The merged code can be compiled through Jenkins, and a compiling result of the merged code is obtained.
In this embodiment, when the current code submitted by the developer needs to be merged with the specified code in the code library, the current code and the specified code to be merged may be merged, and the merged code is compiled to obtain a software integration result corresponding to the current code.
303, when the compiling result of the merged code indicates that the compiling is passed, acquiring a software integration result corresponding to the current code according to the compiling result of the merged code;
wherein, the compiling result of the merged code can be directly used as the software integration result of the current code.
304, when the compiling result of the merged code indicates that the compiling does not pass, acquiring a software integration result corresponding to the current code according to the compiling result obtained by compiling the current code.
Specifically, the current code may be compiled through Jenkins, and a compiling result of the current code is obtained. And when the compiling result of the current code indicates that the compiling is passed, taking the compiling result of the current code as the software integration result of the current code.
It should be noted that, when there is no code to be merged that is merged with the current code, the software integration result corresponding to the current code is obtained according to the compilation result obtained by compiling the current code.
It can be understood that, when the compiling result obtained by compiling the current code indicates that the current code fails, an error prompt is output to indicate that the software integration of the current code fails.
In the embodiment of the present disclosure, when the compiling result of the merged code indicates that the compiling is passed, according to the compiling result of the merged code, and when the compiling indicated by the merged code is not passed, according to the compiling result obtained by compiling the current code, the software integration result corresponding to the current code is obtained. Therefore, the code problem can be found as early as possible, the code quality can be ensured, and the development efficiency is improved in a large probability.
In some embodiments, as shown in fig. 4, the method may further include:
401, receiving identification information of the specified code to be merged, wherein the identification information is used for determining a storage location of the code to be merged in a code warehouse;
402, obtaining the code to be merged from the code warehouse according to the identification information of the code to be merged.
The identification information of the code to be merged may be a snapshot version number of the code to be merged.
In this embodiment, the submission identifier of the historical code may be queried from a code repository according to the identifier information of the code to be merged; and acquiring the codes to be merged from the code warehouse according to the submission identification of the historical codes.
In some embodiments, the method may further comprise:
and storing the software integration result corresponding to the current code.
In particular, a submission identification of the current code may be stored in association with a software integration result corresponding to the current code in a code repository. The submission identifier of the current code may be a hash value generated according to the information of the current code.
The information of the current code may include: version information of an application program to which the current code belongs and snapshot version information of the current code. The hash value may be generated by using a preset hash algorithm, such as SHA-1 hash.
In this embodiment, by storing the software integration result corresponding to the current code, the current code can be used as the history code after the application version to which the current code belongs is released. After software integration is carried out on the newly added code of the next version of the application program, comparison and analysis can be directly carried out on the newly added code corresponding to the historical code, so that the problem of the newly added code of the next version can be found as early as possible, and the development efficiency is improved.
In some embodiments, as shown in fig. 5, based on fig. 1, the method may further include:
and 105, when the software integration result corresponding to the historical code is not stored in advance, performing software integration on the historical code to obtain the software integration result corresponding to the historical code.
Specifically, the software integration is performed on the historical code in step 105, which may refer to the process of performing software integration on the current code in step 101, and is not described here again.
In this embodiment, in consideration of a situation that a software integration result corresponding to a history code may not be stored in advance, when the software integration result corresponding to the history code is not stored in advance, the integration and storage of the history code may be performed once, and the software integration result corresponding to the history code is compared and analyzed with a software integration result corresponding to a current code.
In some embodiments, the comparing and analyzing the software integration result corresponding to the current code and the software integration result corresponding to the historical code in step 103 to generate an analysis result may include:
and comparing and analyzing the software integration result corresponding to the current code and the software integration result corresponding to the historical code according to preset code evaluation parameters to generate the analysis result.
In some embodiments, the code evaluation parameter comprises at least one of:
time consuming software integration;
volume of the software installation package;
an on-state parameter of resource obfuscation;
a first ordering parameter, wherein the first ordering parameter is used for determining the first N files in the incremental resource files, which are ordered according to the file sizes;
and a second sorting parameter, wherein the second sorting parameter is used for determining the first N files sorted according to the file sizes in the incremental program files, and N is a positive integer.
The time consumed by software integration refers to the time consumed by one-time integration of codes.
The size of the software installation package can represent the size of a file of the software installation package to be reduced, and the size of the software installation package is larger and larger along with the version iteration of the application program.
Wherein the resource obfuscated on-state parameter is capable of characterizing whether to open resource obfuscation. The resource confusion is to confuse the resource name with the catalog, which is helpful to reduce the volume of the packet and also can improve the difficulty of reading the code after being decompiled.
In the embodiment of the disclosure, the analysis result is generated by comparing and analyzing the software integration result corresponding to the current code and the software integration result corresponding to the historical code according to the preset code evaluation parameter, so that developers can intuitively know the influence of the current code on the application program, find the problem caused by the code integration, and timely repair the problem, thereby improving the development efficiency and reducing the integration delivery time.
In some embodiments, the method may further comprise:
determining whether the current code can be used for continuous delivery according to the analysis result.
Wherein, Continuous Delivery (CD) is to deploy the code to the pre-production environment on the basis of Continuous integration.
In one example, the analysis results may be presented and delivery confirmation information for the current code received from the user; determining whether the current code can be used for continuous delivery according to the delivery confirmation information. The delivery confirmation information is used to indicate whether the current code can be used for sustained delivery.
In another example, it may be determined whether an increase in volume of the software installation package exceeds a preset value according to the analysis result, and when the increase in volume of the software installation package does not exceed the preset value, the current code is determined to be for continuous delivery; and when the volume of the software installation package increases by more than a preset value, determining that the current code cannot be used for continuous delivery.
Here, the volume of the software installation package is increased by: the difference between the volume of the software installation package after the current code integration and the volume of the software installation package after the historical code integration.
The software persistent integration method provided by the present disclosure will be further described with reference to specific embodiments.
Continuous integration and continuous delivery of mobile end applications is a difficult and time consuming process, and typically one integration and delivery needs to take into account test results, test environment, code integration, etc. The current continuous integration and continuous delivery only consider the condition factors of the current time, and the incremental comparison analysis with codes which are successfully constructed historically is lacked. For example, after one integration, there may be a problem of code merging failure, or a problem of excessive bag volume after integration, a problem of integration delivery too slow due to newly added codes, and a problem of application performance degradation due to newly added codes. However, in the existing methods, multiple integration deliveries are often needed to obtain the analysis result, which results in low development efficiency and long time consumption of the integration delivery.
The embodiment of the disclosure provides a software continuous integration method, which obtains nodes of a historical code by automatically analyzing submitted information of the code, analyzes whether integrated information of the historical code exists, and if the integrated information of the historical code exists, compares and analyzes the integrated information of the current code and the integrated information of the historical code after the integration of the current code is finished. The analysis result can be visually displayed for developers, the developers can obtain various influence analysis results of the current code on the application after one-time integrated delivery, and the problems can be timely repaired, so that the development efficiency is improved, and the integrated delivery time of the application is shortened.
As shown in fig. 6, an embodiment of the present disclosure provides a software persistent integration method, which may include the following steps:
step 1: the user initiates the integration of the current code once, and the integrated delivery system stores the current code information and starts to build automatically.
Wherein the current code information includes: an application version, a snapshot version of the current code.
When a user initiates an integrated delivery of code, it allows for the simultaneous provision of code branches that are desired to be merged. If a merge branch is provided, the system initiates a pre-compilation to analyze whether the submission normally passes without affecting the key performance. Otherwise, construction is started only for the current branch.
The pre-compiling process comprises the following steps:
1) the system generates a temporary branch according to the branch of the current code and the branch of the code to be merged by using the characteristics of the Git warehouse. Here, the Branch of the current code may be represented as refs/heads/{ Branch }, and the generated temporary Branch may be represented as: refs/changes/{ PreviewId }/{ Branch }.
For example: the current branch is feature _ commit, the branch that is expected to be merged is devielop, and the generated temporary branch is: refs/changes/feature _ commit _ devielop _ tmp/feature _ commit.
2) The system will compile once for each temporary branch independently.
The integrated payment system compiles each temporary branch independently and once respectively and stores compilation products, wherein the compilation products comprise: application installation packages, performance analysis files, and the like. The compilation product may be made as a result of software integration of the current code.
Step 2: the integrated delivery system acquires historical code information according to the specified application version or the specified code snapshot version.
Wherein the history code information includes: historical application version ID, snapshot version commit ID of the historical code.
Specifically, when the user provides information about the historical version that the user wishes to compare, such as a branch of the historical version or a tag of the historical version, the system obtains the commit id of the historical version according to the branch of the historical version or the tag of the historical version by using the characteristics of the Git warehouse, wherein the commit id of the historical version is calculated based on the SHA-1 hash of the submitted historical code content.
Illustratively, when a specified historical version label is given, a commit id of the unique identification of that historical version in the Git repository may be obtained, e.g., the commit id is: 521747298a3790fde1710f3aa2d03b55020575 aa.
Step 3: the integrated delivery system queries whether there is integrated information for the historical code. If the historical code information exists, acquiring the historical code integration result, and if the historical code information does not exist, executing one-time integration delivery according to the historical code information.
The integrated delivery system inquires whether integrated result information of the history codes exists. The integration result information of the history code may be queried according to the history application version ID or the commit ID of the history code. When the integration result of the historical code exists, acquiring the integration result of the historical code; and when the integration result of the historical code does not exist, initiating the integration of the historical code once.
In the embodiment, whether the integrated historical version exists in the system is searched through the historical version information acquired based on Step2, and if the integrated historical version exists, the integration result of the historical code (including an application installation package, a performance analysis file and the like) is acquired; when the information does not exist, the system acquires the commit Id in the historical version information and generates a temporary historical Branch refs/changes/commit Id/{ Branch }. And then compiled once independently using the temporal history branch.
Step 4: and when both the historical code integration result and the current code integration result can be obtained, analyzing the historical code integration result and the current code integration result, and returning the analysis results to the user to display the volume of the installation package and the integration time.
When the history code integration is not finished, continuously waiting; when the integration of the current code is not finished, continuously waiting; and when both the historical code integration result and the current code integration result can be obtained, analyzing the historical code integration result and the current code integration result and returning an analysis result.
Wherein, the returned analysis result comprises at least one of the following:
comparing the sizes of the application installation packages; the incremental files display the first 10 files according to the file size; whether resource confusion is on; whether duplicate files exist; whether a newly added unused resource file exists or not; the incremental program file displays the related application related information such as the first 10 files according to the size.
The software continuous integration method provided by the embodiment of the disclosure at least has the following beneficial effects:
(1) the time consumption of one-time integrated delivery is short, and the delivery speed is improved. The integrated delivery system automatically saves the integrated information of the historical code and the delivery outcome without multiple integrated deliveries.
(2) And the codes and the integrated product information are analyzed in advance, so that developers can repair the problems in time, and the development efficiency is improved.
Fig. 7 is a block diagram illustrating a configuration of a software persistent integration apparatus according to an embodiment of the present disclosure. Referring to fig. 7, the apparatus 700 may include: an integration module 710, an acquisition module 720, an analysis module 730, and an output module 740, wherein,
an integration module 710, configured to perform software integration on a submitted current code when the current code is received, and obtain a software integration result corresponding to the current code;
an obtaining module 720, configured to obtain a software integration result corresponding to a pre-stored history code according to version information of the specified history code;
the analysis module 730 is configured to compare and analyze the software integration result corresponding to the current code with the software integration result corresponding to the historical code to generate an analysis result;
and an output module 740, configured to output the analysis result.
In some embodiments, the obtaining module 720 is specifically configured to:
inquiring the submission identification of the historical code from a code warehouse according to the version information of the historical code;
and acquiring a software integration result corresponding to the historical code pre-stored in the code warehouse according to the submission identifier of the historical code.
In some embodiments, the integration module 710 is specifically configured to:
when the current code and a pre-designated code to be merged need to be merged, a merged code is generated according to the current code and the code to be merged; wherein the execution function of the current code is different from the execution function of the code to be merged;
compiling the merged code to obtain a compiling result of the merged code;
when the compiling result of the merged code indicates that the compiling is passed, acquiring a software integration result corresponding to the current code according to the compiling result of the merged code;
and when the compiling result of the combined code indicates that the compiling is not passed, acquiring a software integration result corresponding to the current code according to the compiling result obtained by compiling the current code.
In some embodiments, the integration module 710 is further configured to:
receiving identification information of the specified code to be merged, wherein the identification information is used for determining the storage position of the code to be merged in a code warehouse;
and acquiring the codes to be merged from the code warehouse according to the identification information of the codes to be merged.
In some embodiments, the apparatus may further comprise:
and the storage module is used for storing the software integration result corresponding to the current code.
In some embodiments, the integration module 710 is further configured to:
and when the software integration result corresponding to the historical code is not stored in advance, performing software integration on the historical code to obtain the software integration result corresponding to the historical code.
In some embodiments, the analysis module 730 is specifically configured to:
and comparing and analyzing the software integration result corresponding to the current code and the software integration result corresponding to the historical code according to preset code evaluation parameters to generate the analysis result.
In some embodiments, the code evaluation parameter comprises at least one of:
time consuming software integration;
volume of the software installation package;
an on-state parameter of resource obfuscation;
a first ordering parameter, wherein the first ordering parameter is used for determining the first N files in the incremental resource files, which are ordered according to the file sizes;
and a second sorting parameter, wherein the second sorting parameter is used for determining the first N files sorted according to the file sizes in the incremental program files, and N is a positive integer.
In some embodiments, the apparatus may further comprise:
and the determining module is used for determining whether the current code can be used for continuous delivery according to the analysis result.
It should be noted that: in the software persistent integration apparatus provided in the above embodiment, when the software persistent integration method is executed, only the division of the program modules is exemplified, and in practical applications, the processing distribution may be completed by different program modules according to needs, that is, the internal structure of the apparatus is divided into different program modules to complete all or part of the processing described above. In addition, the software persistent integration apparatus provided by the above embodiment and the software persistent integration method embodiment belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not described herein again.
An embodiment of the present disclosure further provides a computer device, including: the device comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the steps of continuous integration of software according to any one of the embodiments of the disclosure when executing the computer program.
Fig. 8 is a block diagram illustrating a structure of a computer device according to an embodiment of the present disclosure, where the computer device 800 illustrated in fig. 8 includes: at least one processor 801, memory 802, at least one network interface 803. The various components in the computer device 800 are coupled together by a bus system 804. It is understood that the bus system 804 is used to enable communications among the components. The bus system 804 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 804 in FIG. 8.
It will be appreciated that the memory 802 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory.
The memory 802 in the disclosed embodiments is used to store various types of data to support the operation of the computer device 800. Examples of such data include: any computer program for operating on computer device 800, such as executable program 8021, can be included in executable program 8021 for implementing methods of embodiments of the present disclosure.
The embodiments of the present disclosure also provide a computer-readable storage medium, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps in the software persistent integration described in any of the embodiments of the present disclosure are implemented.
It should be noted that the storage medium of the embodiments of the present disclosure may be implemented by any type of volatile or non-volatile storage device, or a combination thereof. The nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic Random Access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical Disc, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The storage media described in the embodiments of the present disclosure are intended to comprise, without being limited to, these and any other suitable types of memory.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of a unit is only one logical function division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Alternatively, the integrated unit of the present disclosure may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present disclosure may be embodied in the form of an application program, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods of the embodiments of the present disclosure. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The methods disclosed in the several method embodiments provided in this disclosure may be combined arbitrarily without conflict to arrive at new method embodiments.
Features disclosed in several of the product embodiments provided in this disclosure may be combined in any combination to yield new product embodiments without conflict.
The features disclosed in the several method or apparatus embodiments provided in this disclosure may be combined in any combination to arrive at a new method or apparatus embodiment without conflict.
The above is only a specific embodiment of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present disclosure, and shall be covered by the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (12)

1. A method for continuous integration of software, performed by an integration platform, the method comprising:
when a submitted current code is received, performing software integration on the current code to obtain a software integration result corresponding to the current code;
acquiring a software integration result corresponding to a pre-stored historical code according to version information of the specified historical code;
comparing and analyzing the software integration result corresponding to the current code with the software integration result corresponding to the historical code to generate an analysis result;
and outputting the analysis result.
2. The method according to claim 1, wherein the obtaining of the software integration result corresponding to the pre-stored history code according to the version information of the designated history code comprises:
inquiring the submission identification of the historical code from a code warehouse according to the version information of the historical code;
and acquiring a software integration result corresponding to the historical code pre-stored in the code warehouse according to the submission identifier of the historical code.
3. The method of claim 1, wherein the performing software integration on the current code to obtain a software integration result corresponding to the current code comprises:
when the current code and a pre-designated code to be merged need to be merged, a merged code is generated according to the current code and the code to be merged; wherein the execution function of the current code is different from the execution function of the code to be merged;
compiling the merged code to obtain a compiling result of the merged code;
when the compiling result of the merged code indicates that the compiling is passed, acquiring a software integration result corresponding to the current code according to the compiling result of the merged code;
and when the compiling result of the combined code indicates that the compiling is not passed, acquiring a software integration result corresponding to the current code according to the compiling result obtained by compiling the current code.
4. The method of claim 3, further comprising:
receiving identification information of the specified code to be merged, wherein the identification information is used for determining the storage position of the code to be merged in a code warehouse;
and acquiring the codes to be merged from the code warehouse according to the identification information of the codes to be merged.
5. The method of claim 1, further comprising:
and storing the software integration result corresponding to the current code.
6. The method of claim 1, further comprising:
and when the software integration result corresponding to the historical code is not stored in advance, performing software integration on the historical code to obtain the software integration result corresponding to the historical code.
7. The method according to any one of claims 1 to 6, wherein the comparing and analyzing the software integration result corresponding to the current code and the software integration result corresponding to the historical code to generate an analysis result comprises:
and comparing and analyzing the software integration result corresponding to the current code and the software integration result corresponding to the historical code according to preset code evaluation parameters to generate the analysis result.
8. The method of claim 7, wherein the code evaluation parameter comprises at least one of:
time consuming software integration;
volume of the software installation package;
an on-state parameter of resource obfuscation;
a first ordering parameter, wherein the first ordering parameter is used for determining the first N files in the incremental resource files, which are ordered according to the file sizes;
and a second sorting parameter, wherein the second sorting parameter is used for determining the first N files sorted according to the file sizes in the incremental program files, and N is a positive integer.
9. The method of claim 8, further comprising:
determining whether the current code can be used for continuous delivery according to the analysis result.
10. A software persistent integration apparatus, the apparatus comprising:
the integration module is used for carrying out software integration on the current code when the submitted current code is received, and obtaining a software integration result corresponding to the current code;
the acquisition module is used for acquiring a pre-stored software integration result corresponding to the historical code according to the version information of the specified historical code;
the analysis module is used for comparing and analyzing the software integration result corresponding to the current code with the software integration result corresponding to the historical code to generate an analysis result;
and the output module is used for outputting the analysis result.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the software persistent integration method of any one of claims 1 to 9 when executing the program.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the software persistent integration method of any one of claims 1 to 9.
CN202210285601.6A 2022-03-22 2022-03-22 Software continuous integration method, device and storage medium Pending CN114860296A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210285601.6A CN114860296A (en) 2022-03-22 2022-03-22 Software continuous integration method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210285601.6A CN114860296A (en) 2022-03-22 2022-03-22 Software continuous integration method, device and storage medium

Publications (1)

Publication Number Publication Date
CN114860296A true CN114860296A (en) 2022-08-05

Family

ID=82627153

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210285601.6A Pending CN114860296A (en) 2022-03-22 2022-03-22 Software continuous integration method, device and storage medium

Country Status (1)

Country Link
CN (1) CN114860296A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115509544A (en) * 2022-11-22 2022-12-23 成都佰维存储科技有限公司 NVME continuous integration method and device, readable storage medium and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115509544A (en) * 2022-11-22 2022-12-23 成都佰维存储科技有限公司 NVME continuous integration method and device, readable storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN109032631B (en) Application program patch package obtaining method and device, computer equipment and storage medium
CN108614702B (en) Byte code optimization method and device
CN111158741B (en) Method and device for monitoring dependency relationship change of service module on third party class library
CN110597518B (en) Project construction method, apparatus, computer device and storage medium
US10614218B2 (en) Scan time reduction in application code security scanning
CN111967017A (en) Method and device for generating dependency relationship, terminal equipment and storage medium
JP2022100301A (en) Method for determining potential impact on computing device by software upgrade, computer program, and update recommendation computer server (recommendation of stability of software upgrade)
WO2022139952A1 (en) Detecting added functionality in open source package
CN112860312A (en) Method and device for detecting item dependency relationship change
CN114138281A (en) Compiling method, device, equipment and medium of software engineering
CN113901083A (en) Heterogeneous data source operation resource analysis positioning method and equipment based on multiple analyzers
CN114860296A (en) Software continuous integration method, device and storage medium
CN113495728A (en) Dependency relationship determination method, dependency relationship determination device, electronic equipment and medium
US9116714B2 (en) Methods and systems for file processing
JP2006178848A (en) Database system, computer executable method and program for database system, and method for updating indexing table in database system
CN114661423A (en) Cluster configuration detection method and device, computer equipment and storage medium
CN112000367B (en) Binary library file version compatibility identification method and device
CN110334031B (en) Memory allocation code detection method and device, computer equipment and storage medium
CN111782239A (en) Software packaging and source code version information acquisition method, device and storage medium
US9396239B2 (en) Compiling method, storage medium and compiling apparatus
CN116383021A (en) Software package performance testing method, system, computing device and readable storage medium
US20230281316A1 (en) On-demand application vulnerability scanning
US11256602B2 (en) Source code file retrieval
Borodin et al. Deterministic static analysis
CN114090514A (en) Log retrieval method and device for distributed system

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