CN113590182A - Method, system and storage medium for managing and controlling version risk based on Git - Google Patents

Method, system and storage medium for managing and controlling version risk based on Git Download PDF

Info

Publication number
CN113590182A
CN113590182A CN202110917663.XA CN202110917663A CN113590182A CN 113590182 A CN113590182 A CN 113590182A CN 202110917663 A CN202110917663 A CN 202110917663A CN 113590182 A CN113590182 A CN 113590182A
Authority
CN
China
Prior art keywords
module
git
codes
risk management
merging
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
CN202110917663.XA
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.)
Guangzhou Joiway Information Technology Co ltd
Original Assignee
Guangzhou Joiway 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 Guangzhou Joiway Information Technology Co ltd filed Critical Guangzhou Joiway Information Technology Co ltd
Priority to CN202110917663.XA priority Critical patent/CN113590182A/en
Publication of CN113590182A publication Critical patent/CN113590182A/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
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment

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 invention discloses a edition risk management control system based on Git, comprising: the Git command packaging module is used for packaging and assembling Git native commands for the service module to use; the business module is used for assembling and merging the full-flow information of the codes and collecting the information returned by the execution process; the configuration module is used for storing parameter configuration and providing query interfaces for other modules so as to avoid encoding sensitive account information onto a logic layer code; the deployment module is used for pulling the codes from the Git warehouse and deploying the codes to the docker; the log module is used for unifying the log printing formats in the system operation process; the mail module is used for sending a mail to inform a user of an operation result; and the expansion module is used for expanding whether the check code has submission which is missed in combination.

Description

Method, system and storage medium for managing and controlling version risk based on Git
Technical Field
The invention belongs to the technical field of internet, and relates to a method, a system and a storage medium for managing and controlling version risks based on Git.
Background
Git is an open-source distributed version control system for processing any small or large project swiftly and efficiently, and has the main functions of centrally managing code files, providing locking to avoid submitting conflicts of different users, providing comparison of source codes of different versions, and the like.
However, Git, as a universal version control tool, provides solutions to the problems of multiple versions, but for reasons of generality, it is difficult to completely fit and integrate with the continuous building system of the developer.
Disclosure of Invention
The invention aims to provide a method, a system and a storage medium for managing and controlling version risks based on Git, which have the characteristics of avoiding high-risk operations such as code conflict, forced combination and the like which may occur when developers carry out code combination and improving the quality of code management.
The technical scheme adopted by the invention is that a edition risk management control system based on Git comprises:
the Git command packaging module is used for packaging and assembling Git native commands for the service module to use;
the business module is used for assembling and merging the full-flow information of the codes and collecting the information returned by the execution process;
the configuration module is used for storing parameter configuration and providing query interfaces for other modules so as to avoid encoding sensitive account information onto a logic layer code;
the deployment module is used for pulling the codes from the Git warehouse and deploying the codes to the docker;
the log module is used for unifying the log printing formats in the system operation process;
the mail module is used for sending a mail to inform a user of an operation result;
and the extension module is used for referencing the mature interface to extend other functions.
The invention is also characterized in that:
a method for managing and controlling version risk based on Git is implemented according to the following steps:
step 1, a developer invokes a code merging process, and the code merging process is executed by a service module and a Git command encapsulation module: the risk management control system automatically clones a working cache path from Git for subsequent execution of inspection logic;
step 2, detection process, executed by the service module and the configuration module: respectively entering a development branch and a development trunk, acquiring respective latest submission record lists, and screening out submission records which are generated due to code combination and have no actual submission by controlling a-no-merge parameter of a Git log command in Git;
step 3, comparing the latest submission records of the development branches and the main trunk, and detecting whether the development branches contain all the submission records of the main trunk or not, otherwise, interrupting the operation;
and 4, if the detection is passed, carrying out a merging process: merging codes on the development branches to a main trunk, and collecting related information such as project names, development branch names, success or failure, target deployment environment and the like for subsequent flows to use;
and 5, if the combination is successful, the deployment module deploys: remotely calling a construction process in Jenkins, automatically packaging and deploying the project into a docker mirror image, starting the project into a container, and otherwise, returning error information;
and 6, nesting the version risk management control system into a Jenkins continuous integration tool, and providing the characteristics of batch operation and the convenience of graphical starting.
And (4) the input and output in the steps 1-6 are processed by a version risk management control system, and all sensitive information is shielded externally and printed.
The permission account is configured through a configuration file, the configuration file is stored in a Linux server, only a specific account is given to read permission, tampering is avoided, and leakage risks are reduced to the maximum extent.
A computer-readable storage medium comprising computer-executable instructions that, when executed by a computer system, perform a Git-based versioning risk management override method.
The invention has the beneficial effects that:
code management is performed by packaging a Git native command, tools integrating batch processing, conflict detection, automatic combination and user notification are provided, accuracy and convenience of code management of developers are improved, and learning cost is reduced by providing a graphical interface entry. A series of operations of merging codes are packaged through python, scattered operations are combined into a uniform entrance and a uniform flow, input and output of sensitive information are shielded, and convenience and concealment are improved.
Drawings
FIG. 1 is a flow chart of the system of the present invention;
FIG. 2 is a schematic diagram of the module relationship of the present invention.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
A system for managing and controlling version risk based on Git comprises:
the Git command packaging module is used for packaging and assembling Git native commands for the service module to use;
the business module is used for assembling and merging the full-flow information of the codes and collecting the information returned by the execution process;
the configuration module is used for storing parameter configuration and providing query interfaces for other modules so as to avoid encoding sensitive account information onto a logic layer code;
the deployment module is used for pulling the codes from the Git warehouse and deploying the codes to the docker;
the log module is used for unifying the log printing formats in the system operation process;
the mail module is used for sending a mail to inform a user of an operation result;
and the extension module is used for referencing the mature interface to extend other functions.
A method for managing and controlling version risk based on Git is implemented according to the following steps:
step 1, a developer invokes a code merging process, and the code merging process is executed by a service module and a Git command encapsulation module: the risk management control system automatically clones a working cache path from Git for subsequent execution of inspection logic;
step 2, detection process, executed by the service module and the configuration module: respectively entering a development branch and a development trunk, acquiring respective latest submission record lists, and screening out submission records which are generated due to code combination and have no actual submission by controlling a-no-merge parameter of a Git log command in Git;
step 3, comparing the latest submission records of the development branches and the main trunk, and detecting whether the development branches contain all the submission records of the main trunk or not, otherwise, interrupting the operation;
and 4, if the detection is passed, carrying out a merging process: merging codes on the development branches to a main trunk, and collecting related information such as project names, development branch names, success or failure, target deployment environment and the like for subsequent flows to use;
and 5, if the combination is successful, the deployment module deploys: remotely calling a construction process in Jenkins, automatically packaging and deploying the project into a docker mirror image, starting the project into a container, and otherwise, returning error information;
and 6, nesting the version risk management control system into a Jenkins continuous integration tool, and providing the characteristics of batch operation and the convenience of graphical starting.
And (4) the input and output in the steps 1-6 are processed by a version risk management control system, and all sensitive information is shielded externally and printed.
The permission account is configured through a configuration file, the configuration file is stored in a Linux server, only a specific account is given to read permission, tampering is avoided, and leakage risks are reduced to the maximum extent.
A computer-readable storage medium comprising computer-executable instructions that, when executed by a computer system, perform a Git-based versioning risk management override method.
Examples
A configuration server: one or more Linux servers;
deploying a relevant environment on a Linux server: git, Jenkins, Python, mailbox, etc., if a plurality of servers are configured, it is also necessary to ensure that the servers have mutual access rights;
installing a Python dependent library used in a version risk management handling system;
copying the whole code of the version risk management control system into a script directory of Jenkins, and configuring access authority;
modifying a configuration file in a version risk management control system, wherein the configuration file mainly relates to the configuration of required permissions such as a Git account password, a server account password, a mailbox account password, a Jenkins account password and the like;
configuring graphical and parameterized interface entries in Jenkins, and directing an execution process to an external calling interface of a version risk management control system;
after the steps are completed, development or testing personnel launch a code merging process from Jenkins, and automatically detect and execute the processes of code merging, project building and project deployment.
The invention integrates the Git merging principle and the repackaging of the primary command by Python, so that the original split version management work which needs independent manual operation of each step is unified into a continuous integrated devops system, thereby having certain information safety protection and improving the working efficiency of developers and testers.

Claims (5)

1. A system for managing and controlling version risk based on Git is characterized by comprising:
the Git command packaging module is used for packaging and assembling Git native commands for the service module to use;
the business module is used for assembling and merging the full-flow information of the codes and collecting the information returned by the execution process;
the configuration module is used for storing parameter configuration and providing query interfaces for other modules so as to avoid encoding sensitive account information onto a logic layer code;
the deployment module is used for pulling the codes from the Git warehouse and deploying the codes to the docker;
the log module is used for printing in a log format in the running process of the unified system;
the mail module is used for sending a mail to inform a user of an operation result;
and the extension module is used for referencing the mature interface to extend other functions.
2. A method for managing and controlling version risk based on Git is characterized by comprising the following steps:
step 1, a developer invokes a code merging process, and the code merging process is executed by a service module and a Git command encapsulation module: the risk management control system automatically clones a working cache path from Git for subsequent execution of inspection logic;
step 2, detection process, executed by the service module and the configuration module: respectively entering a development branch and a development trunk, acquiring respective latest submission record lists, and screening out submission records which are generated due to code combination and have no actual submission by controlling a-no-merge parameter of a Git log command in Git;
step 3, comparing the latest submission records of the development branches and the main trunk, and detecting whether the development branches contain all the submission records of the main trunk or not, otherwise, interrupting the operation;
and 4, if the detection is passed, carrying out a merging process: merging codes on the development branches to a main trunk, and collecting related information such as project names, development branch names, success or failure, target deployment environment and the like for subsequent flows to use;
and 5, if the combination is successful, the deployment module deploys: remotely calling a construction process in Jenkins, automatically packaging and deploying the project into a docker mirror image, starting the project into a container, and otherwise, returning error information;
and 6, nesting the version risk management control system into a Jenkins continuous integration tool, and providing the characteristics of batch operation and the convenience of graphical starting.
3. A Git-based version risk management and control method according to claim 2, wherein the input and output in steps 1-6 are processed by the version risk management and control system, and all sensitive information is externally shielded from being printed.
4. The Git-based version risk management and control method according to claim 2, wherein the permission account is configured by a configuration file, the configuration file is stored in a Linux server, and only a specific account is given a read permission, so that the method is guaranteed not to be tampered, and the leakage risk is reduced to the maximum extent.
5. A computer-readable storage medium comprising computer-executable instructions that, when executed by a computer system, perform the method of claims 2-4.
CN202110917663.XA 2021-08-11 2021-08-11 Method, system and storage medium for managing and controlling version risk based on Git Pending CN113590182A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110917663.XA CN113590182A (en) 2021-08-11 2021-08-11 Method, system and storage medium for managing and controlling version risk based on Git

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110917663.XA CN113590182A (en) 2021-08-11 2021-08-11 Method, system and storage medium for managing and controlling version risk based on Git

Publications (1)

Publication Number Publication Date
CN113590182A true CN113590182A (en) 2021-11-02

Family

ID=78257059

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110917663.XA Pending CN113590182A (en) 2021-08-11 2021-08-11 Method, system and storage medium for managing and controlling version risk based on Git

Country Status (1)

Country Link
CN (1) CN113590182A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103336688A (en) * 2013-06-20 2013-10-02 中标软件有限公司 Software integrating method and system oriented to cloud computing software research and development process
US20150286558A1 (en) * 2013-05-14 2015-10-08 Noblis, Inc. Method and system to automatically enforce a hybrid branching strategy
US20170212751A1 (en) * 2016-01-22 2017-07-27 International Business Machines Corporation Automatic detection of potential merge errors
CN109032625A (en) * 2018-09-04 2018-12-18 山东浪潮云投信息科技有限公司 A kind of software continuous integrated approach and device
CN109597644A (en) * 2018-12-05 2019-04-09 江苏风云科技服务有限公司 Project dispositions method and device
CN109614379A (en) * 2018-10-22 2019-04-12 中国平安人寿保险股份有限公司 Log-output method, device, computer storage medium and computer equipment
CN111506322A (en) * 2020-04-16 2020-08-07 瑞纳智能设备股份有限公司 Automatic integrated construction development deployment platform and method
CN111831554A (en) * 2020-06-09 2020-10-27 时时同云科技(成都)有限责任公司 Code checking method and device
US20210089297A1 (en) * 2019-09-20 2021-03-25 Sungard Availability Services, Lp Automated check for ticket status of merged code

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150286558A1 (en) * 2013-05-14 2015-10-08 Noblis, Inc. Method and system to automatically enforce a hybrid branching strategy
CN103336688A (en) * 2013-06-20 2013-10-02 中标软件有限公司 Software integrating method and system oriented to cloud computing software research and development process
US20170212751A1 (en) * 2016-01-22 2017-07-27 International Business Machines Corporation Automatic detection of potential merge errors
CN109032625A (en) * 2018-09-04 2018-12-18 山东浪潮云投信息科技有限公司 A kind of software continuous integrated approach and device
CN109614379A (en) * 2018-10-22 2019-04-12 中国平安人寿保险股份有限公司 Log-output method, device, computer storage medium and computer equipment
CN109597644A (en) * 2018-12-05 2019-04-09 江苏风云科技服务有限公司 Project dispositions method and device
US20210089297A1 (en) * 2019-09-20 2021-03-25 Sungard Availability Services, Lp Automated check for ticket status of merged code
CN111506322A (en) * 2020-04-16 2020-08-07 瑞纳智能设备股份有限公司 Automatic integrated construction development deployment platform and method
CN111831554A (en) * 2020-06-09 2020-10-27 时时同云科技(成都)有限责任公司 Code checking method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
小憩清风: "jenkins集成gitlab实现自动合并", pages 1 - 2, Retrieved from the Internet <URL:https://www.cnblogs.com/qingfengfumian/p/14539706.html> *
莫叫石榴姐: "用shell脚本封装git命令提高你的工作效率", pages 1 - 2, Retrieved from the Internet <URL:https://blog.csdn.net/godlovedaniel/article/details/105092584> *

Similar Documents

Publication Publication Date Title
US11727117B2 (en) Vulnerability analyzer for application dependencies in development pipelines
US20110197097A1 (en) Incremental problem determination and resolution in cloud environments
US8522207B1 (en) Systems and methods for automated centralized build/merge management
KR101579493B1 (en) Staging control method for source code, Computer program for the same, Recording medium storing computer program for the same
CN113434158B (en) Custom management method, device, equipment and medium for big data component
CN112835676A (en) Deployment method and device of containerized application, computer equipment and medium
US10970065B2 (en) Creation and execution of customised code for a data processing platform
CN111966366A (en) Cluster deployment method and device of multi-CPU architecture
CN113590182A (en) Method, system and storage medium for managing and controlling version risk based on Git
US10176011B2 (en) Automatically generating and executing a service operation implementation for executing a task
WO2023151397A1 (en) Application program deployment method and apparatus, device, and medium
CN111352631A (en) Interface compatibility detection method and device
CN116599881A (en) Cloud platform tenant modeling test method, device, equipment and storage medium
CN114968819A (en) Code quality problem detection and repair method for micro-service continuous integration
CN116400950A (en) DevOps element pipeline system based on version control
CN115658232A (en) Cloud native platform rapid deployment method and system
CN114116471A (en) Automatic code scanning method, system, electronic equipment and storage medium
US20210349808A1 (en) Source quality check service
CN112632546A (en) Automatic code analysis method for broadcasting and television industry
CN114327588A (en) Method and device for processing code submission log
GB2602344A (en) A telecom enterprise management system and computer implemented method of generating same
Wendland et al. Extending the UML Testing Profile with a fine-grained test logging model
US20240095148A1 (en) Automatic assignment of changed permissions for diagnostic purposes for work container instances that have already been started
CN112947948B (en) Deployment method and device of application service
CN116484377A (en) JAR vulnerability detection method, system, storage medium and computer for container management platform

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