Skip to content

Backported Pulse Insights#641

Merged
lbedner merged 1 commit intomainfrom
backport-pulse-insights
Apr 27, 2026
Merged

Backported Pulse Insights#641
lbedner merged 1 commit intomainfrom
backport-pulse-insights

Conversation

@lbedner
Copy link
Copy Markdown
Owner

@lbedner lbedner commented Apr 27, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 27, 2026 03:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Backports “Pulse Insights” capabilities into the Aegis project template by expanding the insights domain (new view-model layer, goals + user events), enhancing collectors (GitHub rolling totals, Plausible sources/pages enrichment), and improving performance via bulk-loading query consolidation—along with associated template/migration updates and test adjustments.

Changes:

  • Add insights “view” transformation layer (schemas + view service) and shared caching helpers.
  • Add goals + user-events services/schemas/catalog and extend insights models/migrations to support origin/user linkage.
  • Update collectors/tests for new metrics (GitHub 14d rolling totals, Plausible top sources, PyPI query changes) and optimize InsightQueryService.load_all() query fan-out.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/test_insights_collectors.py Seeds additional GitHub traffic metric types needed by collector behavior.
aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/test_collector_service.py Removes now-defunct star ATH record tests; documents rationale.
aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/test_collector_pypi.py Aligns mocks with updated PyPI collector query shape; skips lookback-days test.
aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/test_collector_plausible.py Updates Plausible mocks to include top sources + v2 /query page breakdown.
aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/test_collector_github_traffic.py Updates expectations to include 14-day rolling total rows.
aegis/templates/copier-aegis-project/{{ project_slug }}/tests/api/test_health_endpoints.py.jinja Disposes global async engine in teardown to avoid cross-test pool state issues.
aegis/templates/copier-aegis-project/{{ project_slug }}/pyproject.toml.jinja Adds aiosqlite as a dev/test dep for non-sqlite DB configs (tests still use sqlite).
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/view_service.py Introduces a large “display-ready” transformation layer for insights dashboard tabs.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/view_schemas.py Adds Pydantic view models for the view-service outputs.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/view_cache.py Adds shared caching helpers for bulk + per-tab views.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/seed.py.jinja Extends default metric type seeds (GitHub rolling totals; Plausible top sources/countries).
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/schemas.py Extends Plausible metadata schemas; enables non-string forward refs via __future__.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/query_service.py Collapses load_all fan-out into a small fixed number of queries; adds new daily keys.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/models.py.jinja Expands insights models: goals, event origin semantics, display label helpers, auth FK notes.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/models.py Removes the non-templated insights models file (template now driven by .jinja).
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/insight_service.py Marks add_event() as user-origin and improves docstring clarity.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/goal_service.py Adds CRUD + progress computation (including batching) for user goals.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/goal_schemas.py Adds goals API request/response schemas.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/goal_catalog.py Adds the goal metric catalog + resolver mapping to underlying insight metrics.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/event_service.py Adds CRUD for user-origin events with validation and safe update semantics.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/event_schemas.py Adds user-events API schemas incl. computed display label.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/constants.py Adds GitHub 14d rolling metric keys + Plausible top_sources key.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/collectors/reddit.py Minor formatting tweak to on-demand-only collector result message.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/collectors/pypi.py Fixes PyPI window behavior to a fixed 14d; simplifies version breakdown query/shape.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/collectors/plausible.py Adds top sources; switches top pages breakdown to Plausible v2 /query for engagement metrics.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/collectors/github_traffic.py Adds persistence of GitHub server-computed 14d rolling totals; refactors error handling/logging.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/collectors/github_stars.py Refactors config validation + error handling/logging; adds timestamp parsing helper.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/collectors/github_events.py Simplifies fork/release sourcing to ClickHouse windowed queries; removes REST fallback logic.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/collector_service.py.jinja Updates record checks (incl. 14d rolling metrics), removes cache invalidation, trims star record logic.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/models/user.py.jinja Adds OAuth identity table/model and change-password request + enriched UserResponse constructor.
aegis/core/migration_generator.py Adds oauth identity + insights/auth link migrations; uses batch alter for SQLite FK portability.

@lbedner lbedner force-pushed the backport-pulse-insights branch 3 times, most recently from 059ea2c to 779e13c Compare April 27, 2026 17:44
@lbedner lbedner force-pushed the backport-pulse-insights branch from 779e13c to 1f74822 Compare April 27, 2026 17:56
@lbedner lbedner merged commit 79121c5 into main Apr 27, 2026
8 checks passed
@lbedner lbedner deleted the backport-pulse-insights branch April 27, 2026 18:06
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