diff --git a/ddtrace/ext/git.py b/ddtrace/ext/git.py index 2db136a677c..0dc8da5192e 100644 --- a/ddtrace/ext/git.py +++ b/ddtrace/ext/git.py @@ -206,6 +206,7 @@ def _unshallow_repository_with_details( "--update-shallow", "--filter=blob:none", "--recurse-submodules=no", + "--no-tags", ] if repo is not None: cmd.append(repo) diff --git a/releasenotes/notes/ci_visibility-fix-unshallow-no-tags-bbe7e26aadcf250f.yaml b/releasenotes/notes/ci_visibility-fix-unshallow-no-tags-bbe7e26aadcf250f.yaml new file mode 100644 index 00000000000..7eac80ee926 --- /dev/null +++ b/releasenotes/notes/ci_visibility-fix-unshallow-no-tags-bbe7e26aadcf250f.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + CI Visibility: this fix resolves an issue where repo tags would be fetched while unshallowing to extract commit + metadata, causing performance issues for repos with a large number of tags. diff --git a/tests/ci_visibility/test_ci_visibility.py b/tests/ci_visibility/test_ci_visibility.py index 1b4c26b2943..dcce718e19d 100644 --- a/tests/ci_visibility/test_ci_visibility.py +++ b/tests/ci_visibility/test_ci_visibility.py @@ -1023,6 +1023,7 @@ def test_unshallow_repository_local_head(): "--update-shallow", "--filter=blob:none", "--recurse-submodules=no", + "--no-tags", "origin", "myfakesha", cwd="/path/to/repo", @@ -1051,6 +1052,7 @@ def test_unshallow_repository_upstream(): "--update-shallow", "--filter=blob:none", "--recurse-submodules=no", + "--no-tags", "origin", "myupstreamsha", cwd="/path/to/repo", @@ -1080,6 +1082,7 @@ def test_unshallow_repository_full(): "--update-shallow", "--filter=blob:none", "--recurse-submodules=no", + "--no-tags", "origin", cwd="/path/to/repo", ) diff --git a/tests/tracer/test_ci.py b/tests/tracer/test_ci.py index 07f360a6804..2bd347f221f 100644 --- a/tests/tracer/test_ci.py +++ b/tests/tracer/test_ci.py @@ -369,6 +369,7 @@ def test_unshallow_repository_bare(git_repo): "--update-shallow", "--filter=blob:none", "--recurse-submodules=no", + "--no-tags", cwd=git_repo, ) @@ -384,6 +385,7 @@ def test_unshallow_repository_bare_repo(git_repo): "--update-shallow", "--filter=blob:none", "--recurse-submodules=no", + "--no-tags", "myremote", cwd=git_repo, ) @@ -400,6 +402,7 @@ def test_unshallow_repository_bare_repo_refspec(git_repo): "--update-shallow", "--filter=blob:none", "--recurse-submodules=no", + "--no-tags", "myremote", "mycommitshaaaaaaaaaaaa123", cwd=git_repo,