Skip to content

build(deps): bump go-git v5.12.0 -> v5.19.2 and cover the go-git collector with tests - #9055

Merged
klesh merged 4 commits into
apache:mainfrom
DoDiODev:pr/wave4l-go-git
Aug 18, 2026
Merged

build(deps): bump go-git v5.12.0 -> v5.19.2 and cover the go-git collector with tests#9055
klesh merged 4 commits into
apache:mainfrom
DoDiODev:pr/wave4l-go-git

Conversation

@DoDiODev

Copy link
Copy Markdown
Contributor

Summary

Module From To
github.com/go-git/go-git/v5 v5.12.0 v5.19.2
github.com/go-git/go-billy/v5 v5.5.0 v5.9.0 (pulled in)
github.com/cloudflare/circl v1.3.7 v1.6.3 (pulled in)

16 known advisories across the three modules. govulncheck reports 12
reachable findings
before the bump (8 in go-git, 2 in go-billy, 2 in circl) and
none after. The go-git ones include GO-2025-3367 / GO-2025-3368 (argument
injection through crafted URLs) and GO-2026-4909 / GO-2026-4910.

Overall, govulncheck ./... in backend/ goes from 30 reachable findings on
upstream/main to 11 with this PR (remainder: go-jose/v3 2, jwt/v5 1 +
stdlib) — the MVS-driven x/crypto / x/net / x/text bump clears those too.

Where go-git is used

Exactly one file: plugins/gitextractor/parser/repo_gogit.go. It opens an
already cloned repository with PlainOpen and walks commits, tags, branches
and trees, and only when UseGoGit is set. Cloning is done by the git CLI
(parser.NewGitcliCloner), so the go-git transports are not on the path — this
bump does not change how DevLake talks to remotes.

Test coverage

That collector had no tests at all, which makes any go-git upgrade a leap of
faith. The first commit adds repo_gogit_test.go: it builds a repository on disk
with a known shape (3 commits, 1 tag, a second branch checked out so HEAD is not
the default branch) and asserts CountCommits, CountTags, CountBranches,
that the counting helpers stop on a cancelled context, and that opening a
non-repository fails.

The test is committed before the bump and passes on both v5.12.0 and
v5.19.2 — unchanged behaviour across the upgrade, and the history stays
bisectable.

Verification

  • go mod tidy — clean
  • go build ./... / make build — green
  • go test ./plugins/gitextractor/... — green on old and new version
  • govulncheck ./... — 12 → 0 reachable findings in these modules

Notes

MVS also pulls up x/crypto, x/net, x/sys, x/text, x/tools,
ProtonMail/go-crypto, pjbgf/sha1cd, skeema/knownhosts,
cyphar/filepath-securejoin, Microsoft/go-winio, klauspost/cpuid and
golang/protobuf.

CI

Verified on a fork run of the same workflows before opening this PR:
8/8 green
(lint, unit-test, e2e MySQL, migration-script-lint, config-ui, license header,
grafana dashboards, builder image).

The go-git based collector (used when UseGoGit is set) had no test
coverage at all, which makes any go-git upgrade a leap of faith.

Adds a test that builds a repository on disk with a known shape -- three
commits, one tag, a second branch checked out so HEAD is not the default
branch -- and asserts CountCommits, CountTags and CountBranches, that the
counting helpers stop on a cancelled context, and that opening a directory
which is not a repository fails.

The test passes both on go-git v5.12.0 and on the version this branch
upgrades to, so it documents unchanged behaviour across the bump.

Signed-off-by: DoDiODev <DoDiDev@proton.me>
  github.com/go-git/go-git/v5    v5.12.0 -> v5.19.2
  github.com/go-git/go-billy/v5  v5.5.0  -> v5.9.0   (pulled in)
  github.com/cloudflare/circl    v1.3.7  -> v1.6.3   (pulled in)

16 known CVEs in total across the three modules. govulncheck reports 12 of
them as reachable from this code base before the bump (8 in go-git, 2 in
go-billy, 2 in circl) and none after. The go-git ones include GO-2025-3367
and GO-2025-3368 (argument injection through crafted URLs) and
GO-2026-4909/4910.

go-git is used in exactly one place: plugins/gitextractor/parser/repo_gogit.go
opens an already cloned repository with PlainOpen and walks commits, tags,
branches and trees. Cloning is done by the git CLI (parser.NewGitcliCloner),
so the go-git transports are not on the path -- this bump does not change
how DevLake talks to remotes.

No source change was required. Verified with the collector test added in
the previous commit, which passes on both the old and the new version.

Minimal version selection also pulls up golang.org/x/crypto, x/net, x/sys,
x/text, x/tools, ProtonMail/go-crypto, pjbgf/sha1cd, skeema/knownhosts,
cyphar/filepath-securejoin, Microsoft/go-winio, klauspost/cpuid and
golang/protobuf.

Signed-off-by: DoDiODev <DoDiDev@proton.me>
klesh
klesh previously approved these changes Aug 18, 2026

@klesh klesh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks for your contribution.

# Conflicts:
#	backend/go.mod
#	backend/go.sum
@klesh
klesh merged commit fe357c0 into apache:main Aug 18, 2026
10 checks passed
@DoDiODev
DoDiODev deleted the pr/wave4l-go-git branch August 18, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants