Conversation
There was a problem hiding this comment.
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. |
059ea2c to
779e13c
Compare
779e13c to
1f74822
Compare
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.
No description provided.