Repository navigation
feat(profile): collect content counts, batch augment, size blockers - #22
Merged
Merged
Conversation
The profiler only gathered the per-feature signals the consideration checks need, one repo per request, and never the actual content volume. This adds real repo metadata, batches the second pass, and turns the content/size data into a scale rollup and the first working blocker. - Discovery now also pulls each repo's content-volume totalCounts (issues, pull requests, branches, tags) — they ride along free in the 100-repo page already being fetched. - The augment pass is batched: one aliased GraphQL request profiles a chunk of 25 repos (rule details + the default-branch commit count) instead of one request per repo, so an org of N repos costs ~N/25 requests. It's partial-failure aware — an inaccessible repo in a chunk degrades to zeroed signals via the error's partial data instead of failing the whole chunk. - analyze wires the git-archive-size blocker off diskUsage (a proxy, flagged for git-sizer confirmation), so blockers are no longer always 0. - getProfileDetail derives an org-wide migration-scale rollup (issues, PRs, commits, branches, tags, releases, total size) by summing the persisted signals on read — no schema change — surfaced as a "Migration scale" section on the run page.
Each repository row on the run page is now an expandable toggle: clicking it reveals a detail panel with that repo's individual signal counts — issues, pull requests, commits, branches, tags, releases, discussions, projects, environments, stars, watchers, protection rules, and size — plus a facts line (visibility, default branch, last push, archived/fork/ empty). The per-repo signals were already loaded with the run, so this is purely client-side; expansion is keyed on nameWithOwner so it survives a live refresh.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Addresses the profiler gaps you spotted: it gathered only the per-feature presence signals, one repo per request, and never the actual content volume. This collects real metadata, batches the second pass, and turns that data into an org-wide scale rollup and the first working blocker.
Changes
1. Content-volume counts in discovery (free)
totalCountis a cheap connection aggregate, and discovery already pages the org's repos 100 at a time. So the discovery query now also pulls each repo's issues, pull requests, branches, and tags counts — gathered "from multiple repos at a time" with zero extra requests, exactly the insight you raised.2. The augment pass is now batched
The one thing that can't fold into a discovery node is the branch-protection rule detail (node-level flags). That pass was one request per repo; it's now an aliased batch —
r0: repository(...) {…} r1: repository(...) {…}— profiling 25 repos per request. An org of N repos drops from N requests to ~N/25. The default-branch commit count (history.totalCount, the one count with timeout risk at 100-wide) rides in this smaller-fanout pass too.It's partial-failure aware: GraphQL returns a null alias + an
errorsentry when one repo in a chunk is inaccessible (surfaced by the client as a throw carrying partialdata). That repo degrades to zeroed signals from the recovered data instead of failing the whole chunk; the run continues.3. First working blocker
analyzewires the git-archive-size blocker offdiskUsage(flagged ≥ 2 GiB as an estimate to confirm with git-sizer). Soblockersis no longer always 0 — genuinely large repos now surface.4. Migration-scale rollup
getProfileDetailderives an org-wide scale (issues, PRs, commits, branches, tags, releases, total size) by summing the persisted signals on read — no schema change, mirroring the insights pattern — surfaced as a "Migration scale" section on the run page.Performance
Testing
ok: true); coverage 86.58% / 84.65%./api/profile/:idreturns the correct scale (issues:15, commits:150, …), the size-blocker persists, and the page renders the Migration scale tiles.Design notes / deliberately deferred
history.totalCountis the one count with timeout risk at scale, so it's in the smaller-fanout batch, not the 100-wide discovery page.Note
Two
ProfileRunfield comments still say "gaps" (thegap → considerationrename leftover I flagged on the docs PR) — left for a separate tidy.