nextflow-io / nextflow-io/nextflow

Support shallow clones of submodules

Open
#6,301 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue software/git
Dominant language
Groovy
Stars
3.5k
Forks
811
Avg merge
2d 11h
Merged PRs (30d)
61

Description

New feature

Hey! There is a CLI argument to clone repositories at a specified depth in a nextflow run call:

    -d, -deep
       Create a shallow clone of the specified depth

but it seems like this does not propagate to any git submodules. Additionally, submodule configuration for shallow clones via the shallow = true configuration option in a .gitmodules file does not seem to be honored.

I propose that the specified depth also apply to all git submodules in the cloned repository. I also propose that when not given as an argument the clone should honor the configuration option in the .gitmodules file for each submodule.

Use case

The pipeline we are developing has multiple submodules, some with a large git history (27k commits!). We also have a submodule that we use to share common test cases and associated data across multiple repositories (this one has 13k commits). We'd like to avoid cloning the entirety of the commit history for these repositories, since the only thing that matters in the context of a given nextflow run call is the specific commit being pointed to for each submodule.

Our current workaround is to clone the repository ahead of time with --shallow-submodules and then point to that path, but it would be nice to have it all configurable on the nextflow CLI.

Suggested implementation

I have tried looking through the source code in here related to cloning git repositories, as well as through jgit, which seems to be the library being used to orchestrate cloning. My java/groovy skills are not the greatest so correct me if I am wrong, but it seems like to me that jgit does not support shallow cloning of submodules or setting submodule depths. I'm not sure what the best path forward is with that in mind.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Nextflow CLI handling for nextflow run and the Git cloning implementation, then verify the available JGit support for submodule depth and .gitmodules settings. Done means the requested depth propagates to submodules and, when no CLI depth is given, each submodule's shallow = true setting is honored.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, groovy
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.