CN117240868A - Code processing method, apparatus, storage medium, and program product - Google Patents

Code processing method, apparatus, storage medium, and program product Download PDF

Info

Publication number
CN117240868A
CN117240868A CN202311200562.6A CN202311200562A CN117240868A CN 117240868 A CN117240868 A CN 117240868A CN 202311200562 A CN202311200562 A CN 202311200562A CN 117240868 A CN117240868 A CN 117240868A
Authority
CN
China
Prior art keywords
code
warehouse
external
original
updating
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
CN202311200562.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.)
Ecarx Hubei Tech Co Ltd
Original Assignee
Ecarx Hubei Tech 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 Ecarx Hubei Tech Co Ltd filed Critical Ecarx Hubei Tech Co Ltd
Priority to CN202311200562.6A priority Critical patent/CN117240868A/en
Publication of CN117240868A publication Critical patent/CN117240868A/en
Pending legal-status Critical Current

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the application provides a code processing method, equipment, a storage medium and a program product, wherein the method comprises the steps of responding to code release operation of an original warehouse, synchronously updating the code of a first external warehouse based on the code release operation so as to enable the code of the first external warehouse to be consistent with the code of the original warehouse, opening the use permission of an intranet terminal device by the original warehouse, responding to the first external warehouse to finish the code update operation, updating the code of a second external warehouse according to the code update operation of the first external warehouse so as to enable the extranet terminal device to acquire a code to be processed from the second external warehouse, and processing the code to be processed. The code processing method provided by the embodiment realizes the isolation of the intranet user and the extranet user, avoids pollution, and enables the intranet user and the extranet user to be processed and cooperated with the same project code more safely and efficiently.

Description

Code processing method, apparatus, storage medium, and program product
Technical Field
Embodiments of the present application relate to the field of computer technologies, and in particular, to a code processing method, a device, a storage medium, and a program product.
Background
During the project development process, the enterprise may be involved in situations where collaborative development with external enterprises is required.
In the related art, account creation can be performed on an intranet for staff of an external enterprise, so that the staff of the external enterprise can access the intranet by adopting a virtual private network (Virtual Private Network, VPN) mode.
However, in implementing the present application, the inventors found that at least the following problems exist in the prior art: the mode needs more manual participation, and is low in efficiency and safety.
Disclosure of Invention
The embodiment of the application provides a code processing method, a device, a storage medium and a program product, which are used for improving efficiency and safety.
In a first aspect, an embodiment of the present application provides a code processing method, including:
responding to a code release operation of an original warehouse, and synchronously updating the code of a first external warehouse based on the code release operation so as to enable the code of the first external warehouse to be consistent with the code of the original warehouse; the original warehouse is used for opening the use permission for the intranet terminal equipment;
and in response to the first external warehouse completing the code updating operation, updating the code of a second external warehouse according to the code updating operation of the first external warehouse, so that the external network terminal equipment obtains the code to be processed from the second external warehouse, and processes the code to be processed.
In one possible design, the updating the code of the first external repository includes:
detecting whether a first external warehouse created based on the original warehouse exists;
if so, synchronously updating the codes of the first external warehouse based on the code updating information;
if not, a first external warehouse is created based on the codes of the original warehouses so that the codes of the first external warehouse are consistent with the codes of the original warehouses.
In one possible design, the updating the code of the second external repository according to the code updating operation of the first external repository in response to the first external repository completing the code updating operation includes:
triggering a Hook function after the first external warehouse completes the code updating operation;
and updating the code of a second external warehouse according to the code updating operation of the first external warehouse based on the Hook function.
In one possible design, the method further comprises:
creating a merging request through the second external warehouse in response to receiving the processed object code submitted by the external network terminal equipment;
receiving, by the first external repository, the merge request, merging the object code received by the second external repository to the first external repository based on the merge request;
And merging the target codes in the first external warehouse to the original warehouse based on the merging request.
In one possible design, the merging the object code received by the second external repository to the first external repository based on the merging request includes:
responding to the first external warehouse to receive a merging request, calling a first continuous integrated system construction code based on a pre-built Hook function, and carrying out target scanning on the constructed code; the target scan includes a white box scan and/or a vulnerability scan;
and if the scanning is passed, merging the target codes received by the second external warehouse to the first external warehouse.
In one possible design, after the merging the object code in the first external repository into the original repository based on the merging request, the method further includes:
responding to the original warehouse to complete code merging operation, compiling and packaging codes in the original warehouse based on a second continuous integrated system, and obtaining packaged data;
uploading the packed data to a product library so as to manage the packed data through the product library.
In a second aspect, an embodiment of the present application provides a code processing method, including:
Acquiring a code to be processed from a second external warehouse, and processing the code to be processed; the codes in the second external warehouse are obtained by updating based on the codes of the first external warehouse; the code of the first external warehouse is obtained by updating based on the code of the original warehouse; the original warehouse is used for opening the use permission to the intranet terminal equipment.
In one possible design, the obtaining the code to be processed from the second external repository, and processing the code to be processed includes:
accessing a second external repository based on the account information;
and acquiring a code to be processed associated with the account information from the second external warehouse.
In one possible design, the method further comprises:
and based on a preset period, submitting the processed target code to the second external warehouse.
In a third aspect, an embodiment of the present application provides a server, including:
the publishing module is used for responding to the code publishing operation of the original warehouse, and synchronously updating the code of the first external warehouse based on the code publishing operation so as to enable the code of the first external warehouse to be consistent with the code of the original warehouse; the original warehouse is used for opening the use permission for the intranet terminal equipment;
And the updating module is used for responding to the code updating operation of the first external warehouse, and updating the code of the second external warehouse according to the code updating operation of the first external warehouse so that the external network terminal equipment obtains the code to be processed from the second external warehouse and processes the code to be processed.
In a fourth aspect, an embodiment of the present application provides a terminal device, including:
the acquisition module is used for acquiring a code to be processed from the second external warehouse and processing the code to be processed; the codes in the second external warehouse are obtained by updating based on the codes of the first external warehouse; the code of the first external warehouse is obtained by updating based on the code of the original warehouse; the original warehouse is used for opening the use permission to the intranet terminal equipment.
In a fifth aspect, an embodiment of the present application provides a code processing apparatus, including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executes the computer-executable instructions stored by the memory such that the at least one processor performs the method as described above in the first aspect and the various possible designs of the first aspect.
In a sixth aspect, embodiments of the present application provide a computer readable storage medium having stored therein computer executable instructions which, when executed by a processor, implement the method as described in the first aspect and the various possible designs of the first aspect.
In a seventh aspect, embodiments of the present application provide a computer program product comprising a computer program which, when executed by a processor, implements the method as described above for the first aspect and the various possible designs of the first aspect.
The method includes the steps that in response to code release operation of an original warehouse, the code of a first external warehouse is synchronously updated based on the code release operation so that the code of the first external warehouse is consistent with the code of the original warehouse, the original warehouse is used for opening use permission to an intranet terminal device, in response to the fact that the first external warehouse completes code update operation, the code of a second external warehouse is updated according to the code update operation of the first external warehouse, and therefore the extranet terminal device obtains to-be-processed codes from the second external warehouse, and the to-be-processed codes are processed. According to the code processing method provided by the embodiment, the first external warehouse is synchronously created based on the original warehouse inside the enterprise, and the second external warehouse is further created based on the first external warehouse, so that the first external warehouse, the second external warehouse and the original warehouse are kept synchronously updated, external staff can acquire relevant codes to be processed by accessing the second external warehouse, the isolation of the intranet users and the extranet users is realized, pollution is avoided, and the intranet users and the extranet users can be processed and cooperate more safely and efficiently for the same project code.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions of the prior art, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it will be obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
Fig. 1 is a schematic view of a scenario of a code processing method according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a code processing method according to an embodiment of the present application;
FIG. 3 is a second flowchart of a code processing method according to an embodiment of the present application;
fig. 4 is a flowchart illustrating a code processing method according to an embodiment of the present application;
FIG. 5 is an interaction schematic diagram of a code processing method according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a code processing apparatus according to an embodiment of the present application;
fig. 7 is a schematic diagram of a second structure of a code processing apparatus according to an embodiment of the present application;
fig. 8 is a schematic hardware structure of a code processing apparatus according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that the code processing method and apparatus provided by the present application may be used in the field of computer technology, and may also be used in any field other than the field of computer, and the application field of the code processing method and apparatus provided by the present application is not limited.
The project source codes in the company are required to be released outwards due to the cooperation relationship so that the cooperation enterprises can participate in code development together, but the company internal code warehouse is usually accessible only by the company intranet, and can only be logged in by using a domain account number, in the related technology, the access of staff of the cooperation enterprises to the internal code warehouse can be realized by creating an account number and opening a virtual private network (Virtual Private Network, VPN). However, the above-mentioned method is complex and unsafe, and requires much labor, and is a great loss of manpower, so that a safe and automatic scheme for code release and reflow needs to be designed.
In order to solve the above technical problems, the present inventors have studied and found that a backup can be made for an original repository, such as an external repository, so that an external worker can perform code processing based on the backup. Thus, better internal and external network isolation can be performed. Based on the above, the embodiment of the application provides a code processing method.
Fig. 1 is a schematic view of a scenario of a code processing method according to an embodiment of the present application. As shown in fig. 1, the server mounts an internal code hosting platform and an external code hosting platform. Wherein the internal code hosting platform comprises an original repository for item a and the external code hosting platform comprises a first external repository for item a and a second external repository for item a. The terminal device is connected with the server and is used for accessing a second external warehouse of an external code hosting platform of the server.
In a specific implementation process, the internal code hosting platform can be used for accessing intranet terminal equipment connected to an enterprise intranet. The method comprises the steps that an initial code of a project A obtained by encoding through an intranet terminal device in an enterprise can be stored in an original warehouse, if it is determined that the project A needs to be carried out by an external user, the code of the project A in the original warehouse can be issued, the code of a first external warehouse is synchronously updated based on the code issuing operation in response to the code issuing operation of the original warehouse, so that the code of the first external warehouse is consistent with the code of the original warehouse, the code updating operation is completed in response to the first external warehouse, the code of a second external warehouse is updated according to the code updating operation of the first external warehouse, and the external network terminal device obtains a code to be processed from the second external warehouse and processes the code to be processed. According to the code processing method provided by the embodiment of the application, the first external warehouse is synchronously created based on the original warehouse in the enterprise, and the second external warehouse is further created based on the first external warehouse, so that the first external warehouse, the second external warehouse and the original warehouse are kept synchronously updated, external staff can acquire related codes to be processed by accessing the second external warehouse, the isolation of the intranet user and the extranet user is realized, pollution is avoided, and the intranet user and the extranet user can be processed and cooperate more safely and efficiently for the same project code.
It should be noted that, the schematic view of the scenario shown in fig. 1 is only an example, and the code processing method and the scenario described in the embodiment of the present application are for more clearly describing the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided by the embodiment of the present application, and those skilled in the art can know that, with the evolution of the system and the appearance of a new service scenario, the technical solution provided by the embodiment of the present application is equally applicable to similar technical problems.
The technical scheme of the application is described in detail below by specific examples. The following embodiments may be combined with each other, and some embodiments may not be repeated for the same or similar concepts or processes.
Fig. 2 is a flowchart illustrating a code processing method according to an embodiment of the present application. As shown in fig. 2, the method includes:
201. responding to a code release operation of an original warehouse, and synchronously updating the code of a first external warehouse based on the code release operation so as to enable the code of the first external warehouse to be consistent with the code of the original warehouse; the original warehouse is used for opening the use permission to the intranet terminal equipment.
The execution body of the embodiment is a server, such as the server shown in fig. 1.
Specifically, the original warehouse is a warehouse which can only be accessed by an enterprise intranet. To facilitate access by external network users, a first external repository may be created based on the original repository such that the first external repository is updated in synchronization with the code of the original repository. By way of example, project a is taken as an example of the current need for collaborative development. The code of the project A in the original warehouse in the internal code hosting platform is the initial code, the system automatically creates a project A release warehouse (namely a first external warehouse) on the external code hosting platform through automatic script call, and simultaneously automatically synchronizes the code in the project A original warehouse into the project A release warehouse of the external code hosting platform.
In some embodiments, the updating the code of the first external repository synchronously may include: detecting whether a first external warehouse created based on the original warehouse exists; if so, synchronously updating the codes of the first external warehouse based on the code updating information; if not, a first external warehouse is created based on the codes of the original warehouses so that the codes of the first external warehouse are consistent with the codes of the original warehouses.
Specifically, after the original warehouse is created, an internal user in the enterprise intranet can develop codes through the internal terminal equipment, after a certain code quantity is accumulated, the codes can be issued to start cooperation with external staff, and at the moment, a first external warehouse can be created. The code of the current original repository is synchronized to the first external repository. After the first external warehouse is created, the internal user can continue to develop the code, and when the code in the original warehouse is released again, the first external warehouse is created, so that the first external warehouse can be synchronously updated.
202. And in response to the first external warehouse completing the code updating operation, updating the code of a second external warehouse according to the code updating operation of the first external warehouse, so that the external network terminal equipment obtains the code to be processed from the second external warehouse, and processes the code to be processed.
Specifically, considering that the problem of code pollution may be caused when the external user directly uses the code of the first external warehouse to process, the second external warehouse can be created based on the first external warehouse, so that the external user accesses the second external warehouse through the external network terminal device to obtain the relevant code to be processed for processing. Contamination of the first external warehouse and the original warehouse is avoided.
In some embodiments, the updating the code of the second external repository according to the code update operation of the first external repository in response to the first external repository completing the code update operation may include: triggering a Hook function after the first external warehouse completes the code updating operation; and updating the code of a second external warehouse according to the code updating operation of the first external warehouse based on the Hook function.
By way of example, after the external code hosting platform synchronizes the project A code, a system Hook is triggered, a project A fork warehouse is automatically released based on the project A, the problem of code pollution can be solved by creating the fork warehouse, any code change between the original warehouse and the release warehouse can be synchronized in real time, the instantaneity of the code is guaranteed, various conflict problems can be caused by direct development based on the release warehouse, and therefore the fork warehouse is needed to be adopted for code modification.
According to the code processing method provided by the embodiment, the first external warehouse is synchronously created based on the original warehouse inside the enterprise, and the second external warehouse is further created based on the first external warehouse, so that the first external warehouse, the second external warehouse and the original warehouse are kept synchronously updated, external staff can acquire relevant codes to be processed by accessing the second external warehouse, the isolation of the intranet users and the extranet users is realized, pollution is avoided, and the intranet users and the extranet users can be processed and cooperate more safely and efficiently for the same project code.
Fig. 3 is a second flowchart of a code processing method according to an embodiment of the present application. As shown in fig. 3, the method includes:
301. responding to a code release operation of an original warehouse, and synchronously updating the code of a first external warehouse based on the code release operation so as to enable the code of the first external warehouse to be consistent with the code of the original warehouse; the original warehouse is used for opening the use permission to the intranet terminal equipment.
302. And in response to the first external warehouse completing the code updating operation, updating the code of a second external warehouse according to the code updating operation of the first external warehouse, so that the external network terminal equipment obtains the code to be processed from the second external warehouse, and processes the code to be processed.
Steps 301 to 302 in this embodiment are similar to steps 201 to 202 in the above embodiment, and will not be repeated here.
303. And in response to receiving the processed object code submitted by the external network terminal equipment, creating a merging request through the second external warehouse.
Specifically, after the external network terminal device obtains the code to be processed, the external network terminal device may process the code, and the processed code may be automatically submitted, for example, a period may be preset, and the code that completes processing in the period may be submitted to the second external library based on the preset period, and after the second external library detects the code submitting operation of the external network terminal device, the second external library may automatically create the merging request.
304. And receiving the merging request through the first external warehouse, and merging the target codes received by the second external warehouse to the first external warehouse based on the merging request.
Specifically, after the first external warehouse receives the merging request created by the second external warehouse, the codes received by the second external warehouse from the external network terminal device can be merged into the first external warehouse.
In some embodiments, the merging the object code received by the second external repository to the first external repository based on the merging request may include: responding to the first external warehouse to receive a merging request, calling a first continuous integrated system construction code based on a pre-built Hook function, and carrying out target scanning on the constructed code; the target scan includes a white box scan and/or a vulnerability scan; and if the scanning is passed, merging the target codes received by the second external warehouse to the first external warehouse.
The target scanning of the constructed code can comprise white-box scanning of the self-developed code and/or vulnerability scanning of a third-party open source library introduced in the code.
The manner and scope of white-box scanning and vulnerability scanning varies. Vulnerability scanning is typically an automated, external security test method. It focuses on identifying known vulnerabilities and vulnerabilities, typically by comparing a system, application or network configuration to a database of known vulnerabilities. The vulnerability scanner may quickly identify common vulnerabilities, such as unrepaired operating system vulnerabilities, known network service vulnerabilities, applications lacking the latest security patches, and the like. It is an efficient method for quickly discovering security problems in a system, but it typically does not involve deep analysis or inspection of the internal workings of the application.
White-box scanning is a deeper and comprehensive security test method that typically requires access to the source code, internal structure, or logic of an application. It focuses on discovering potential vulnerabilities, not just known vulnerabilities, as it can check the internal working principles of an application. White-box scanning generally requires more time and resources as it involves analyzing source code, data streams, authorization mechanisms, and other internal details. Such an approach may discover more complex and unknown vulnerabilities, such as logical vulnerabilities, unauthorized data access, business logical vulnerabilities, and the like.
In particular, considering the quality of the code, the scanning of the code may be performed first before the code of the second external repository is merged into the first external repository. For example, the external persistent integration system may be automatically invoked via a hook interface to automatically build the code. The external continuous integrated system performs white-box scanning and open-source component vulnerability scanning on the codes. After the scanning is passed, an automatic calling interface agrees with a merge request, and the fork warehouse codes are merged into a release warehouse.
305. And merging the target codes in the first external warehouse to the original warehouse based on the merging request.
306. And responding to the original warehouse to complete the code merging operation, and compiling and packaging codes in the original warehouse based on a second continuous integrated system to obtain packaged data.
307. Uploading the packed data to a product library so as to manage the packed data through the product library.
Specifically, the external code hosting platform issues a repository code that automatically reflows into the original repository of the internal code hosting platform. The internal code hosting platform automatically triggers the internal continuous integration system to compile and package the codes based on the script built in advance. And automatically uploading products after the project packaging is finished, such as jar packages, dock images and the like, to the JFrog for finished product management.
According to the code processing method provided by the embodiment, the first external warehouse is synchronously created based on the original warehouse inside the enterprise, and the second external warehouse is further created based on the first external warehouse, so that the first external warehouse, the second external warehouse and the original warehouse are kept synchronously updated, external staff can acquire relevant codes to be processed by accessing the second external warehouse, the isolation of the intranet users and the extranet users is realized, pollution is avoided, and the intranet users and the extranet users can be processed and cooperate more safely and efficiently for the same project code. And the codes submitted by the external network terminal equipment are sequentially passed through the second external warehouse and the first external warehouse through automatic triggering and finally flow back to the original warehouse, so that the quality and the integrity of the codes of the original warehouse are ensured. The whole process is safe and reasonable, and is beneficial to the efficient cooperation of the intranet user and the extranet user.
Fig. 4 is a flowchart illustrating a code processing method according to an embodiment of the present application. As shown in fig. 4, the method includes:
401. acquiring a code to be processed from a second external warehouse, and processing the code to be processed; the codes in the second external warehouse are obtained by updating based on the codes of the first external warehouse; the code of the first external warehouse is obtained by updating based on the code of the original warehouse; the original warehouse is used for opening the use permission to the intranet terminal equipment.
Specifically, the original warehouse is a warehouse which can only be accessed by an enterprise intranet. To facilitate access by external network users, a first external repository may be created based on the original repository such that the first external repository is updated in synchronization with the code of the original repository. Based on the first external warehouse, a second external warehouse can be created, so that an external user accesses the second external warehouse through the external network terminal equipment to acquire related codes to be processed for processing. Contamination of the first external warehouse and the original warehouse is avoided. After the first external repository and the second external repository are created, the external network termination device may obtain the code to be processed from the second external repository.
In some embodiments, the obtaining the code to be processed from the second external repository, and processing the code to be processed may include: accessing a second external repository based on the account information; and acquiring a code to be processed associated with the account information from the second external warehouse.
Specifically, an integrated development environment (Integrated Development Environment, IDE) tool can be installed in the external network terminal device, and the IDE tool can be a tool for code acquisition and submission obtained based on the secondary development of the vscode. The ided tool and the external code hosting platform can adopt the same account system to carry out directional pushing of codes based on accounts. The external network terminal adopts an account number B login identifier tool and an external code hosting platform, and the external network terminal is processing the codes related to the task C in the project a, so that when the external code hosting platform monitors that the codes related to the task C related to the account number B are updated, the codes related to the task C can be directionally sent to the external network terminal of the account number B.
In some embodiments, the method may further comprise: and based on a preset period, submitting the processed target code to the second external warehouse.
Specifically, after the external network terminal device obtains the code to be processed, the external network terminal device may process the code, and the processed code may be automatically submitted, for example, a period may be preset, and the code that completes processing in the period may be submitted to the second external library based on the preset period, and after the second external library detects the code submitting operation of the external network terminal device, the second external library may automatically create the merging request.
According to the code processing method provided by the embodiment, the first external warehouse is synchronously created based on the original warehouse inside the enterprise, and the second external warehouse is further created based on the first external warehouse, so that the first external warehouse, the second external warehouse and the original warehouse are kept synchronously updated, external staff can acquire relevant codes to be processed by accessing the second external warehouse, the isolation of the intranet users and the extranet users is realized, pollution is avoided, and the intranet users and the extranet users can be processed and cooperate more safely and efficiently for the same project code. And the codes submitted by the external network terminal equipment are sequentially passed through the second external warehouse and the first external warehouse through automatic triggering and finally flow back to the original warehouse, so that the quality and the integrity of the codes of the original warehouse are ensured. The whole process is safe and reasonable, and is beneficial to the efficient cooperation of the intranet user and the extranet user.
Fig. 5 is an interaction schematic diagram of a code processing method according to an embodiment of the present application. As shown in fig. 5, the code processing method includes:
the first step: the original repository publishes the code. Specifically, the code of the item A in the original warehouse in the internal code hosting platform is an initial code, the system automatically creates an item A publishing warehouse (namely a first external warehouse) on the external code hosting platform through automatic script call, and simultaneously automatically synchronizes the code in the item A original warehouse into the item A publishing warehouse of the external code hosting platform.
And a second step of: a fork repository (i.e., a second external repository) is created based on the publication repository. Specifically, after the external code hosting platform synchronizes the project A codes, a system Hook is triggered, the project A warehouse is automatically formed based on the project A release warehouse, the problem of code pollution can be solved by creating the warehouse, any code change between the original warehouse and the release warehouse can be synchronized in real time, the instantaneity of the codes is guaranteed, various conflict problems can be caused due to direct development based on the release warehouse, and therefore the warehouse is needed to be adopted for code modification.
And a third step of: the ider tool automatically obtains the code. Specifically, the ide tool may be a tool for code acquisition and submission obtained based on the secondary development of the vscode. The ided tool and the external code hosting platform can adopt the same account system to carry out directional pushing of codes based on accounts. The external network terminal adopts an account number B login identifier tool and an external code hosting platform, and the external network terminal is processing the codes related to the task C in the project a, so that when the external code hosting platform monitors that the codes related to the task C related to the account number B are updated, the codes related to the task C can be directionally sent to the external network terminal of the account number B. The Ide tool can integrate various git hook and interface call with the code hosting platform, can realize automatic updating and pushing of codes, and can automatically acquire the codes of the fork warehouse after the idee tool receives the completion of the code updating of the fork warehouse.
Fourth step: the ide tool automatically submits the code. Specifically, after the code is changed, the ide tool automatically submits the code and pushes the code to the fork repository.
Fifth step: the system automatically triggers a merge request. Specifically, while the code is automatically submitted through the ide tool, a merge request can be automatically created based on the fork repository through an interface integrated by the ide tool, requesting that the fork repository code be incorporated into the release repository.
Sixth step: the publishing warehouse receives the merge request. Specifically, after the publishing warehouse receives the merge request, a hook interface built in advance is triggered.
Seventh step: code is constructed. Specifically, the external continuous integration system is automatically called through a hook interface, and the codes are automatically constructed.
Eighth step: white box scanning and vulnerability scanning. Specifically, the external continuous integration system performs white-box scanning and open-source component vulnerability scanning on the code.
Ninth step: the code is merged into the release repository. Specifically, after the scanning is passed, an automatic calling interface agrees with a merge request, and the fork warehouse code is merged into the release warehouse.
Tenth step: the code is reflowed to the original repository. Specifically, the external code hosting platform issues a repository code that automatically reflows into the original repository of the internal code hosting platform.
Eleventh step: project construction and packaging. Specifically, the internal code hosting platform automatically triggers the internal continuous integration system to compile and package the codes based on the script built in advance.
Twelfth step: and (5) archiving the finished product. Specifically, products after the project is packaged, such as jar packages, dock images and the like, are automatically uploaded to the Jfrog for product management.
According to the code processing method, through the construction of the internal and external code hosting platform, authority isolation is effectively achieved, source codes needing to be released can be well managed, and branch pollution is avoided. The code is released through the external code hosting platform, so that external staff can freely manage and distribute code library authorities, and the staff can reasonably arrange the development according to business requirements without applying authorities to first parties every time. Each link is internally provided with an automatic script, and besides the work of code development, the manual participation is not needed, so that the labor cost is greatly saved.
Fig. 6 is a schematic diagram of a code processing apparatus according to an embodiment of the present application. As shown in fig. 6, the server 60 includes: the publishing module 601 and the updating module 602.
The publishing module 601 is configured to respond to a code publishing operation of an original repository, and synchronously update a code of a first external repository based on the code publishing operation, so that the code of the first external repository is consistent with the code of the original repository; the original warehouse is used for opening the use permission for the intranet terminal equipment;
And the updating module 602 is configured to update, in response to the first external repository completing the code updating operation, the code of the second external repository according to the code updating operation of the first external repository, so that the external network terminal device obtains a code to be processed from the second external repository, and processes the code to be processed.
According to the code processing equipment provided by the embodiment of the application, the first external warehouse is synchronously created based on the original warehouse inside the enterprise, and the second external warehouse is further created based on the first external warehouse, so that the first external warehouse, the second external warehouse and the original warehouse are kept synchronously updated, external staff can acquire related codes to be processed by accessing the second external warehouse, the isolation of the intranet user and the extranet user is realized, pollution is avoided, and the intranet user and the extranet user can be processed and cooperate more safely and efficiently for the same project code.
In some embodiments, the publishing module 601 is specifically configured to: detecting whether a first external warehouse created based on the original warehouse exists; if so, synchronously updating the codes of the first external warehouse based on the code updating information; if not, a first external warehouse is created based on the codes of the original warehouses so that the codes of the first external warehouse are consistent with the codes of the original warehouses.
In some embodiments, the update module 602 is specifically configured to: triggering a Hook function after the first external warehouse completes the code updating operation; and updating the code of a second external warehouse according to the code updating operation of the first external warehouse based on the Hook function.
In some embodiments, the server 60 further comprises: a merging module (not shown) for: creating a merging request through the second external warehouse in response to receiving the processed object code submitted by the external network terminal equipment; receiving, by the first external repository, the merge request, merging the object code received by the second external repository to the first external repository based on the merge request; and merging the target codes in the first external warehouse to the original warehouse based on the merging request.
In some embodiments, the merging module is specifically configured to: responding to the first external warehouse to receive a merging request, calling a first continuous integrated system construction code based on a pre-built Hook function, and carrying out target scanning on the constructed code; the target scan includes a white box scan and/or a vulnerability scan; and if the scanning is passed, merging the target codes received by the second external warehouse to the first external warehouse.
In some embodiments, the combining module is further to: responding to the original warehouse to complete code merging operation, compiling and packaging codes in the original warehouse based on a second continuous integrated system, and obtaining packaged data; uploading the packed data to a product library so as to manage the packed data through the product library.
The code processing apparatus provided in the embodiment of the present application may be used to execute the above embodiment of the method using a server as an execution body, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
Fig. 7 is a schematic diagram of a code processing apparatus according to a second embodiment of the present application. As shown in fig. 7, the terminal device 70 includes: the module 701 is acquired.
An acquiring module 701, configured to acquire a code to be processed from a second external repository, and process the code to be processed; the codes in the second external warehouse are obtained by updating based on the codes of the first external warehouse; the code of the first external warehouse is obtained by updating based on the code of the original warehouse; the original warehouse is used for opening the use permission to the intranet terminal equipment.
In some embodiments, the obtaining module 701 is specifically configured to: accessing a second external repository based on the account information; and acquiring a code to be processed associated with the account information from the second external warehouse.
In some embodiments, the terminal device 70 further comprises a submitting module 702, the submitting module 702 being configured to submit the processed object code to the second external repository based on a preset period.
The code processing device provided by the embodiment of the present application may be used to execute the above embodiment of the method using the terminal number device as the execution body, and its implementation principle and technical effects are similar, and this embodiment will not be repeated here.
Fig. 8 is a schematic diagram of a hardware structure of a code processing device according to an embodiment of the present application, where the device may be a server, a computer, a messaging device, a tablet device, a medical device, etc.
The device 120 may include one or more of the following components: a processing component 1201, a memory 1202, a power supply component 1203, a multimedia component 1204, an audio component 1205, an input/output (I/O) interface 1206, a sensor component 1207, and a communication component 1208.
The processing assembly 1201 generally controls overall operation of the device 120, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing assembly 1201 may include one or more processors 1209 to execute instructions to perform all or part of the steps of the methods described above. In addition, the processing assembly 1201 may include one or more modules to facilitate interactions between the processing assembly 1201 and other components. For example, the processing component 1201 may include a multimedia module to facilitate interactions between the multimedia component 1204 and the processing component 1201.
Memory 1202 is configured to store various types of data to support operations at device 120. Examples of such data include instructions for any application or method operating on device 120, contact data, phonebook data, messages, pictures, video, and the like. The memory 1202 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply assembly 1203 provides power to the various components of the device 120. The power components 1203 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 120.
The multimedia component 1204 includes a screen between the device 120 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1204 includes a front camera and/or a rear camera. The front camera and/or the rear camera may receive external multimedia data when the device 120 is in an operational mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 1205 is configured to output and/or input audio signals. For example, the audio component 1205 includes a Microphone (MIC) configured to receive external audio signals when the device 120 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 1202 or transmitted via the communication component 1208. In some embodiments, the audio component 1205 also includes a speaker for outputting audio signals.
I/O interface 1206 provides an interface between processing assembly 1201 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 1207 includes one or more sensors for providing status assessment of various aspects of the device 120. For example, the sensor assembly 1207 may detect an on/off state of the device 120, a relative positioning of the components, such as a display and keypad of the device 120, the sensor assembly 1207 may also detect a change in position of the device 120 or a component of the device 120, the presence or absence of user contact with the device 120, an orientation or acceleration/deceleration of the device 120, and a change in temperature of the device 120. The sensor assembly 1207 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor assembly 1207 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1207 can also include acceleration sensors, gyroscopic sensors, magnetic sensors, pressure sensors, or temperature sensors.
The communication component 1208 is configured to facilitate communication between the device 120 and other devices, either wired or wireless. The device 120 may access a wireless network based on a communication standard, such as WiFi,2G, or 3G, or a combination thereof. In one exemplary embodiment, the communication component 1208 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 1208 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the device 120 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 1202, including instructions executable by processor 1209 of device 120 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
The computer readable storage medium described above may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. A readable storage medium can be any available medium that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. In the alternative, the readable storage medium may be integral to the processor. The processor and the readable storage medium may reside in an application specific integrated circuit (Application Specific Integrated Circuits, ASIC for short). The processor and the readable storage medium may reside as discrete components in a device.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
The embodiment of the application also provides a computer program product, which comprises a computer program, wherein the computer program is executed by a processor to realize the code processing method executed by the code processing device.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application.

Claims (14)

1. A code processing method, applied to a server, comprising:
responding to a code release operation of an original warehouse, and synchronously updating the code of a first external warehouse based on the code release operation so as to enable the code of the first external warehouse to be consistent with the code of the original warehouse; the original warehouse is used for opening the use permission for the intranet terminal equipment;
and in response to the first external warehouse completing the code updating operation, updating the code of a second external warehouse according to the code updating operation of the first external warehouse, so that the external network terminal equipment obtains the code to be processed from the second external warehouse, and processes the code to be processed.
2. The method of claim 1, wherein the synchronously updating the code of the first external repository comprises:
detecting whether a first external warehouse created based on the original warehouse exists;
if so, synchronously updating the codes of the first external warehouse based on the code updating information;
if not, a first external warehouse is created based on the codes of the original warehouses so that the codes of the first external warehouse are consistent with the codes of the original warehouses.
3. The method of claim 1, wherein the updating code of a second external repository in accordance with the code update operation of the first external repository in response to the first external repository completing the code update operation comprises:
triggering a Hook function after the first external warehouse completes the code updating operation;
and updating the code of a second external warehouse according to the code updating operation of the first external warehouse based on the Hook function.
4. A method according to any one of claims 1-3, wherein the method further comprises:
creating a merging request through the second external warehouse in response to receiving the processed object code submitted by the external network terminal equipment;
Receiving, by the first external repository, the merge request, merging the object code received by the second external repository to the first external repository based on the merge request;
and merging the target codes in the first external warehouse to the original warehouse based on the merging request.
5. The method of claim 4, wherein merging the object code received by the second external repository to the first external repository based on the merge request comprises:
responding to the first external warehouse to receive a merging request, calling a first continuous integrated system construction code based on a pre-built Hook function, and carrying out target scanning on the constructed code; the target scan includes a white box scan and/or a vulnerability scan;
and if the scanning is passed, merging the target codes received by the second external warehouse to the first external warehouse.
6. The method of claim 4, wherein after merging the object code in the first external repository into the original repository based on the merge request, further comprising:
responding to the original warehouse to complete code merging operation, compiling and packaging codes in the original warehouse based on a second continuous integrated system, and obtaining packaged data;
Uploading the packed data to a product library so as to manage the packed data through the product library.
7. A code processing method, applied to a terminal device, comprising:
acquiring a code to be processed from a second external warehouse, and processing the code to be processed; the codes in the second external warehouse are obtained by updating based on the codes of the first external warehouse; the code of the first external warehouse is obtained by updating based on the code of the original warehouse; the original warehouse is used for opening the use permission to the intranet terminal equipment.
8. The method of claim 7, wherein the retrieving the code to be processed from the second external repository, processing the code to be processed, comprises:
accessing a second external repository based on the account information;
and acquiring a code to be processed associated with the account information from the second external warehouse.
9. The method according to claim 7 or 8, characterized in that the method further comprises:
and based on a preset period, submitting the processed target code to the second external warehouse.
10. A server, comprising:
the publishing module is used for responding to the code publishing operation of the original warehouse, and synchronously updating the code of the first external warehouse based on the code publishing operation so as to enable the code of the first external warehouse to be consistent with the code of the original warehouse; the original warehouse is used for opening the use permission for the intranet terminal equipment;
And the updating module is used for responding to the code updating operation of the first external warehouse, and updating the code of the second external warehouse according to the code updating operation of the first external warehouse so that the external network terminal equipment obtains the code to be processed from the second external warehouse and processes the code to be processed.
11. A terminal device, comprising:
the acquisition module is used for acquiring a code to be processed from the second external warehouse and processing the code to be processed; the codes in the second external warehouse are obtained by updating based on the codes of the first external warehouse; the code of the first external warehouse is obtained by updating based on the code of the original warehouse; the original warehouse is used for opening the use permission to the intranet terminal equipment.
12. A code processing apparatus, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing computer-executable instructions stored in the memory causes the at least one processor to perform the code processing method of any one of claims 1 to 9.
13. A computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, implement the code processing method of any one of claims 1 to 9.
14. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the code processing method of any of claims 1 to 9.
CN202311200562.6A 2023-09-15 2023-09-15 Code processing method, apparatus, storage medium, and program product Pending CN117240868A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311200562.6A CN117240868A (en) 2023-09-15 2023-09-15 Code processing method, apparatus, storage medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311200562.6A CN117240868A (en) 2023-09-15 2023-09-15 Code processing method, apparatus, storage medium, and program product

Publications (1)

Publication Number Publication Date
CN117240868A true CN117240868A (en) 2023-12-15

Family

ID=89082147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311200562.6A Pending CN117240868A (en) 2023-09-15 2023-09-15 Code processing method, apparatus, storage medium, and program product

Country Status (1)

Country Link
CN (1) CN117240868A (en)

Similar Documents

Publication Publication Date Title
US11314611B2 (en) Universal identity management or governance over applications
CN109447248A (en) Deep learning platform and method
KR101712762B1 (en) Method and device for loading theme application
RU2642843C2 (en) Method and device for processing recording contacts
CN111222014B (en) Request processing method, request processing device, electronic equipment and storage medium
CN115185717B (en) Interface calling method and device, electronic equipment and storage medium
CN113238763A (en) Application deployment method, device, storage medium and program product
EP2950486A1 (en) Method and device for managing instant message
CN108874399B (en) Method and device for installing plug-in and terminal
CN111857806A (en) Permission configuration file updating method and device, electronic equipment and storage medium
CN111538502A (en) Installation package processing method and device, electronic equipment and storage medium
CN117240868A (en) Code processing method, apparatus, storage medium, and program product
CN115951944A (en) Shortcut key setting method and device, electronic equipment and storage medium
CN110995767B (en) Request processing method and device
CN116244358A (en) Data processing method, device and storage medium
CN108549570B (en) User interface updating method and device
CN109409097B (en) Information management method, device and computer readable storage medium
CN112860625A (en) Data acquisition method, data storage method, device, equipment and storage medium
CN105892832B (en) Method and device for displaying display information
CN113220275B (en) Software acquisition method and device
CN114443161B (en) Application docking method, device, equipment and storage medium
CN110311968B (en) Method and device for loading file in streaming mode and intelligent equipment
CN111382237B (en) Data processing method, device and task dialogue system
CN112650686B (en) Method and device for obtaining test result, electronic equipment and storage medium
CN113778385B (en) Component registration method, device, terminal and storage medium

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