Repository navigation
Conversation
Nothing outside tests calls them: the deploy lock only writes and reads deploy.lock itself, through Lock, Unlock and GetActiveLockState. Drop the part of the TestLock integration test that only checked them. Co-authored-by: Isaac <no-reply@databricks.com>
✅ Integration test reportCommit: 30bbf96
Top 6 slowest tests (at least 2 minutes):
|
There was a problem hiding this comment.
Automated review at 30bbf96. Each finding was verified against the code.
No blocking issues found.
This PR deletes the unused Locker.Write and Locker.Read methods from libs/locker, along with the part of the TestLock integration test that only exercised them. I found no remaining callers. Every import in locker.go is still used (bytes, io and errors all have other uses), and the trimmed test still covers which lockers are active, Unlock failing on inactive lockers, and the unlock/re-acquire round-trip. I have no defects to report; this looks good to merge.
andrewnester
left a comment
There was a problem hiding this comment.
No blocking findings from a full pass; I'll take a manual look at the locker changes before approving.
Changes
Locker.WriteandLocker.Readfromlibs/locker. They wrote and read an arbitrary file under the lock's directory, only while the lock was held. The deploy lock never used them: bundle commands only callCreateLocker,Lock,UnlockandActive, and the lock file itself goes through the locker's own filer.TestLockintegration test inintegration/libs/lockerthat only checked these two methods (an inactive locker can't write or read, an active one round-tripsfoo.json), plus its two now-unused imports. The rest ofTestLockis unchanged.Why
Code with no production callers can go along with the tests that only check it. This is part of replacing
integration/with acceptance tests (integration/README.md): these asserts tested code the CLI never runs, so there is nothing to port. It is kept separate from #8059 (the deploy-lock acceptance test) for easier review.Evidence that nothing else calls them
rg -n '\b[Ll]ocker\.(Write|Read)\(' --glob '*.go' --glob '!*_test.go'at main: no matches. In tests, the only callers were the four calls inintegration/libs/locker/locker_test.gothis PR deletes.failed to put file. deploy lock not heldandfailed to get file. deploy lock not heldappear nowhere else in the repo (code, goldens, docs).deadcode(the tool behindtask deadcode): CI runs it with-test, andTestLockwas what kept both methods live there. Without-test,deadcode -whylivereports both as "reachable only through reflection". The only reflective method lookups in the repo arelibs/calladapt(resource adapters'Do*methods) andbundle/internal/validation/enum.go(Values); neither is handed aLocker.*Lockeris never stored in an interface.go build ./...,go vet,task lint-go-rootandtools/check_deadcode.pypass, and the trimmedTestLockpasses on AWS.Tests
TestLock(integration, AWS):--- PASS: TestLock (3.19s)after the change.go test ./libs/locker: pass.Judgment calls
TestLockkeeps two checks that the CLI calls but never reaches in the tested state: five lockers racing in one process, andUnlockon a locker that never acquired. Those are a separate question and stay in place.integration/libs/locker/locker_test.goon adjacent lines, so whichever merges second needs a trivial rebase.This PR was created by the integration-deprecation loop.
🤖 AI agent (opus5.5, isaac_claude)
This pull request and its description were written by Isaac.