Skip to content

perf: share Repository overview query dependencies - #19007

Closed
pelikhan wants to merge 6 commits into
mainfrom
pelikhan-repository-overview-performance
Closed

pelikhan wants to merge 6 commits into
mainfrom
pelikhan-repository-overview-performance

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Summary

Optimize only the Repository overview (repository-detail) by declaring query-binding: page. Its ordinary widgets now share one abort-scoped canonical subscription instead of independently recomputing repository-activity. Other pages keep their existing independent subscriptions.

The production view-payload compiler shares equivalent scoped dependency graphs within one request while retaining distinct view aliases. Per-view filters, search, ordering, limits, source quality, and provenance remain intact; there is no cross-request cache. Database updates still refresh the active page, and navigation or context changes dispose the old subscription. Page-bound failures render an explicit unavailable state.

Measured result

Fully settled default-page readiness fell from a 26.59 s median to 5.88 s: 77.9% less latency / 4.52× faster.

Pair Order Before After
1 Before → After 24.10 s 5.88 s
2 After → Before 27.61 s 5.83 s
3 Before → After 26.59 s 6.43 s

Each before run started five page subscriptions (four duplicate activity widgets and page chrome); each after run started one. All active widget rows and evidence availability, completeness, freshness, and timestamps matched their before results.

Method: the unchanged base checkout at 2de03249512f65fc0eb7ca2a438eac647205f2e2 and the optimized build were alternated on the same Chromium origin/database and pinned public manifest. Each round forced a full app reload, waited for eager ingestion to finish, then navigated to #page-repository-detail?repository=githubnext%2Fgh-aw-cao. Readiness waits for all active page requests and visible views, excluding ingestion and the 400 ms quiet-period confirmation. No CPU/network throttling; 1440×1000 viewport. Alternating pair order and three samples account for shared-machine variability.

Every round verified the same 575,582 canonical records, including 4,073 runs, 695 workflows, and 6 repositories. This reproduces the reported deployment's fourfold repeated dependency evaluation without treating its single 27.86 s sample or the abandoned diagnostic run as the paired baseline.

Pinned manifest SHA-256: cce19a1f7237786b47a363678ea51e6a685e93a2eca21dd1bd80aac82b605808.

Coverage

Regression tests require a single shared import-evidence dependency graph and less than 40% of the independent row-operation budget. Scoped values and partial/stale provenance are compared across time horizons, repository/organization/workflow/mode filters, and search. Additional tests cover distinct filters/limits, binding validation, page-lifetime aborts, refreshes, query errors, and browser-worker updates to metrics and health in Table mode and mobile layout.

Passed:

  • 408 focused unit tests, including all new regressions and an isolated retry of the original full-suite timeout.
  • Dashboard lint, strict typecheck, and document validation; root lint.
  • Production-worker browser regression for metrics, refresh, Table-mode health, and mobile layout.
  • Canonical data-worker heap-budget guard against deployed data.
  • Lighthouse CFO/CTO/CSO regression scenarios against the pinned data: 12 desktop/mobile × empty/full cold-navigation audits, one repeat each, all budgets passed; scores 97–100. The repeated paired page measurements above remain the primary optimization evidence.
  • Workflow compilation: 71 workflows, with two existing warnings.
  • Documentation build and static agent-discovery validation.
  • Agent-catalog regeneration produced no changes.

Full-suite caveats, not hidden or loosened:

  • The first full dashboard unit run passed 3,604 tests, skipped one, and timed out in one unchanged campaign-query test. A bounded-worker full retry passed 3,602 but timed out in three unchanged storage/native-aggregate tests that passed the first run. The original campaign-query suite passes in the final 408-test focused run. Shared-machine contention makes the full-suite timing gates non-clean.
  • Full browser run: 291 passed, one skipped, two failures. The Safari offline-worker timeout passes all five cases when isolated. The other failure is the existing core-text size budget: unchanged baseline 78,039 bytes already exceeds 76,500; this change yields 78,062 (+23). No unrelated page or size-budget changes are included.
  • The optional full root check was stopped after an unrelated installer test failed; that exact installer test passes in isolation. Required focused checks, workflow compilation, and documentation build completed separately.

Populated desktop and mobile screenshots are attached in a PR comment.

Bind repository-detail to one abort-scoped canonical page query and reuse equivalent scoped dependency graphs per request while preserving view aliases and refresh semantics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator Author

Populated Repository overview after the optimization, using the same fully ingested pinned dataset as the paired measurements. Desktop: 1440×1000. Mobile: 390×844.

Repository overview desktop

Repository overview mobile

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
Dashboard dead views

Dead element views (0):
Dead dashboard pages (0):
Analyzed 8 element renderers and 66 dashboard pages across 1 dashboard.json file(s) from dashboard/site/src/components/ui-elements.js.

⚠️ This reachability report is informational and does not block the pull request.
🔎 View the workflow run and report artifact.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Page binding can omit an unscoped metric’s source when another metric shares that source with global filters.

1 open issue
What changed in this PR

Optimizes Repository overview by sharing one page-level subscription and equivalent query dependencies within each request.

Changes:

  • Adds opt-in query-binding: page with validation and documentation.
  • Shares scoped dependency graphs while retaining separate view aliases.
  • Adds regression coverage for performance, refreshes, cleanup, and failures.
File Description
docs/​dashboard-language-specification.md Defines page-binding behavior.
dashboard/​site/​test/​unit/​view-payload-compiler.test.js Tests shared graphs and distinct limits.
dashboard/​site/​test/​unit/​validator.test.js Tests binding validation.
dashboard/​site/​test/​unit/​repository-activity-query-optimization.test.js Checks scope, quality, and operation budgets.
dashboard/​site/​test/​unit/​presenter.test.js Tests subscription lifecycle and failures.
dashboard/​site/​test/​fixtures/​repository-overview-contract.json Defines overview contract expectations.
dashboard/​site/​test/​e2e/​repository-overview.spec.js Checks worker refreshes and responsive rendering.
dashboard/​site/​src/​validator-pages.js Validates binding values.
dashboard/​site/​src/​specification.js Allows the custom-page binding key.
dashboard/​site/​src/​presenter.js Implements page-level binding and failure states.
dashboard/​site/​src/​data/​queries/​view-payload-compiler.js Reuses equivalent scoped dependency graphs.
dashboard/​site/​dashboard-fragments/​repositories.json Enables binding for Repository overview.

Review effort: Balanced

Comment thread dashboard/site/src/presenter.js
Opt Campaigns into the same JSON page-binding contract as Repository overview. Preserve production-worker payload, provenance, pagination, horizon, refresh, navigation, and mobile-mode coverage without adding a worker cache.

Retain unaliased derived sources required by context-opted-out views alongside scoped aliases, with compiler and canonical-worker regressions for the review finding.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Campaigns page binding bypasses its early inventory preview, delaying identities and navigation links until full activity ingestion.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread dashboard/site/dashboard-fragments/campaigns.json
pelikhan and others added 2 commits October 19, 2026 15:20
Interpret the declarative page binding consistently in source discovery and compilation so every ordinary view keeps its payload across Chart, Cards, and Table. Reuse the same scoped DAG without marking inactive charts unavailable.

Cover complete-mode aliases, page-source selection, and unavailable-state parity in browser navigation. The existing built-in inventory preview integration regression passes unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Resolve authored partial-source views through the canonical compiler and publish only phase-ready preview aliases. Keep earlier ready previews when another becomes available, without reading a deferred complete graph or caching query results.

Cover inventory/run-phase page previews, deferred filters, complete replacement, and real browser Table/Cards links and pending cells while record ingestion is held open.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Continuation loading rejects valid tokens, and backend-ineligible previews can trigger complete queries before ingestion is ready.

2 open issues
1 resolved since last review

Review effort: Balanced

Comment thread dashboard/site/dashboard-fragments/campaigns.json
Comment thread dashboard/site/src/data/queries/view-payload-compiler.js
pelikhan and others added 2 commits October 19, 2026 16:13
Continuation loaders retain the original source set and view/page compilation scope, keeping signatures valid for page-bound and independent subscriptions. Filter declared previews by the same backend eligibility used by canonical compilation before phase publication.

Verify second-page Campaigns retrieval through production startup and worker APIs with 31 rows, independent-view continuation scope, and a hosted-only preview sharing a deferred static source.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Require the original page source set and independent view scope at the canonical continuation boundary instead of the superseded alias-to-view reconstruction.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator Author

Superseded by the single consolidated draft PR #19015 at f0b769c. The reviewed source changes and preservation corrections are collected there, with regenerated catalogs and combined validation. Closing without merging or deleting the source branch; history and original evidence remain available.

@pelikhan pelikhan closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants