Feature 07: Releases, assets, stars, watches — internal/releases + internal/social #13
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#13
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Feature 07: Releases, assets, stars, watches —
internal/releases+internal/socialSpec:
docs/features/07_releases_stars.md(normative) + P1/P5–P8 indocs/features/README.md.Rollout: Wave D in
docs/features/09_rollout.md§3. Depends on 01 (P6), 03 (merged-PR index for autodraft, fork counter), 06 (watch fan-out).Recommended implementation (verified against the doc)
internal/releases(releases + assets + autodraft) andinternal/social(stars, watches, counters) — bothapi.RouteProvider(Seam 1, both lanes viaapi.Lanes). No task kinds (§9 — everything synchronous and bounded; name but don't build therelease-asset-importSeam 5 hook).releases/<tag.json>(tag percent-encoded one segment, NO lowercasing; CAS create-against-absent then CAS updates; tag/tag_sha immutable),releases/<tag.json>/assets/<name>(raw bytes, immutable Create),releases/latest.json(CAS'd pointer, monotoniccreated_atcompare in-loop + bounded self-healing scan max 100, sync repair on delete),meta/social.json({stars, watchers, forks}CAS'd, one canonical field-scoped loop),users/<principal>/{starred,watching}/<o>/<r>.json(Create/Delete only). CAS'd JSON joins the frozen overwritable list in the same change.refs/tags/<tag>at write (404unknown revision); sha snapshotted; tag moves/deletes don't rewrite the release. Releases always bound to an existing tag (no tag-less drafts — draft hides from latest/list/notifications only).POST …/assets/{name}raw bytes +Content-Length+X-Walgit-Asset-Sha256→ spool-verify (sha256+size, capreleases.max_asset_bytesdefault 2 GiB → 413) → bytes Create (same-sha = idempotent success, clash = 409) → header CAS-append. Bytes-first always (orphans harmless, dangling entries impossible). Serving via static contract (strong ETag, Range, immutable CC) onGET|HEAD /{o}/{r}/releases/{tag}/assets/{name}registered in the static uncompressed group (14.3 routing note).sincedefaults to latest tag; merged-PR source from 03's index; window test viamerge-base --is-ancestorboth sides under the per-repo git semaphore; ≤100 PRs,moreflag.social.jsonCAS loop; 03's fork completion CAS-incrementsforks(coordinate the call site with internal/pulls).releaseframe.crypto.subtlehash upload), star/watch toggles with optimistic rollback,releases.js+social.jsSDK. Dark + light themes.Acceptance criteria
make cover≥ 95% on both packages;-raceclean; concurrent asset-upload convergence test.Starting Feature 07 implementation (docs/features/07_releases_stars.md): internal/releases + internal/social from origin/main in an isolated worktree; dirty feat/issues worktree untouched. Plan: releases/CRUD+assets+latest-pointer+autodraft, social stars/watches/forks-counter, watch-route handover from internal/notify, repo-subpath bytes seam, UI+SDK, EVIDENCE entry, PR to follow.
Feature 07 implementation ready for review: PR #18 (feat/releases → main) — internal/releases + internal/social, UI+SDK, EVIDENCE E8. Live proof on the compose rig (release/asset sha-verified/latest-repair/star/fork counters) plus releases 99.8% / social 99.7% coverage, -race, cover gate, e2e all green. Deviations from the 07 text are recorded in the doc's Decisions (watch routes stay in notify; shared-index autodraft; idempotent PUT; asset subtree layout). Do not merge per instructions.
PR #18 review (feat/releases, head
d34c946after fixes): 5 findings, all fixed and pushed to origin/feat/releases.FINDINGS (file:line on
d34c946, resolution):VERIFIED CLEAN (no change needed): import budget (stdlib+internal only in both packages); seam direction (core/pulls never import releases/social; ForksCounter consumed as interface, wired in cmd/walhub/social.go); bytes-before-header with streaming spool + dual cap checks (declared + LimitReader) and failure-path-only verification; tag resolve-at-write with peeled rev-parse argv + snapshot semantics; asset name validation; P6 gates (write/maintain/read + 401-with-Bearer); watch mutation single-owned by notify with dual field-scoped CAS loops (notify watch.go preserves stars/forks; social preserves watcher_list — TestSocialPreservesWatcherList); fork exactly-once (Create-arbitrated target + (repo,kind) single-flight + single IncForks site; retries hit 412-conflict, never re-increment); PUT-upsert-vs-409 deviation recorded with rationale (retry-safe publishes; store-level absent-CAS still converges concurrent creators; 409 kept for sha clash + stale If-Match); cache classes (SWR on JSON GETs, immutable on bytes, no-store on starred twins); byte route via server.RepoRoutes consulted in repoDispatch (router.go:278,291) with no compress group wrapping it (verified mount at router.go:128 bare); dark+light via shared themed ui.css classes (+ new chip-draft/chip-prerelease/btn variants); E8 numbers check out against the code paths (publish 3G+2P, star 2G+2P, upload 2G+2P all confirmed in code); config releases.max_asset_bytes rides the reflective setup schema (ByteSize already handled); no task kinds registered.
FINAL RESULTS on
d34c946: gofmt clean; go vet clean (releases/social/pulls/notify/server); go test -race green on all four (releases, social, pulls, notify); coverage 99.8% releases / 99.7% social (gate >=95%). Main worktree untouched (all work in /tmp/pr18fix, now on branch review/pr18-fixes, pushed as feat/releases).MERGE RECOMMENDATION: ready to merge.
Feature 07 complete: PR #18 reviewed (5 findings fixed: doc layout, monotonic pointer repair, unstar double-decrement, HEAD range, route shadowing note), merged. releases 99.8% / social 99.7%, -race clean. Closing.