Releases: easyp-tech/server
Releases · easyp-tech/server
Release list
v0.3.9
Phase 18: respect buf.yaml dependency refs + prewarm removal (#38)
* docs(18): create phase plan
* test(18-01): add failing tests for isSHA, isUUID, parseResourceRefName ref
- TestIsSHA: 8 cases for the SHA-shape check (40/64 lowercase hex, reject refs and UUIDs)
- TestIsUUID: 6 cases for the 32-lowercase-hex check
- TestParseResourceRefName_ReadsRef: build a Name proto with ref=3, assert parsed
- TestParseResourceRefName_NoRef: build a Name proto without ref, assert ref=""
Tests fail at compile time: isSHA, isUUID, and moduleRef.ref do not exist yet.
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(18-01): honor Name.ref end-to-end + provider ref-resolution
Refs end-to-end:
- moduleRef gains a ref field (buf BSR Name.ref, proto field 3)
- parseResourceRefName reads field 3 (ref), keeps existing owner/module arms
- ServeHTTP and ServeGraph pass ref.ref to GetMeta (was ""), so a buf
client pinning cyp/cyp-net-listeners:main/v2 gets the SHA at main/v2
- ServeDownload unchanged (operates on UUIDs/SHAs, not refs)
Provider ref-resolution:
- Add isSHA helper in commits_helpers.go for the SHA-vs-ref gate
- Add isUUID helper for probeCommitID to detect UUID inputs
- Bitbucket: replace 'commit != "" && commit != "main"' with
isSHA(commit); non-SHA inputs call new getCommit(ctx, ref) which
hits /commits/{ref} and returns the resolved id
- GitHub: same gate; non-SHA inputs call repos.GetCommit(ctx, owner,
repo, ref, nil) and stamp rc.GetSHA() into meta.Commit
Provider tests:
- bitbucket/getrepo_test.go: 4 subtests (Empty, RawSHA_40, RawSHA_64,
ResolvesRef via httptest server returning {id,displayId})
- github/getrepo_test.go: 3 subtests (Empty, RawSHA_40, ResolvesRef
via new mockRepos that supports GetCommit)
- github/mockrepos_test.go: new mockRepos mock with GetCommit plumbing
and call-count tracking
Co-Authored-By: Claude <noreply@anthropic.com>
* test(18-01): add failing test for commitUUIDInverse
8 cases:
- 4 success: round-trip a known 40-char SHA, all-zero, all-ones,
and a 64-char SHA-256 (recovery is shape-independent)
- 4 error: empty, 31 chars, 33 chars, 32 chars non-hex
Tests fail at compile time: commitUUIDInverse is not defined yet.
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(18-01): add commitUUIDInverse helper + round-trip tests
The inverse of commitUUID: given a 32-char dashless UUID, recover the
first 28 hex characters of the SHA that produced it. Used by
probeCommitID (task 3) to derive a probe arg from a buf-issued UUID
input on the post-restart Download cache-miss path.
Inverse is lossy by design: commitUUID drops the last 6 bytes of the
SHA (2^112 collision surface) and overwrites the version/variant
bytes at positions 6 and 8. The recovered 14 bytes are sufficient to
identify a specific source among the configured providers and to
scope a probeCommitID fan-out to the right repository.
TestCommitUUIDInverse (8 cases):
- 4 success: round-trip a known 40-char SHA, all-zero, all-ones,
and a 64-char SHA-256 (recovery is shape-independent)
- 4 error: empty, 31 chars, 33 chars, 32 chars non-hex
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(18-01): remove prewarm + rewrite probeCommitID to use commitUUIDInverse
Prewarm removal:
- Delete prewarmHeads and registerResolved from commits.go
- Delete prewarmOnce, prewarmEnabled, prewarmTimeout fields from
commitServiceHandler
- Delete PrewarmEnabled, PrewarmTimeout fields from CommitResolution
- Delete the goroutine launch in NewWithConfig
- Delete PrewarmConfig struct from config.go
- Drop cc.Prewarm.* references in main.go
- Delete the now-obsolete TestPrewarmHeads_PopulatesCommitMap
Probe rewrite (review.md finding #6 closure):
- probeCommitID now uses commitUUIDInverse for 32-char UUID inputs
and validates the source's meta.Commit starts with the recovered
28-char prefix (prefix-match validation; fail-closed on mismatch)
- New registerResolvedAlias helper takes the buf-issued id (typically
a UUID) as the primary key and the resolved SHA as the alias
- Inputs that are neither SHA-shaped (40/64 hex) nor UUID-shaped
(32 hex) are negative-cached and return early (no upstream fan-out)
New tests:
- TestServeDownload_AfterRestart_ProbeResolvesUUID: post-restart
Download with a UUID succeeds via the inverse + prefix-match path
- TestServeDownload_AfterRestart_ProbeMissesOnUnknownUUID: a UUID
whose first 14 bytes do not match any source's HEAD returns 400
- Updated mockSource to accept a prefix match (HasPrefix check) for
the post-restart probe fan-out
Co-Authored-By: Claude <noreply@anthropic.com>
* docs(18-01): complete phase 18 plan 01
* docs(state): update session continuity for phase 18 completion
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
v0.3.8
v0.3.7
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
fix(connect): register v1 service paths for buf v2 config (#28) * fix(connect): register v1 service paths for buf v2 config compatibility CommitService, GraphService, and DownloadService only had v1beta1 routes registered. Buf CLI with v2 buf.yaml config calls v1 API paths, which fell through to rootHandler returning text/plain — causing "invalid content-type" errors. Add v1 route registrations alongside v1beta1 for all three services, matching the pattern already used by ModuleService. Adds comprehensive tests verifying v1 and v1beta1 paths return application/proto content-type and valid protobuf responses. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs(debug): add v1 content-type debug session artefact Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * ci: add test and security workflows - test.yml: run unit tests on PR and push to main - security.yml: weekly govulncheck + dependency review Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>