A private server dependency source code management method and device

By building a private repository of dependency source code and configuring access permissions, the security and management issues of third-party dependency source code in software development are solved, achieving unified management of third-party and private dependency source code and improving development efficiency and security.

CN119645371BActive Publication Date: 2026-04-14CCB FINTECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In the software development process, directly accessing external third-party dependency source code poses risks of sensitive information leakage and data tampering, and makes it impossible to effectively manage internal and third-party dependency source code in a unified manner, thus affecting the development progress.

Method used

Build a private repository of dependency source code, manage third-party and private dependency source code through index files, configure access permissions and audit logs to ensure that only authorized users can access it, and achieve unified management and secure transmission.

Benefits of technology

It improved the development efficiency of the project team, ensured the security and integrity of the source code, and prevented unauthorized access and malicious attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645371B_ABST
    Figure CN119645371B_ABST
Patent Text Reader

Abstract

The specification provides a private service dependent source code management method and device, and relates to the field of financial technology. The method comprises the following steps: creating a private service dependent source code warehouse of a target source code management system; obtaining an index file of third-party dependent code of the target source code management system; constructing a target code project according to the index file of the third-party dependent code; uploading external dependent index source code to the private service dependent source code warehouse according to the address of the target code project; obtaining the address of third-party dependent source code according to the external dependent index source code; uploading the third-party dependent source code to the private service dependent source code warehouse according to the address of the third-party dependent source code; creating an index file of private dependent code of the target source code management system; and uploading private index source code and private dependent source code to the private service dependent source code warehouse through the index file of the private dependent code. Through the above scheme, the third-party dependent source code and the private dependent source code can be uniformly managed, and the development efficiency of a project team is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This manual pertains to the field of financial technology, and in particular relates to a method and device for managing private server dependency source code. Background Technology

[0002] In the process of software development, a large number of resources are relied upon, including source code dependencies in internal repositories and third-party dependency source code in external repositories.

[0003] However, when development teams directly access third-party dependency source code from external repositories, the integrity and reliability of this source code cannot be guaranteed. Therefore, there is a risk of sensitive information being leaked and data being tampered with. Due to security or network policy restrictions during software development, development teams may be unable to directly access external third-party libraries, hindering the acquisition of necessary dependency source code and impacting development progress.

[0004] There is currently no effective solution for how to securely obtain third-party dependency source code and uniformly manage internal and third-party dependency source code. Summary of the Invention

[0005] This application provides a method and apparatus for managing private server dependency source code, which achieves the effect of unified management of third-party dependency source code and private dependency source code by building a private server dependency source code repository.

[0006] This application provides a method and apparatus for managing private server dependency source code, implemented as follows:

[0007] A method for managing the source code dependencies of a private server includes:

[0008] Create a private repository for the source code dependencies of the target source code management system;

[0009] Obtain the index file of the third-party dependency code from the target source code management system;

[0010] Based on the index file of the third-party dependency code, construct the target code project;

[0011] Based on the address of the target code project, upload the external dependency index source code to the private server dependency source code repository;

[0012] Based on the external dependency index source code, obtain the address of the third-party dependency source code;

[0013] According to the address of the third-party dependency source code, upload the third-party dependency source code to the private server dependency source code repository;

[0014] Create an index file for the private dependency code of the target source code management system;

[0015] Upload the private index source code and private dependency source code to the private server dependency source code repository through the index file of the private dependency code;

[0016] Based on the external dependency index source code in the private server dependency source code repository, the third-party dependency source code in the private server dependency source code repository is called; based on the private index source code in the private server dependency source code repository, the private server dependency source code in the private server dependency source code repository is called.

[0017] In one implementation, uploading the private index source code and private dependency source code to the private repository dependency source code via the index file of the private dependency code includes:

[0018] Verify the validity of the index file for the private dependency code;

[0019] If the index file of the private dependency code is valid, determine the name of the private repository for dependency source code and the upload path of the index file of the private dependency code;

[0020] Based on the name of the private server dependency source code repository and the upload path of the private dependency code index file, upload the private index source code and the private dependency source code to the private server dependency source code repository.

[0021] In one implementation, verifying the validity of the index file of the private dependency code includes:

[0022] Check the index file of the private dependency code for syntax errors;

[0023] Check whether the private dependency source code in the index file of the private dependency code can be successfully compiled.

[0024] In one implementation, after verifying the validity of the index file of the private dependency code, the method further includes:

[0025] If the index file of the private dependency code is invalid, determine the problem type and location of the problem in the index file of the private dependency code based on the error information in the verification results;

[0026] Based on the type of problem and the location where the problem occurred, the problem was corrected.

[0027] Re-verify the validity of the index file for the private dependency code until the verification passes.

[0028] In one implementation, before calling the third-party dependency source code in the private server dependency source code repository based on the external dependency index source code in the private server dependency source code repository, and before calling the private dependency source code in the private server dependency source code repository based on the private index source code in the private server dependency source code repository, the method further includes:

[0029] Configure user access permissions and audit logs for the private server's dependent source code repository, wherein different users are configured with different access permissions to the private server's dependent source code repository;

[0030] Access control is implemented for users based on the aforementioned user access permissions and audit logs.

[0031] In one implementation, calling third-party dependency source code in the private server dependency source code repository based on the external dependency index source code in the private server dependency source code repository, and calling private server dependency source code in the private server dependency source code repository based on the private index source code in the private server dependency source code repository, includes:

[0032] Obtain the address of the external dependency index source code corresponding to the third-party dependency source code and / or the address of the private index source code corresponding to the private dependency source code;

[0033] Based on the address of the external dependency index source code, obtain the corresponding third-party dependency source code;

[0034] Based on the address of the private index source code, obtain the corresponding private dependency source code;

[0035] Install, compile, and package the obtained third-party and / or private dependency source code.

[0036] A management device for private server dependencies, comprising:

[0037] The first creation module is used to create a private repository of source code that the target source code management system depends on.

[0038] The first acquisition module is used to acquire the index files of third-party dependency code from the target source code management system;

[0039] The second creation module is used to build the target code project based on the index file of the third-party dependency code;

[0040] The first upload module is used to upload the external dependency index source code to the private server dependency source code repository according to the address of the target code project.

[0041] The second acquisition module is used to obtain the address of the third-party dependency source code based on the external dependency index source code;

[0042] The second upload module is used to upload the third-party dependency source code to the private server dependency source code repository according to the address of the third-party dependency source code;

[0043] The third creation module is used to create index files for the private dependency code of the target source code management system;

[0044] The third upload module is used to upload the private index source code and the private dependency source code to the private server dependency source code repository through the index file of the private dependency code;

[0045] The calling module is used to call the third-party dependency source code in the private server dependency source code repository based on the external dependency index source code in the private server dependency source code repository, and to call the private server dependency source code in the private server dependency source code repository based on the private index source code in the private server dependency source code repository.

[0046] An electronic device includes a processor and a memory for storing processor-executable instructions, wherein the processor, when executing the instructions, implements the steps of any of the methods described above.

[0047] A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of any of the methods described above.

[0048] A computer program product comprising a computer program that, when executed by a processor, implements the steps of any of the methods described above.

[0049] This application provides a method and apparatus for managing private server dependency source code, comprising: creating a private server dependency source code repository for a target source code management system; obtaining an index file of third-party dependency code from the target source code management system; constructing a target code project based on the index file of the third-party dependency code; uploading external dependency index source code to the private server dependency source code repository based on the address of the target code project; obtaining the address of the third-party dependency source code based on the external dependency index source code; uploading the third-party dependency source code to the private server dependency source code repository based on the address of the third-party dependency source code; creating an index file of private dependency code from the target source code management system; uploading private index source code and private dependency source code to the private server dependency source code repository through the index file of the private dependency code; calling the third-party dependency source code in the private server dependency source code repository based on the external dependency index source code in the private server dependency source code repository, and calling the private dependency source code in the private server dependency source code repository based on the private index source code in the private server dependency source code repository. This solution allows for unified management of third-party dependency source code and private dependency source code, improving the development efficiency of project teams. Attached Figure Description

[0050] To more clearly illustrate the embodiments of this specification, the accompanying drawings used in the embodiments will be briefly introduced below. The drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 This is a flowchart of one embodiment of the method for managing private server dependency source code provided in this application;

[0052] Figure 2 This is a flowchart illustrating one embodiment of the method for managing private server dependency source code provided in this application;

[0053] Figure 3 This is a hardware structure block diagram of an electronic device for a method of managing private server dependency source code provided in this application;

[0054] Figure 4 This is a schematic diagram of the module structure of one embodiment of the management device for private server dependency source code provided in this application. Detailed Implementation

[0055] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0056] To address the issues of insecurely obtaining third-party dependency source code and unifying the management of internal and third-party dependency source code in existing methods of directly accessing external third-party libraries, this application provides a method for managing private server dependency source code. While this application provides method operation steps or device structures as shown in the following embodiments or accompanying drawings, the method or device may include more or fewer operation steps or module units based on conventional or non-inventive effort. In steps or structures where there is no logically necessary causal relationship, the execution order of these steps or the module structure of the device are not limited to the execution order or module structure described in the embodiments and accompanying drawings of this application. When the method or module structure is applied in actual devices or terminal products, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiments or accompanying drawings (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed processing environment).

[0057] Specifically, such as Figure 1As shown, the above-mentioned method for managing the source code dependencies of private servers may include the following steps:

[0058] S101: Create a private repository for the source code of the target source code management system.

[0059] Specifically, the private repository depends on the source code repository, which can be a CocoaPods private repository built on the intranet.

[0060] S102: Obtain the index file of the third-party dependency code from the target source code management system.

[0061] Specifically, the index file of the third-party dependency code contains detailed information about the third-party dependency code, such as the author, version, and address of the third-party dependency code.

[0062] S103: Construct the target code project based on the index file of the third-party dependency code.

[0063] Specifically, a target code project can be created to store the index file of the third-party dependency code through the index file of the third-party dependency code. The target code project can be created on GitHub, which is deployed in a proxy server.

[0064] S104: Based on the address of the target code project, upload the external dependency index source code to the private server dependency source code repository.

[0065] Specifically, after obtaining the address of the target code project, the target code project can be uploaded to the private repository's dependency source code repository using a GitHub synchronization tool. Uploading the target code project is equivalent to uploading the external dependency index source code.

[0066] S105: Obtain the address of the third-party dependency source code based on the external dependency index source code.

[0067] Specifically, after the external dependency index source code is successfully synchronized, the external dependency index source code can be added to a compilation and packaging module. Then, the compilation and packaging module searches for the third-party dependency source code required in the project based on the external dependency index source code and obtains the address of the third-party dependency source code.

[0068] S106: Upload the third-party dependency source code to the private server dependency source code repository according to the address of the third-party dependency source code.

[0069] Specifically, the source code of the third-party dependencies can be uploaded to the private repository using a GitHub synchronization tool.

[0070] S107: Create an index file for the private dependency code of the target source code management system.

[0071] Specifically, an index file for private dependency code can be created based on the private dependency source code project and the private index source code project. The index file for private dependency code describes detailed information about the private dependency source code, such as name, version, and dependencies.

[0072] S108: Upload the private index source code and private dependency source code to the private server dependency source code repository through the index file of the private dependency code.

[0073] Specifically, before uploading the private index source code and private dependency source code, the index file of the private dependency code needs to be verified. If the index file of the private dependency code is valid, the private index source code and private dependency source code are uploaded to the private server dependency source code repository using the index file. This includes: verifying the validity of the index file of the private dependency code; if the index file of the private dependency code is valid, determining the name of the private server dependency source code repository and the upload path of the index file of the private dependency code; and uploading the private index source code and private dependency source code to the private server dependency source code repository according to the name of the private server dependency source code repository and the upload path of the index file of the private dependency code.

[0074] Furthermore, after verifying the validity of the private dependency code index file, the method further includes: if the private dependency code index file is invalid, determining the problem type and location of the problem in the private dependency code index file based on the error information in the verification result; correcting the problem based on the problem type and location; and verifying the validity of the private dependency code index file again until the verification passes.

[0075] S109: Based on the external dependency index source code in the private server dependency source code repository, call the third-party dependency source code in the private server dependency source code repository; based on the private index source code in the private server dependency source code repository, call the private server dependency source code in the private server dependency source code repository.

[0076] To ensure that only authorized users can access, upload, and download third-party and private dependency source code in the private server's dependency source code repository, access control can be configured for the private dependency source code repository. Specifically, user access permissions and audit logs can be configured for the private server dependency source code repository. Different users are configured with different access permissions for the private server dependency source code repository. Then, based on the user access permissions and audit logs, access control is implemented for user access. This access control mechanism can protect the data security of the private dependency source code repository and prevent unauthorized user access and malicious attacks.

[0077] Furthermore, based on the external dependency index source code in the private server dependency source code repository, the third-party dependency source code in the private server dependency source code repository is invoked, and based on the private index source code in the private server dependency source code repository, the private server dependency source code in the private server dependency source code repository is invoked. This includes: obtaining the address of the external dependency index source code corresponding to the third-party dependency source code and / or the address of the private index source code corresponding to the private dependency source code; obtaining the corresponding third-party dependency source code based on the address of the external dependency index source code; obtaining the corresponding private dependency source code based on the address of the private index source code; and installing, compiling, and packaging the obtained third-party dependency source code and / or private dependency source code.

[0078] The above method will be described below with reference to a specific embodiment. However, it is worth noting that this specific embodiment is only for better illustration of this application and does not constitute an improper limitation of this application.

[0079] In this embodiment, considering the existing methods of directly accessing external third-party libraries, which have the problems of not being able to securely obtain third-party dependency source code and uniformly manage internal and third-party dependency source code, the third-party dependency source code and private dependency source code are uniformly uploaded to a private server dependency source code repository on the intranet for unified management. Access control is configured for the private server dependency source code repository to ensure that only authorized users can access, upload, and download the dependency source code in the repository, preventing unauthorized access and malicious attacks. By configuring access permissions and audit log functions for the private server dependency source code repository, user behavior can be monitored and traced, ensuring the secure and stable operation of the private server dependency source code repository.

[0080] This embodiment manages the private server's dependency source code in an intranet environment, including three parts: synchronizing the external dependency index source code and external third-party dependency source code resources, uploading the private dependency source code to the private server dependency source code repository, and how to install and use the third-party dependency source code and private dependency source code resources during compilation and packaging.

[0081] S1: Synchronize external dependency index source code and third-party dependency source code resources.

[0082] First, the private repository creates a target code project based on the source code repository. This target project stores an index file containing all third-party dependency code projects that can be managed by the private repository's dependency source code repository. The index file contains detailed information about the third-party dependency code, such as author, version, and address.

[0083] Synchronizing external dependency index source code means synchronizing the target code project. Specifically, this includes: copying the address of the target code project, and synchronizing the target code repository to the internal private repository using a GitHub synchronization tool. The GitHub synchronization tool is deployed on a proxy server and can access external resources through GitHub to synchronize external resources to the internal private repository.

[0084] After the external dependency index source code is successfully synchronized, it is added to the development team's compilation and packaging computer. The source code of the third-party dependency required in the project is searched for, the address of the third-party dependency source code on GitHub is obtained, and then the third-party dependency source code is synchronized to the internal private network dependency source code repository using the GitHub synchronization tool.

[0085] S2: Upload the private dependency source code to the private server dependency source code repository.

[0086] First, create an index file based on the private index source code project and the private dependency source code project. This file describes the detailed information of the dependency source code, such as name, version, and dependencies. Then, determine the name of the private repository dependency source code repository and the path of the index file. Upload the private index source code and the private dependency source code to the private repository dependency source code repository through the index file.

[0087] Before uploading the private index source code and private dependency source code, you can first verify whether the index file is valid. Specifically, you can first check whether there are any syntax errors in the index file. Then, based on the dependencies in the index file, you can find the corresponding version in the remote repository and copy it to the local machine for configuration. Finally, you can try to compile the private dependency source code to ensure that all the code can be compiled successfully.

[0088] Furthermore, if the index file verification fails, the cause of the problem is determined based on the error information in the verification results, the problem is corrected, and the corrected index file is verified again until all checks pass.

[0089] S3: Install and use the dependency source code from the private server's dependency source code repository.

[0090] Obtain the address of the external dependency index source code corresponding to the third-party dependency source code and / or the address of the private index source code corresponding to the private dependency source code; obtain the corresponding third-party dependency source code based on the address of the external dependency index source code; obtain the corresponding private dependency source code based on the address of the private index source code; install, compile, and package the obtained third-party dependency source code and / or private dependency source code. Specifically, Xcode or DevOps pipeline can be used for compilation and packaging.

[0091] The following is a specific example illustrating the management method for the aforementioned private server dependency source code:

[0092] Specifically, such as Figure 2 As shown, this embodiment uses the CocoaPods dependency management tool in an intranet environment, including three parts: synchronizing the external dependency index spec source code and external third-party dependency source code resources, uploading the dependency source code created by the internal development team to the CocoaPods private repository, and how to install and use the dependency source code resources when compiling and packaging an iOS project.

[0093] CocoaPods manages dependencies in two parts: an index, which can be understood as a table of contents for a book and stores the addresses of dependent library resources; and the dependent library resources themselves, including the library's source code, resource files, and configuration files. Internal CocoaPods private repositories need to cache both the index and dependent library resources.

[0094] S1: Synchronize external dependency index source code and third-party dependency source code resources.

[0095] The external dependency index source code is a spec code project created by CocoaPods on GitHub. It stores podspec files for all third-party dependency code projects that can be managed by CocoaPods. Each podspec file contains detailed information about the third-party dependency code, such as author, version, and address. Synchronizing the external dependency index source code involves synchronizing this spec code project. First, copy the spec code project address. Then, use a GitHub synchronization tool to synchronize the spec code project to the internal CocoaPods private repository. This GitHub synchronization tool is deployed on a proxy server and can be used to access external resources for synchronizing them to the internal CocoaPods private repository.

[0096] After successfully synchronizing the external dependency index source code, use the `pod repo add` command to add the index source code to the development team's compilation and packaging computer. Then, use the `pod search` command to search for the third-party dependency source code needed in the project, obtain the address of the dependency source code on GitHub, and continue to use the GitHub synchronization tool to synchronize the dependency source code to the internal CocoaPods private repository.

[0097] S2: The dependency source code created by the internal development team is uploaded to the CocoaPods private repository.

[0098] First, upload the internal private specs index source code to the CocoaPods private repository. Then, prepare the .podspec file, which describes the detailed information of the dependent source code, such as name, version, and dependencies. Finally, use the pod repo push command to upload the dependent source code to the CocoaPods private repository, specifying the name of the private repository and the path to the .podspec file.

[0099] Before uploading dependency source code, you can use the `pod spec lint` command to verify whether the `.podspec` file is valid, so as to discover and fix potential problems in advance.

[0100] Running the `pod spec lint` command on the aforementioned index file will perform a series of checks:

[0101] First, it checks the .podspec file for syntax errors. Then, based on the dependencies in the podspec file, it finds the corresponding version in the remote repository and copies it to the local machine for configuration. Finally, it attempts to compile the project's dependency source code to ensure that all code can be compiled successfully.

[0102] If problems are found during the check, `pod spec lint` will output detailed error messages, indicating the nature of the problem, such as incorrect dependencies or the source code failing to compile. For example, if a dependency in the `.podspec` file is incorrect, such as `spec.dependency 'WrongDependency', '~>1.0'` instead of the existing library `CorrectDependency`, then running `pod spec lintMyLibrary.podspec` will result in an error message similar to the following:

[0103] ERROR|[MyLibrary / Dependencies]Unable to find a specification for`WrongDependency`(~>1.0)

[0104] At this point, you can know that the dependency is incorrect and needs to be corrected. Then, run `pod spec lint` again to check until all checks pass.

[0105] S3: How to install and use dependent source code resources.

[0106] First, in the Podfile of the project that needs to be compiled and packaged, specify the address of the private repository index source code, including the address of the external index source code synchronized in the first step and the address of the internal private index source code in the second step. Then, execute the podinstall command to install the dependency source code specified in the Podfile. Finally, use Xcode on the development team's computer to compile and package, or directly use the DevOps pipeline to compile and package.

[0107] In the above embodiments, by uniformly uploading third-party dependency source code and private dependency source code to a private server dependency source code repository on the intranet, unified management of third-party dependency source code and private dependency source code is achieved. Access control is configured for the private server dependency source code repository to ensure that only authorized users can access, upload, and download dependency source code in the repository, preventing unauthorized access and malicious attacks. Furthermore, by configuring access permissions and audit log functions for the private server dependency source code repository, user behavior can be monitored and traced, ensuring the secure and stable operation of the private server dependency source code repository.

[0108] The methods and embodiments provided in the above-described embodiments of this application can be executed in a mobile terminal, computer terminal, or similar computing device. Taking its operation on an electronic device as an example... Figure 3 This is a hardware structure block diagram of an electronic device for a method of managing private server dependency source code provided in this application. For example... Figure 3 As shown, the electronic device 10 may include one or more (only one is shown in the figure) processors 02 (processors 02 may include, but are not limited to, microprocessors MCUs or programmable logic devices FPGAs, etc.), a memory 04 for storing data, and a transmission module 06 for communication functions. Those skilled in the art will understand that... Figure 3 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, electronic device 10 may also include... Figure 3 The more or fewer components shown, or having the same Figure 3 The different configurations shown.

[0109] The memory 04 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the private server dependency source code management method in this embodiment. The processor 02 executes various functional applications and data processing by running the software programs and modules stored in the memory 04, thereby implementing the aforementioned application private server dependency source code management method. The memory 04 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 04 may further include memory remotely located relative to the processor 02, and these remote memories can be connected to the electronic device 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0110] The transmission module 06 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the electronic device 10. In one example, the transmission module 06 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission module 06 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0111] At the software level, the aforementioned private server-dependent source code management devices can, as follows: Figure 4 As shown, it includes:

[0112] The first creation module 401 is used to create a private repository of dependent source code for the target source code management system;

[0113] The first acquisition module 402 is used to acquire the index file of the third-party dependency code of the target source code management system;

[0114] The second creation module 403 is used to construct the target code project based on the index file of the third-party dependency code;

[0115] The first upload module 404 is used to upload the external dependency index source code to the private server dependency source code repository according to the address of the target code project.

[0116] The second acquisition module 405 is used to obtain the address of the third-party dependency source code based on the external dependency index source code;

[0117] The second upload module 406 is used to upload the third-party dependency source code to the private server dependency source code repository according to the address of the third-party dependency source code;

[0118] The third creation module 407 is used to create an index file for the private dependency code of the target source code management system;

[0119] The third upload module 408 is used to upload the private index source code and the private dependency source code to the private server dependency source code repository through the index file of the private dependency code;

[0120] The calling module 409 is used to call the third-party dependency source code in the private server dependency source code repository based on the external dependency index source code in the private server dependency source code repository, and to call the private server dependency source code in the private server dependency source code repository based on the private index source code in the private server dependency source code repository.

[0121] In one implementation, the third upload module 408 uploads the private index source code and the private dependency source code to the private server dependency source code repository via the index file of the private dependency code, including:

[0122] Verify the validity of the index file for the private dependency code;

[0123] If the index file of the private dependency code is valid, determine the name of the private repository for dependency source code and the upload path of the index file of the private dependency code;

[0124] Based on the name of the private server dependency source code repository and the upload path of the private dependency code index file, upload the private index source code and the private dependency source code to the private server dependency source code repository.

[0125] In one implementation, verifying the validity of the index file of the private dependency code includes:

[0126] Check the index file of the private dependency code for syntax errors;

[0127] Check whether the private dependency source code in the index file of the private dependency code can be successfully compiled.

[0128] In one implementation, after verifying the validity of the index file of the private dependency code, the method further includes:

[0129] If the index file of the private dependency code is invalid, determine the problem type and location of the problem in the index file of the private dependency code based on the error information in the verification results;

[0130] Based on the type of problem and the location where the problem occurred, the problem was corrected.

[0131] Re-verify the validity of the index file for the private dependency code until the verification passes.

[0132] In one implementation, before the calling module 409 calls the third-party dependency source code in the private server dependency source code repository based on the external dependency index source code in the private server dependency source code repository, and before calling the private dependency source code in the private server dependency source code repository based on the private index source code in the private server dependency source code repository, it further includes:

[0133] Configure user access permissions and audit logs for the private server's dependent source code repository, wherein different users are configured with different access permissions to the private server's dependent source code repository;

[0134] Access control is implemented for users based on the aforementioned user access permissions and audit logs.

[0135] In one implementation, the calling module 409 calls third-party dependency source code in the private server dependency source code repository based on the external dependency index source code in the private server dependency source code repository, and calls private server dependency source code in the private server dependency source code repository based on the private index source code in the private server dependency source code repository, including:

[0136] Obtain the address of the external dependency index source code corresponding to the third-party dependency source code and / or the address of the private index source code corresponding to the private dependency source code;

[0137] Based on the address of the external dependency index source code, obtain the corresponding third-party dependency source code;

[0138] Based on the address of the private index source code, obtain the corresponding private dependency source code;

[0139] Install, compile, and package the obtained third-party and / or private dependency source code.

[0140] The embodiments of this application also provide a specific implementation of an electronic device capable of implementing all steps of the private server dependency source code management method in the above embodiments. The electronic device specifically includes: a processor, a memory, a communication interface, and a bus; wherein the processor, memory, and communication interface communicate with each other through the bus; the processor is used to call a computer program in the memory, and when the processor executes the computer program, it implements all steps of the private server dependency source code management method in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:

[0141] Step 1: Create a private repository for the source code of the target source code management system;

[0142] Step 2: Obtain the index file of the third-party dependency code from the target source code management system;

[0143] Step 3: Based on the index file of the third-party dependency code, construct the target code project;

[0144] Step 4: Based on the address of the target code project, upload the external dependency index source code to the private server dependency source code repository;

[0145] Step 5: Obtain the address of the third-party dependency source code based on the external dependency index source code;

[0146] Step 6: Upload the third-party dependency source code to the private server dependency source code repository according to the address of the third-party dependency source code;

[0147] Step 7: Create an index file for the private dependency code of the target source code management system;

[0148] Step 8: Upload the private index source code and private dependency source code to the private server dependency source code repository using the index file of the private dependency code;

[0149] Step 9: Based on the external dependency index source code in the private server dependency source code repository, call the third-party dependency source code in the private server dependency source code repository; based on the private index source code in the private server dependency source code repository, call the private server dependency source code in the private server dependency source code repository.

[0150] Embodiments of this application also provide a computer-readable storage medium capable of implementing all steps of the private server dependency source code management method in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the private server dependency source code management method in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:

[0151] Step 1: Create a private repository for the source code of the target source code management system;

[0152] Step 2: Obtain the index file of the third-party dependency code from the target source code management system;

[0153] Step 3: Based on the index file of the third-party dependency code, construct the target code project;

[0154] Step 4: Based on the address of the target code project, upload the external dependency index source code to the private server dependency source code repository;

[0155] Step 5: Obtain the address of the third-party dependency source code based on the external dependency index source code;

[0156] Step 6: Upload the third-party dependency source code to the private server dependency source code repository according to the address of the third-party dependency source code;

[0157] Step 7: Create an index file for the private dependency code of the target source code management system;

[0158] Step 8: Upload the private index source code and private dependency source code to the private server dependency source code repository using the index file of the private dependency code;

[0159] Step 9: Based on the external dependency index source code in the private server dependency source code repository, call the third-party dependency source code in the private server dependency source code repository; based on the private index source code in the private server dependency source code repository, call the private server dependency source code in the private server dependency source code repository.

[0160] As described above, this embodiment of the application achieves the following: First, it creates a private repository for the target source code management system's dependency source code. Second, it obtains an index file of the target source code management system's third-party dependency code. Third, it constructs a target code project based on the index file of the third-party dependency code. Fourth, it uploads the external dependency index source code to the private repository based on the address of the target code project. Fifth, it obtains the address of the third-party dependency source code based on the external dependency index source code. Sixth, it uploads the third-party dependency source code to the private repository based on the address of the third-party dependency source code. Finally, it creates an index file for the target source code management system's private dependency code. Seventh, it uploads the private index source code and private dependency source code to the private repository based on the index file of the private dependency code. Finally, it calls the third-party dependency source code in the private repository based on the external dependency index source code in the private repository, and calls the private dependency source code in the private repository based on the private index source code in the private repository. This solution allows for unified management of third-party and private dependency source code, improving the development efficiency of the project team.

[0161] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, hardware + program embodiments are relatively simple in description because they are fundamentally similar to method embodiments; relevant parts can be referred to the descriptions in the method embodiments.

[0162] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0163] While this application provides the method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive labor. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual device or client product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).

[0164] While this specification provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual device or end product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in the process, method, product, or apparatus that includes said elements is not excluded.

[0165] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing the embodiments of this specification, the functions of each module can be implemented in one or more software and / or hardware components, or a module that performs the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.

[0166] Those skilled in the art will also know that, besides implementing the controller using purely computer-readable program code, the same functions can be achieved by logically programming the method steps, making the controller function as logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers (PLCs), and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the devices within it used to implement various functions can also be considered structures within that hardware component. Alternatively, the devices used to implement various functions can be considered as both software modules implementing the method and structures within a hardware component.

[0167] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0168] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the embodiments of this specification can take the form of computer program products implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0169] The embodiments described in this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. The embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0170] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the embodiments in this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0171] The above description is merely an embodiment of the present specification and is not intended to limit the embodiments of the present specification. For those skilled in the art, various modifications and variations can be made to the embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the embodiments of the present specification should be included within the scope of the claims of the embodiments of the present specification.

Claims

1. A method for managing source code dependencies of a private server, characterized in that, include: Create a private repository for the source code dependencies of the target source code management system; Obtain the index file of the third-party dependency code from the target source code management system; Based on the index file of the third-party dependency code, construct the target code project; Based on the address of the target code project, upload the external dependency index source code to the private server dependency source code repository; Based on the external dependency index source code, obtain the address of the third-party dependency source code; According to the address of the third-party dependency source code, upload the third-party dependency source code to the private server dependency source code repository; Create an index file for the private dependency code of the target source code management system; Upload the private index source code and private dependency source code to the private server dependency source code repository through the index file of the private dependency code; Based on the external dependency index source code in the private server dependency source code repository, the third-party dependency source code in the private server dependency source code repository is called; based on the private index source code in the private server dependency source code repository, the private server dependency source code in the private server dependency source code repository is called.

2. The method according to claim 1, characterized in that, Upload the private index source code and private dependency source code to the private repository using the index file of the private dependency code, including: Verify the validity of the index file for the private dependency code; If the index file of the private dependency code is valid, determine the name of the private repository for dependency source code and the upload path of the index file of the private dependency code; Based on the name of the private server dependency source code repository and the upload path of the private dependency code index file, upload the private index source code and the private dependency source code to the private server dependency source code repository.

3. The method according to claim 2, characterized in that, Verifying the validity of the index file for the private dependency code includes: Check the index file of the private dependency code for syntax errors; Check whether the private dependency source code in the index file of the private dependency code can be successfully compiled.

4. The method according to claim 2, characterized in that, After verifying the validity of the index file of the private dependency code, the process also includes: If the index file of the private dependency code is invalid, determine the problem type and location of the problem in the index file of the private dependency code based on the error information in the verification results; Based on the type of problem and the location where the problem occurred, the problem was corrected. Re-verify the validity of the index file for the private dependency code until the verification passes.

5. The method according to claim 1, characterized in that, Before calling the third-party dependency source code in the private server dependency source code repository based on the external dependency index source code in the private server dependency source code repository, and before calling the private server dependency source code in the private server dependency source code repository based on the private index source code in the private server dependency source code repository, the following steps are also included: Configure user access permissions and audit logs for the private server's dependent source code repository, wherein different users are configured with different access permissions to the private server's dependent source code repository; Access control is implemented for users based on the aforementioned user access permissions and audit logs.

6. The method according to claim 5, characterized in that, Based on the external dependency index source code in the private server dependency source code repository, the third-party dependency source code in the private server dependency source code repository is called; based on the private index source code in the private server dependency source code repository, the private server dependency source code in the private server dependency source code repository is called, including: Obtain the address of the external dependency index source code corresponding to the third-party dependency source code and / or the address of the private index source code corresponding to the private dependency source code; Based on the address of the external dependency index source code, obtain the corresponding third-party dependency source code; Based on the address of the private index source code, obtain the corresponding private dependency source code; Install, compile, and package the obtained third-party and / or private dependency source code.

7. A management device for private server source code, characterized in that, include: The first creation module is used to create a private repository of source code that the target source code management system depends on. The first acquisition module is used to acquire the index files of third-party dependency code from the target source code management system; The second creation module is used to build the target code project based on the index file of the third-party dependency code; The first upload module is used to upload the external dependency index source code to the private server dependency source code repository according to the address of the target code project. The second acquisition module is used to obtain the address of the third-party dependency source code based on the external dependency index source code; The second upload module is used to upload the third-party dependency source code to the private server dependency source code repository according to the address of the third-party dependency source code; The third creation module is used to create index files for the private dependency code of the target source code management system; The third upload module is used to upload the private index source code and the private dependency source code to the private server dependency source code repository through the index file of the private dependency code; The calling module is used to call the third-party dependency source code in the private server dependency source code repository based on the external dependency index source code in the private server dependency source code repository, and to call the private server dependency source code in the private server dependency source code repository based on the private index source code in the private server dependency source code repository.

8. An electronic device comprising a processor and a memory for storing processor-executable instructions, characterized in that, When the processor executes the instructions, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium storing computer instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • File acquisition method and device, electronic equipment and readable storage medium

    CN116361242A

  • Dependence introduction method and device, medium and electronic equipment

    CN116521175A