* fix(lint): silence G122 on dolt cache cleanup remove
golangci-lint v2.11.4 (released recently) enabled a new gosec check:
G122: Filesystem operation in filepath.Walk/WalkDir callback uses
race-prone path; consider root-scoped APIs (e.g. os.Root) to prevent
symlink TOCTOU traversal (gosec)
This flags the `os.Remove(path)` inside cleanGitRemoteCacheGarbage.
Main went red on the Lint job with no code change to blame — it broke
on every PR that rebased past the golangci-lint bump.
The warning is not applicable here: the walk root is
`<beadsDir>/<database>/.dolt/git-remote-cache/`, owned by the user
running bd. An attacker who can symlink-swap a tmp_pack_*/tmp_idx_*
file mid-walk already has write access to the Dolt data directory,
which is a much bigger compromise than cache_cleanup.go doing anything
unsafe.
Add a targeted `#nosec G122` with justification rather than refactor
to `os.Root`-scoped APIs, which would be a larger change against a
file that exists to clean up a 102 GB leak (GH#3354) and shouldn't
take on additional complexity for a hypothetical threat. Matches the
project's existing pattern of per-site gosec exceptions with rationale.
Verification:
golangci-lint run --timeout=5m --build-tags=gms_pure_go ./...
# 0 issues.
* fix(dolt): update shared-server credential tests for new per-remote signatures
Two tests added by #3223 (f9ec9859, 2026-04-13) were not updated when
#3211 (73d72ec0, 2026-04-20) widened the credential-routing guards to
take per-remote parameters. The resulting signature drift landed on
main and broke the build on ubuntu-latest and macos-latest:
internal/storage/dolt/credentials_test.go:445:39: not enough
arguments in call to store.shouldUseCLIForCredentials
internal/storage/dolt/credentials_test.go:486:6: not enough
arguments in call to store.shouldUseCLIForCloudAuth
Fix:
- TestCredentialCLIRoutingSharedServerUsesSharedDoltRoot:
pass store.remote and store.mainRemoteCredentials() to match the
new shouldUseCLIForCredentials(ctx, remote, creds) signature,
matching the pattern already used by the sibling
TestCredentialCLIRoutingExternalServer/NoRemote tests.
- TestCloudAuthCLIRoutingSharedServerUsesSharedDoltRoot:
pass store.remote to the new shouldUseCLIForCloudAuth(remote)
signature, and change the dolt remote URL from https:// to az://.
The old global "any cloud env var triggers CLI routing" heuristic
was replaced by per-scheme matching (AZURE_STORAGE_* only triggers
for az:// remotes, etc. — see the positive/negative cases in
TestCloudAuthCLIRouting). The test sets AZURE_STORAGE_ACCOUNT, so
the remote must be az:// for the assertion to hold.
Verification: both tests pass locally (`go test -tags gms_pure_go
-run 'SharedServerUsesSharedDoltRoot' ./internal/storage/dolt/`).