← Back to issue list

source-depth should propagate to git submodules

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1965792
Type
issue
State
open
Author
~itrue
Labels
—
Created
Updated
Closed
—

Current evaluation

Feature request: source-depth only shallow-clones the parent repo; git submodule update runs without --depth, so submodule-heavy builds (e.g. qt5) fetch full submodule history. Untriaged, no maintainer response.

Suggested action: needs triage

Reason: The issue is still reproducible at HEAD of the implementing library: craft_parts/sources/git_source.py builds `submodule update --init --recursive` (and `--recursive --force` in _pull_existing) with no `--depth`, while source_depth is only applied to the clone/fetch commands (lines 332-333, 416-417). It has no labels, no assignee and zero comments, so there is no sign of maintainer triage. It is a clearly scoped, verifiable request (append --depth to the submodule update command) that lands in craft-parts rather than snapcraft itself.

Evaluated by: mr-cal-bot

Impact: 40 Quick Win: 21 Complexity: 32 Confidence: 84 Actionability: 76

Issue body

Currently, specifying "source-depth: 1" only does a shallow checkout of the root repository. If there are any submodules, the entire submodule history is checked out. In a repository consisting largely of submodues (e.g. https://github.com/qt/qt5) this massively impacts the build time. Proposition: if "source-depth" is specified, "--depth" should also be added to the "git submodule update" command.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 40
Quick Win: 21
Complexity: 32
Confidence: 84
Actionability: 76
needs triage Feature request: source-depth only shallow-clones the parent repo; git submodule update runs without --depth, so submodule-heavy builds (e.g. qt5) fetch full submodule history. Untriaged, no maintainer response.
stealth/space-bunny-alpha
Impact: 35
Quick Win: 15
Complexity: 45
Confidence: 82
Actionability: 76
needs triage Feature request: `source-depth: 1` shallow-clones only the top-level repo; `git submodule update` runs without `--depth`, so submodule-heavy projects clone full history. No maintainer response yet.
stealth/space-bunny-alpha
Impact: 40
Quick Win: 24
Complexity: 28
Confidence: 93
Actionability: 84
needs triage source-depth still applies only to the parent repository; Git submodules are updated without --depth, so submodule-heavy builds retain full history and the issue needs triage.
qwen/qwen3.8-27b
Impact: 50
Quick Win: 28
Staleness: 90
Complexity: 45
Confidence: 75
Support Request: 10
needs triage Feature request: source-depth should also apply --depth to git submodule update so shallow clones don't fetch full submodule history (e.g. qt5). Unlabeled, zero comments, 1624 days old; craft-parts git source still lacks depth propagation to submodules.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 15
Confidence: 85
Support Request: 5
close stale Feature request to propagate shallow clone depth to git submodules. Unaddressed for over four years with no maintainer interaction or labels.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 30
Confidence: 85
Support Request: 10
close stale Request to propagate source-depth to git submodules. Unlabelled, zero comments, and inactive for over 4 years with no maintainer engagement.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 20
Confidence: 85
Support Request: 10
close stale Feature request to propagate source-depth to git submodules. Issue is four years old with zero comments or maintainer engagement.

Update history

Date Change
created

Related work

  • Related To: canonical/craft-parts#1476 (confidence 70%)

    Merged craft-parts PR touching the same source-depth shallow-fetch logic in git_source.py, but it does not propagate depth to submodules.

Related issues

Issue Project State Summary Similarity
#814 Make source-depth a parameter and opt-in snapcraft merged Merged #814 in commit 190463c3c, making source-depth an explicit, opt-in part property instead of enabling shallow Git clones by default.
71%
#1617783 Git clone with --depth=1 loses the tags snapcraft (launchpad) closed Fixed by merged PR snapcore/snapcraft#814 (commit 190463c3c): Git clones became full-depth by default, with source-depth available as an explicit opt-in.
70%
#1476 fix(git-source): only shallow fetch if a source-depth is provided craft-parts merged Merged as commit f1e2c927 (#1476): git-source now shallow-clones only when a non-zero source-depth is set, so full-hash source-commit no longer forces a shallow fetch. Released in craft-parts 2.28.1 and merged back via #1481.
70%