Explore: order owner sections by most recently committed repository (owners list has no activity ordering — name proxy only) #283
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#283
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?
Follow-up to #247 (repo rows on
/exploreare now ordered by most recent commit — done). The remaining gap: the owner sections themselves are still ordered by a name proxy, not by activity.Current state (code evidence)
/exploreis correctly activity-ordered:Owners.jsx:31-33fetchesGET /api/v1/owners/{owner}/repos/detailed?sort=activity&order=descand stabilizes client-side viaorderByActivity(lib/owners.js:44). Done in #247.Owners.jsx:110orders owner names vianewestFirst(owners())— reverse-lexicographic on the name (lib/owners.js:27-30, whose own comment says "Owner sections stay name-proxied (newestFirst — the owners list carries no timestamps)"). A dead owner whose name sorts late appears above an active owner whose name sorts early.GET /api/v1/owners(internal/api/discovery.go:115) returns sorted name strings only — no timestamps, no activity.newestFirst's doc comment calls it "the closest deterministic newest-first proxy available" and names itself the function to replace when the backend carries times.What's needed
Order owner sections on
/exploreby their most recently committed repository — the owner whose repo had the newestlast_commit_timefirst, owners with no activity last.Proposed design
The data to compute this already exists server-side per owner (the
repos/detailedrows carrylast_commit_time), but scoring every owner on page load means N parallel detailed fetches before rendering — the page currently renders owner sections progressively and that's good behavior to keep. Two shapes:last_commit_timeandsize_bytes) with a per-ownerlast_commit_timerollup = max over the owner's repos.GET /api/v1/owners?sort=activityreturns owners in that order (and the field per row). The catalog maintenance pass already walks every repo; a per-owner max is one comparison per repo in the same pass. Client change: replacenewestFirst(owners())with ordering on the returned field, falling back to name order when absent —orderByActivityis reusable nearly verbatim (it already defines the total order: known times desc, unknown last, deterministic name tiebreak).repos:{owner}detailed doc arrives. Simple, no API change, but the visible order shifts as data lands — janky, and the first paint still lies. Only if the rollup is unwanted.Prefer (1):
/exploreis the page whose whole point is "what's alive on this instance," and the catalog pass makes the rollup ~free.Acceptance criteria
GET /api/v1/owners(all three twins) supportssort=activity&order=descand returnslast_commit_timeper owner (max over the owner's repos; null when the owner has no commits)./exploreowner sections are ordered by that value, newest first; owners with no activity sort last (deterministic name tiebreak); unknown/missing values degrade to today's behavior without error.newestFirstis retired from the explore page (deleted or repurposed with an updated comment — its own doc comment anticipates exactly this replacement).Fixed by #299 (#299) — explore owner sections now order by most-recent-commit repo (client-side rank over the #247 detailed docs, zero extra GETs, unknowns last). No backend change; server-side rollup noted as a possible follow-up. Not merging — needs review.
Review of PR #299 (fix/issue-283, client-side re-rank) — verdict at bottom.
SCOPE (load-bearing): the client-side approach does NOT satisfy #283 as written — blocked, with precise unblock below. What I verified:
repos:${owner}useData key (same key the /:owner page uses); the createEffect only reads that doc and reports ownerActivity upward. No new useData, no new endpoint/SDK call. web/src/pages/Owners.jsx:38-48.SMALL FIXES PUSHED to origin/fix/issue-283 (commit 'Review #299: doc stale-clause cleanup, most-active overflow copy', re-tested):
newestFirststays for owner sections only' clause directly contradicted by the #283 parenthetical that followed it — collapsed to one clean sentence.TESTS (scratch worktree /tmp/pr299, since removed): owners.test.js 16/16 incl. 5 new #283 cases; full node suite 576 pass / 0 fail (matches PR claim; the 1 'cancelled' entry is the pre-existing smoke.test.js pending-promise artifact, also present without this PR); vite build green (only the pre-existing >500kB chunk warning). Per instructions: no browser (node tests + reasoning; browser proof remains open), no docker/compose, no system packages. Main worktree untouched (still clean on main apart from untracked .opencode/).
MERGE RECOMMENDATION: blocked — client-side re-rank is correct for ≤50 owners but cannot satisfy #283's acceptance criteria (server sort=activity + per-owner last_commit_time on all three /api/v1/owners twins; catalog pass maintains the rollup incrementally; three-twins coverage). To unblock, either: (a) implement the rollup — extend the #247/#248 catalog aggregate with per-owner max(last_commit_time) in the same maintenance pass (one comparison per repo), serve sort=activity&order=desc + the field on all three twins (internal/api/discovery.go owners listing + twins), keep orderOwnersByActivity as the client fallback for missing values; or (b) maintainer amends #283's acceptance criteria to bless client-side as the fix and files the rollup as a follow-up (noting the >50-owner tail limitation). Happy to re-review either path.
Unblocks #299 review (option a — server-side rollup): pushed
96fe40fto origin/fix/issue-283 (PR #299, fast-forward, no force).WHAT IT DOES
TESTS
DEVIATIONS/OBSERVATIONS
a1134a6; .gitignore still carries the !web/dist/.keep exception). Fresh worktrees cannot go build ./... without a placeholder. Left my placeholder untracked (not committed); flagging in case you want a .keep restore as its own change.Ready for re-review.
Re-review of PR #299 delta (
96fe40fserver-side rollup + my fixe395d38below). Scope first: full PR file list == union of the 4 commits on the branch, nothing unexpected. Prior review's passes (fallback semantics, newestFirst legacy, zero GETs) not re-litigated.FINDINGS (file:line + resolution):
e395d38: hasKnownActivity gate (owners.js + Owners.jsx:139-147) — server order passes through until a real time lands, same total order after, so they never fight. Pinned by 2 new headless tests.e395d38and is TRUE after (no doc edit needed). 14 has a whitespace-only reflow of adjacent mirror lines — cosmetic, harmless.TESTS (scratch worktree /tmp/pr299b, to be removed): go test -race clean (internal/api, internal/sizecatalog); gofmt/vet clean; JS 34/34 (owners 18 incl. 2 new, sdk-surface, sdk-nostore-304). Per instructions: no browser (remains open, noted), no docker/compose, no system packages. Main worktree untouched (clean on main apart from untracked .opencode/).
MERGE RECOMMENDATION: ready to merge (after CI).
Fixed by PR #299 incl. server rollup rework + review server-order fix (sort=activity, derived rollup, coexistence correct; gates green), merged. Closing.