Disclosure of Invention
The application relates to a technique for production configuration reflow during software release.
According to a first aspect of the present application, there is provided a method of producing a configuration reflow, comprising:
acquiring all production configurations from production configuration equipment;
comparing the obtained production configuration with a local configuration in a distribution branch on a local configuration device to check whether there is a difference, wherein:
if a difference exists, synchronizing the difference to the local configuration in the publishing branch, and then merging the local configuration in the publishing branch to a local configuration in a primary branch on the local configuration device.
According to a second aspect of the present application, there is provided a publishing platform for production configuration reflow, comprising:
a timed task processor configured to:
acquiring all production configurations from production configuration equipment;
comparing the obtained production configuration with a local configuration in a distribution branch on a local configuration device to check whether there is a difference, wherein:
if a discrepancy exists, then the discrepancy is synchronized to the local configuration in the publishing branch.
According to a third aspect of the present application, there is provided a local configuration device for production configuration reflow, configured to:
when the timed task handler in the publishing platform completes the differential synchronization as described in the second aspect, the local configuration in the publishing branch is merged to the local configuration in the main branch.
According to a fourth aspect of the present application, there is provided a production configuration device for production configuration reflow, configured to:
sending all production configurations of itself to the timed task processor in accordance with a request issued from the timed task processor in the publishing platform as described in the second aspect, and
the production configuration is updated according to the local configuration received from the primary branch published by the local configuration device.
According to a fourth aspect of the present application, there is provided a computer readable storage medium having stored thereon instructions that, when executed, cause a machine to perform the method of the first aspect.
According to a fifth aspect of the present application, there is provided a computer system comprising means for performing the method of the first aspect.
Part of the capacity of the application is developed in an environment center project, and part of the function is realized in the project subsequently.
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Detailed Description
Before proceeding to review aspects of the present application, a few terms will be introduced to facilitate understanding by the skilled artisan.
GIT: a system for managing data versions is an open-source distributed version control system which can effectively process the version management of very small to very large projects at high speed.
Configuring a reflow: refers to the operation of writing the configuration in the production environment to a local store.
Resolving conflicts: the method refers to the situation that the same configuration is adopted, a plurality of branches are respectively changed, and one version needs to be manually selected for merging when merging is carried out.
Production environment: refers to the real environment provided for use by the user.
In order to make the objects, technical solutions and advantages of the present invention more apparent after understanding the meanings of the above-mentioned terms, the present invention will be described in further detail below with reference to the accompanying drawings by way of examples.
First, an exemplary production environment for the present application is shown in FIG. 1. As shown in fig. 1, the production environment includes a publishing platform 110, a local configuration device 120, and a production configuration device 130. The publishing platform 110, local configuration device 120, production configuration device 130 may be comprised of computing devices such as personal computers, servers, clients, mobile devices (e.g., cell phones, personal digital assistants, tablets, etc.), and various other computing devices. Data communication between the devices is performed over a network, which includes various types of wired and wireless networks, including but not limited to the internet, local area networks, WIFI, WLAN, cellular communication networks (GPRS, CDMA, 2G/3G/4G/5G cellular networks), satellite communication networks, and so forth. Through the data communication network, the publishing platform 110, the local configuration device 120, and the production configuration device 130 may communicate various data with each other to achieve configuration synchronization.
Specifically, the main functions of the publishing platform 110 are to perform configuration reflow, merging of configurations between branches, data synchronization between configurations, publishing configurations, and the like. The functions of the local configuration device 120 are: the target configuration is stored and managed locally, which in the context of the present application is stored in the GIT library of the local environment, but it should be understood that other databases may be used in the solution of the present application. The production configuration device 130 may be one or more devices distributed throughout the production environment and storing configurations of the operations of the production environment, with each production configuration device 130 maintaining a corresponding configuration.
With an understanding of the example production environment of the present application, the basic flow of the scheme of the present application for production configuration reflow is described in detail in connection with the production environment. First, the basic environmental configuration and basic flow of the present invention are summarized to facilitate a general understanding of the schemes by those skilled in the art, so as to facilitate a general concept by those skilled in the art. For ease of understanding in this embodiment, the GIT file system is used as an example environment for illustration, but it should be understood that the file system is not limited to GIT, and other configuration file systems may be used in the embodiments of the present application. For better description, we will refer to the configuration stored on the local configuration device 120 as the "local configuration" and the configuration stored on the production configuration device 130 as the "production configuration" in order to distinguish the two. Subsequently, a branch, for example, named "release _ config" and a branch, for example, named "master", are created in the GIT file system on the local configuration device 120, respectively. The purpose of this "publish" branch is to always keep pace with the production configuration at the various production configuration devices 130. The role of the "main" branch is to keep the local configuration up to date (i.e. to achieve the purpose of production configuration reflow) by merging the production configuration from the multiple production branches with the local configuration, and to optionally publish the local configuration after the production configuration reflow is completed. It should be understood that the names of the branches may be changed according to the needs of the developer, and are not limited thereto. In addition, a timed task handler is provided on the publishing platform 110 to trigger execution of the configuration reflow process, for example, every 5 minutes, so as to always keep the local configuration up to date. The timing may be adjusted according to the service scenario. Also, when the developer needs to immediately release the latest configuration, a function of manually activating the timed task processor to execute the configuration reflow flow may be provided.
Referring now to FIG. 2, a basic flow for implementing production configuration reflow in accordance with one embodiment of the present application will be described in detail.
First, in step 1, the flow of production configuration reflow is automatically performed by the timed task processor every five minutes. Of course, the timed task handler may also be manually activated to initiate the flow of production configuration reflow when desired by the developer.
In step 2, the timed task handler requests that its production configuration be obtained from production configuration device 130. The acquired production configuration may be the entire production configuration or a modified production configuration. In step 2.1, the production configuration device 130 returns its production configuration to the timed task handler upon request.
In a preferred embodiment, if there is configuration data in the production configuration obtained in step 2 that is not compatible with the format of the local configuration on the local configuration device 120, the production configuration may be first format-converted according to the format of the local configuration (step 3).
At step 4, the timed task processor compares the production configuration with the local configuration in the release branch on the local configuration device 120, which retains the previous production configuration obtained in the flow of the previous production configuration reflow, and by this comparison, finds the differences in the current production configuration and the previous production configuration, and synchronizes all the differences into the configuration of the release branch. The differential synchronization means that the change in the production configuration is synchronized to the newly added content, the updated content and the deleted content in the local configuration of the release branch in the process of the reflux of the production configuration so as to ensure that the local configuration of the release branch is consistent with the content of the production configuration all the time. Optionally, step 4.1 may be provided to feed back an indication to the timed task processor whether the differential synchronisation was successful. In addition, if there is no difference between the old and new production configurations, the subsequent steps 5-9 need not be performed, but rather a reflow process as shown in fig. 3 is performed.
In step 5, after the difference synchronization is completed, the released local configuration is merged into the local configuration of the main branch, wherein two scenarios exist, namely no conflict of production configuration change and conflict of production configuration change. When there is a configuration conflict in the merger (step 7), after initiating a merge request (step 6), sending a conflict message to a configured principal (owner), the principal resolving the conflict (step 7.1), initiating a merge request again after the conflict is resolved (step 7.2), and finally completing the merger (step 8). When there is no change in production configuration or no conflict in production configuration changes, the merge can be completed directly (steps 9 and 9) after the merge request is initiated (step 8.1). The specific reflow process for the scene will be described in detail in fig. 4 and 5, respectively. The reflow process of the production arrangement has been completed so far. After finishing the reflow, the developer may start preparing to publish the latest local configuration of the main branch into the production environment, which is done as follows:
at step 10, preparation for a distribution configuration is started.
In step 11, it is necessary to check again whether the release branch differs from the current latest production configuration in preparation for release. If there is a difference, the production configuration on the production configuration device 130 is changed again during execution of the present configuration reflow, and therefore, the release is terminated. Only if there is no difference can the following steps be continued. At this time, the local configuration of the main branch is the latest content, and the publishing platform 110 may obtain the latest content from the main branch when performing configuration publishing, and then publish the configuration to the production environment. In this way, the production configuration is prevented from being changed during the distribution process.
The publishing platform 110 requests its native configuration from the primary branch at step 12 and receives the native configuration sent from the primary branch at step 12.1.
At step 13, the publishing platform 110 publishes the local configuration of the primary branch containing the latest configuration content into the production environment.
At this point, the publication flow is also complete, step 14.
The basic flow of the present application for implementing production configuration reflow is described in the above flow. It is to be understood that the flow is a comprehensive description of the scheme for producing configuration reflow, and not all of the flow is necessary. For example, when the processing speed of steps 1-10 is fast enough, the production configuration on the production configuration device 130 is less likely to be changed again, and therefore, the operation of checking again whether there is a difference between the local configuration of the release branch and the production configuration in step 11 can be omitted.
On the other hand, as described above, there may be a plurality of said production configuration devices 130, in which case, at step 4, the local configuration in the distribution branch may be compared with each production configuration from the plurality of production configuration devices 130, respectively, and the compared differences are aggregated into an overall difference to be merged into the main branch.
After describing the basic flow of the configuration reflow, there are three reflow scenarios for the configuration reflow mentioned in the above flow, and the following method flows are given in conjunction with fig. 3-4, respectively (note that the flows occur in chronological order from left to right):
production configuration no change scenario (see fig. 3):
1. at this time, the production environment is not changed, that is, no change is found in the comparison between the obtained production configuration and the local configuration in the release branch in step 4, and at this time, the timed task processor does not need to flow the configuration back to the release branch;
2. the main branch normally changes the configuration in the development process, for example, changing k to 1 to k to 2;
3. the method can operate according to a normal configuration publishing flow, the k in the local configuration of the main branch is 2 and is published into the production environment, and the production configuration equipment updates the production configuration according to the local configuration in the main branch received from the local configuration equipment;
4. the timed task processor then ensures that the local configuration in the release branch is consistent with the production configuration by synchronizing the production configuration in the production environment to the release branch.
Production configuration change conflict free scenario (see fig. 4):
1. such a scenario may have a production configuration change, which requires the change of the production configuration to be returned to the local configuration. For example, two original production configurations are k-1 and v-2, respectively, and the production configuration is changed into k-2 and v-2.
2. The local main branch also has configuration change k being 1 and v being 3, because the modified configuration content is different, and the changes on both sides will not have merge conflict.
3. At this time, the timing task processor compares the configuration of the issue branch with the difference of the production configuration to trigger configuration reflux, and synchronizes the production configuration k to 2 and v to 2 to the issue branch, so that the configuration value of the issue branch becomes k to 2 and v to 2.
4. And after the timed task processor finishes configuration reflux, a branch merging request is initiated, and the configuration of the issued branch is merged into the main branch, so that the latest local configuration k of the main branch is 2, and v is 3.
5. When the distribution platform 110 distributes the configuration, the local configuration of the main branch is distributed to the production environment, and the production configuration is changed to k 2 and v 3.
6. And the timed task processor finds that the production configuration is changed again, and returns the difference change to the issuing branch, so that the local configuration of the timed task processor is changed to k-2 and v-3, and the whole configuration returning work is completed.
Production configuration change has conflicting scenarios (see FIG. 5):
1. in the production configuration device 130, if the production configuration is manually changed, k is changed from 1 to 2.
2. The main branch also changes the local configuration from k 1 to k 3 due to normal development needs.
3. And the timed task processor finds that the production configuration is changed by comparing the production configuration with the local configuration in the release branch, triggers the configuration reflux to reflux k-2 to the release branch, and changes the local configuration of the release branch to k-2.
4. The merging of the issuing branch with the main branch is initiated after the issuing platform 110 completes the configuration reflow, and since the k values in the two local configurations are 2 and 3, respectively, a merge conflict occurs. After the conflict occurs, the publishing platform 110 may send a message to the configuration principal to allow the configuration principal to resolve the conflict. When there is a merge conflict in the local configuration device 120, the associated configuration principal may select one of the current conflicting values k-2 or k-3 as the merged value. After conflict resolution, the configuration principal initiates the merge again, eventually merging the local configuration of the issuing branch to the local configuration of the main branch.
5. Assuming that the value after the conflict resolution is k is 3 (the configuration administrator selects 3 as the value of k), when the publishing platform 110 publishes the configuration, it publishes the local configuration k is 3 to the production environment, and then the production configuration device updates its production configuration k to 3 according to the local configuration received from the main branch published by the local configuration device, thereby completing the whole configuration reflow and publishing process. Based on the above detailed description of the flow, it can be understood that the present solution has at least the following advantages:
1) the problem of production failure caused by releasing wrong configuration to a production environment due to errors caused by human factors is solved. By the scheme, the configuration change of the production environment can be ensured to be synchronized to the local configuration in time.
2) Through the Git version management capability of local configuration, the configuration of the production environment and the configuration of local development are well combined, so that the aim that the latest and most complete configuration is saved by the local configuration of the main branch is achieved.
3) A mechanism for ensuring synchronization of a local release branch and production configuration of the Git system is innovatively used, and the production configuration can be effectively subjected to coding management. The merging of branches can be conveniently carried out through coding management, the configuration of the issuing branch can be indirectly taken as production configuration, and meanwhile, the capacity of coding management is achieved.
4) The comparison between the configuration of the distribution branch and the production configuration can judge whether the production configuration has changed behavior, and the change is synchronized to the local configuration by the timing task processor every 5 minutes (the time can be configured according to the business scene).
5) After the production configuration reflow and the local configuration development change are completed, the latest configuration can be released to the production environment by using the release platform, that is, the release of the production environment configuration can be completed on the basis of the configuration reflow.
6) A set of mechanism is innovatively used for solving the problem of merging the scenes in the configuration backflow process and the local configuration normal development process, and three solutions for merging the scenes are provided.
While various embodiments have been described above, it should be understood that they have been presented by way of example only, and not limitation. Persons skilled in the relevant art(s) will recognize that various changes may be made in form and detail without departing from the spirit and scope of the invention, as defined by the appended claims. Thus, the breadth and scope of the present invention disclosed herein should not be limited by any of the above-described exemplary embodiments, but should be defined only in accordance with the following claims and their equivalents.