Skip to content

Support Shallow Clones for Git Submodules #26774

@squat

Description

@squat

Summary

ArgoCD recently added support for configuring the checkout depth of Git repositories, enabling shallow checkouts. This greatly improves the checkout performance for large monorepos. However, the depth option is not applied to submodule checkouts, meaning that monorepos with lots of submodules will still require the reposerver to download entire repository histories and will not benefit as much as possible from shallow clones.

Motivation

Our monorepo checkouts have benefited from setting depth: "1" but they are still very slow because the monorepo organizes code using tens of submodules, each of which has large histories that are downloaded in their entirety by the reposerver. The goal of this proposal is to optimize the checkout of Git submodules, to accelerate the downloading of huge monorepos with lots of submodules.

Proposal

I propose modifying the util/git.Client interface to allow plumbing the depth option through to the code that fetches submodules so that Argo can ultimately optionally add the --depth <depth> arguments to the git submodule update command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriage/pendingThis issue needs further triage to be correctly classified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions