Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7.7 KiB
Task 19 report: remove the old libraries
Status: DONE_WITH_CONCERNS (the one concern is a bisync test failure that was already there before this work; details below)
Commit: cf7577dc1 protondrive: drop Proton-API-Bridge and go-proton-api (base b667a1ab0)
What was done
- Moved these from
crypto_diff_internal_test.gointo the end ofcrypto_internal_test.go:oldLibDir,oldLibFixture,loadOldLibFixture,unlockedKeyRing,checkOldLibFixtureandTestFrozenFixtures.TestFrozenFixturesno longer has its-updatebranch, and theupdateOldLibflag is gone. Added theosandpath/filepathimports. TheoldLibDircomment now names the library versions. TestFrozenFileFixturewas already indownload_internal_test.goand is unchanged.- Deleted
crypto_diff_internal_test.gowithgit rm. - Ran
go mod tidy. The result is within the ruling (details below). - Docs, all in the same commit:
docs/TODO.md:- Closed (removed) the entry "when go-proton-api and Proton-API-Bridge
leave
go.mod" and the entry "go mod tidywould drop Proton-API-Bridge". - Changed the crypto-refresh entry to say
TestNewWriterOldReaderwas removed. - Added an entry for the lost coverage.
- Updated the "Now" entry to Tasks 1-19 done.
- Added a Known issues entry for the
cmd/bisyncfailure.
- Closed (removed) the entry "when go-proton-api and Proton-API-Bridge
leave
docs/ARCHITECTURE.md: removed the "Known rough edges" bullet about the old libraries.docs/DECISIONS.md: new entry "Proton Drive keeps frozen old-library fixtures, not the old library".docs/plans/001-protondrive-tier1.md: ticked Task 19's steps.- The handoff's current-state bullets no longer list the differential
file and no longer say the libraries are still in
go.mod.
- Left alone:
.claude/settings.jsonhas an uncommitted change (addsBash(golangci-lint run:*)to allow) that I did not make. It is not in the commit, and I did not editdocs/PERMISSIONS.mdfor it.
go.mod / go.sum
The tidy only removed lines. Nothing was added, upgraded or downgraded,
and there are no replace lines.
- Direct requirements removed:
github.com/rclone/Proton-API-Bridge v1.0.5github.com/rclone/go-proton-api v1.0.4github.com/relvacode/iso8601 v1.7.0(leftgo.modentirely)
- Indirect requirements removed:
ProtonMail/gluonPuerkitoBio/goqueryandybalholm/cascadiabradenaw/juniperemersion/go-messageemersion/go-vcardgo-resty/resty/v2sirupsen/logrus
go.mod: 11 deletions.go.sum: 20 deletions, covering the modules above.logrusstays ingo.sumbecause other modules'go.modfiles refer to it.grep -c 'Proton-API-Bridge\|rclone/go-proton-api\|replace' go.modprints0.
Binary size
Both binaries were built with plain go build -o <path> . and the same
Go 1.27.4.
| Build | Bytes |
|---|---|
Old: 06700aaf2 (old backend), built in a scratch worktree |
152,460,576 |
New: cf7577dc1 content |
148,995,400 |
The new binary is 3,465,176 bytes smaller (about 3.3 MiB). The saving comes from the backend rewrite as a whole. The libraries were already test-only before this task, so removing them does not change the binary.
Test coverage lost
These tests were deleted with the differential file:
TestNewWriterOldReader: the old library reads what the new writer writes.TestOldWriterNewReaderTestKeyUnlockMatchesOldLibraryTestUploadReadableByOldLibraryCryptoTestOldLibraryFileReadable: legacy and v6 formats at 0 B, 2500 B and 5 MiB + 3 B.
What remains is TestFrozenFixtures (one folder and one file node) and
TestFrozenFileFixture (legacy and v6 stored files). Both are single
block.
Lost as a result:
- Old-library files with several blocks.
- Empty old-library files.
- Any check that released rclone (v1.76 and older) can read what the new backend writes. This matters for users who downgrade.
All of this is logged in docs/TODO.md. The fixtures can no longer be
regenerated.
Verification (all run in this session)
go build ./...: okgo vet ./backend/protondrive/...: okgolangci-lint run ./backend/protondrive/...:0 issues.(re-run after the last doc edit too)gofmt -l backend/protondrive: emptyRCLONE_CONFIG=/notfound go test -count=1 -run TestFrozen -v ./backend/protondrive/:TestFrozenFixturesandTestFrozenFileFixturepass.RCLONE_CONFIG=/notfound go test -race -count=1 ./backend/protondrive/...(5m19s):backend/protondrive: ok, 316sprotontest: ok, 39.5sprotontest/cmd/protonfake: ok, 1.4s
- Cross-compile:
- Command:
mkdir build && go run bin/cross-compile.go -no-clean -compile-only v1.77.0-beta.task19. This is the Makefilecompile_allcommand.BUILD_FLAGS,BUILDTAGSandBUILD_ARGSare empty here. I used-no-cleanso the script would not runrm -rf builditself. - Result: "Compiled 29 arches in 10m33s", exit 0, no failures. These are
all the OS/arch pairs in
osarches: windows 386/amd64/arm64, darwin amd64/arm64, linux 386/amd64/arm/arm-v6/arm-v7/arm64/mips/mipsle, freebsd 386/amd64/arm/arm-v6/arm-v7, netbsd 386/amd64/arm/arm-v6/arm-v7, openbsd 386/amd64, plan9 386/amd64, solaris amd64, aix ppc64.js/wasmis commented out upstream. - Clean-up: removed
build/file by file withrmand thenrmdir.
- Command:
- Whole repo:
RCLONE_CONFIG=/notfound go test ./...(1m51s): 186 packages ok, 1 FAIL,cmd/bisync(TestRcBackupDir/backupDir1and/backupDir2: "unable to find file .../backup/file0.txt").- It fails every time: 3 more package runs and
-count=5all failed. - It fails the same way on unchanged HEAD
b667a1ab0and on the pre-rewrite base06700aaf2, both run in a scratch worktree that I removed afterwards. So it was already failing on this host before my change, or the host changed, and it is not a regression from this work. It only touches the local backend. - The baseline failure
cmd/serve/s3passed in this run. - Both facts are recorded under "Known issues" in
docs/TODO.md.
- It fails every time: 3 more package runs and
Commands run (in order, abridged)
git worktree add <scratch>/rclone-old 06700aaf2 && (cd <scratch>/rclone-old && go build -o <scratch>/rclone-old-bin .)
stat -c %s <scratch>/rclone-old-bin # 152460576
python3 (move fixture code into crypto_internal_test.go); git rm backend/protondrive/crypto_diff_internal_test.go
go mod tidy
grep -c 'Proton-API-Bridge\|rclone/go-proton-api\|replace' go.mod # 0
go build ./... && go vet ./backend/protondrive/... && go build -o <scratch>/rclone-new-bin . && stat -c %s ... # 148995400
RCLONE_CONFIG=/notfound go test -count=1 -run TestFrozen -v ./backend/protondrive/
RCLONE_CONFIG=/notfound go test -race -count=1 ./backend/protondrive/...
golangci-lint run ./backend/protondrive/...
git worktree remove <scratch>/rclone-old
mkdir build && go run bin/cross-compile.go -no-clean -compile-only v1.77.0-beta.task19 ; rm build files ; rmdir build/*/ build
RCLONE_CONFIG=/notfound go test ./...
RCLONE_CONFIG=/notfound go test -count=1 ./cmd/bisync/ (x3, plus -count=5 -run TestRcBackupDir)
git worktree add --detach <scratch>/rclone-head HEAD ; bisync tests ; git checkout --detach 06700aaf2 (in worktree) ; bisync tests ; git worktree remove <scratch>/rclone-head
<scratch> = /tmp/claude-1000/-home-user-rclone/8cc17642-4f33-4045-ad2c-177bf869b82a/scratchpad
Self-review
- The moved code is copied as it was. The only behaviour change is that
TestFrozenFixtureshas no-updatebranch. Commentfields in the fixture JSON may still mention the old library. That is intended: they describe where the data came from.- No remaining references to the deleted tests outside the historical plan and workspace files.