Skip to content

feat(metrics): publish timeseries.json + dashboard schema additions#863

Merged
sw-factory-automations merged 1 commit intomainfrom
feat/metrics-timeseries
Apr 29, 2026
Merged

feat(metrics): publish timeseries.json + dashboard schema additions#863
sw-factory-automations merged 1 commit intomainfrom
feat/metrics-timeseries

Conversation

@zacharias-ona
Copy link
Copy Markdown
Collaborator

Problem

software-factory.dev's /dashboard route is being migrated from a static
HTML file to a Next.js page that consumes a single time-series file from
this repository. The dashboard needs three pieces of data not currently
in metrics/daily/*.json: test counts, daily issues-opened/closed deltas,
and PR/issue latency distributions.

Closes #862

Change

  1. Daily snapshots gain five new fields: tests, issues.delta_done,
    issues.delta_opened, pr_merge_time_buckets, issue_close_time_buckets.
  2. New aggregator (scripts/metrics/build-timeseries.mjs) publishes metrics/timeseries.json on every daily run.
  3. Backfilled Apr 14–29 with measured values from GitHub API and git history
    (test counts from historical worktrees, issue/PR deltas from API,
    cumulative latency distributions from actual merge/close times).
  4. Updated daily-metrics automation to collect new fields and run aggregator
    as final step.

The aggregator is idempotent: re-running it produces a byte-identical
file modulo updatedAt. A schema-guard helper validates the top-level
and per-day key sets before write.

Sample diff (one daily snapshot)

 {
   "date": "2026-04-28",
   "day_number": 16,
   "loc": { "total": 64546, "delta": 1619, "by_language": { ... } },
   "prs": { "total": 465, "delta": 0, "currently_open": 0 },
   "commits": { "total": 488, "delta": 0 },
   "test_coverage_pct": 38.35,
   "autonomous_pct": 85,
-  "issues": { "backlog": 0, "in_progress": 0, "in_review": 0, "done": 343 },
+  "issues": {
+    "backlog": 0, "in_progress": 0, "in_review": 0, "done": 343,
+    "delta_done": 1, "delta_opened": 1
+  },
+  "tests": { "unit": 1591, "e2e": 290 },
+  "pr_merge_time_buckets":    { "lt_5m": 206, "5_10m": 177, "10_20m": 54, "30_60m": 24, "1_2h": 10 },
+  "issue_close_time_buckets": { "lt_15m": 49, "15_30m": 81, "30_60m": 101, "1_2h": 66, "2_4h": 44, "4_8h": 16 },
   "human_minutes": null,
   "agent_minutes": null
 }

Validation

  • metrics/timeseries.json parses; top-level keys are exactly
    ["updatedAt", "startDate", "days", "latest"].
  • Per-day entries have exactly the nine keys documented in the schema.
  • No date gaps between Apr 14 and the most recent snapshot.
  • Aggregator is idempotent (proven by running it twice and diffing).
  • Existing daily fields are byte-unchanged for past dates.
  • Lint, typecheck, and all 1730 unit tests pass.

Consumer: https://github.com/gitpod-io/software-factory.dev

Closes #862

- Daily snapshots gain five new fields: tests, issues.delta_done,
  issues.delta_opened, pr_merge_time_buckets, issue_close_time_buckets.
- New aggregator (scripts/metrics/build-timeseries.mjs) publishes
  metrics/timeseries.json on every daily run.
- Backfilled Apr 14-29 with measured values from GitHub API and git
  history (test counts from historical worktrees, issue/PR deltas from
  API, cumulative latency distributions from actual merge/close times).
- Schema-guard validates top-level and per-day key sets before write.
- Aggregator is idempotent (modulo updatedAt).
- Updated daily-metrics automation to collect new fields and run
  aggregator as final step.

Co-authored-by: Ona <no-reply@ona.com>
@zacharias-ona zacharias-ona added the ona-user PR created via interactive Ona session — no issue reference required label Apr 29, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
memo Ready Ready Preview, Comment Apr 29, 2026 9:59pm

Request Review

@sw-factory-automations sw-factory-automations merged commit 50ed7e5 into main Apr 29, 2026
6 checks passed
@sw-factory-automations sw-factory-automations deleted the feat/metrics-timeseries branch April 29, 2026 22:32
@sw-factory-automations
Copy link
Copy Markdown
Collaborator

✅ UI verification skipped — no UI files changed.

Changed files are limited to metrics/daily/*.json, metrics/timeseries.json, scripts/metrics/build-timeseries.mjs, and .ona/automations/daily-metrics.yaml. None match src/components/*, src/app/**/page.tsx, or src/app/**/layout.tsx.

@sw-factory-automations
Copy link
Copy Markdown
Collaborator

✅ Post-merge verification passed.

E2E suite against live site: 286/293 passed (8 did not run).

  • 6 failures are pre-existing and unrelated to this PR (account-deletion, database-csv-export, favorites, trash, version-history, workspace-limit, workspace-settings). This PR only modifies metrics data files, a build script, and automation config — no UI, pages, or API routes were changed.
  • 1 visual-regression skip (expected — no Storybook server for live site runs).

Ad-hoc smoke tests: All passed.

Route Result
/ (landing page) ✅ Loaded, has title
/sign-in ✅ Email input present
/api/health ✅ Healthy
/dashboard Skipped (not yet built)
Authenticated login flow ✅ Sign-in → workspace redirect
Workspace page ✅ Loaded
Editor navigation Skipped (no page buttons in test workspace)

Interaction smoke test: N/A — this PR adds metrics data files and a build script consumed by an external site (software-factory.dev), not by memo.software-factory.dev. No UI components or pages were modified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ona-user PR created via interactive Ona session — no issue reference required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(metrics): publish timeseries.json for software-factory.dev dashboard

2 participants