Skip to content

Update Insights Overseer#648

Merged
lbedner merged 1 commit intomainfrom
update-insights-overseer
Apr 28, 2026
Merged

Update Insights Overseer#648
lbedner merged 1 commit intomainfrom
update-insights-overseer

Conversation

@lbedner
Copy link
Copy Markdown
Owner

@lbedner lbedner commented Apr 28, 2026

Screenshot 2026-04-28 at 4 21 57 PM

Copilot AI review requested due to automatic review settings April 28, 2026 20:21
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

This PR extends the Aegis Stack project generator/templates to support an auth[oauth] modifier for optional GitHub/Google OAuth social login, while also updating the Insights UI/collector and strengthening DB enum-like fields via CHECK constraints.

Changes:

  • Add an OAuth modifier to auth[...] parsing + template context, plus generated OAuth routes/middleware/settings/deps and template tests/docs.
  • Add CHECK-constraint support to the dynamic migration generator and apply it to Insights/Auth models.
  • Refactor parts of the Insights modal UI (charts, event chips/filtering) and improve PyPI per-version “human vs bot” breakdown.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/core/test_template_generator.py Adds coverage for include_oauth behavior in template context.
tests/core/test_auth_service_parser.py Adds parser tests for oauth modifier (ordering/case/duplicates/errors).
docs/services/auth/index.md Documents auth[oauth] usage, routes, and env vars.
copier.yml Adds include_oauth Copier question gated by include_auth.
aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/test_oauth_user_service.py.jinja Adds service-level tests for OAuth user upsert/linking behavior.
aegis/templates/copier-aegis-project/{{ project_slug }}/tests/api/test_oauth_endpoints.py.jinja Adds endpoint guard tests (503 when unconfigured, 401 when unauthenticated).
aegis/templates/copier-aegis-project/{{ project_slug }}/pyproject.toml.jinja Adds conditional deps for OAuth (authlib, itsdangerous).
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/models.py.jinja Adds CHECK constraints + adjusts InsightEvent.origin typing.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/collectors/pypi.py Improves per-version breakdown by grouping on installer and computing human totals.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/auth/user_service.py.jinja Adds RegistrationClosed + upsert_from_oauth service method.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/auth/deps.py.jinja Adds token extraction from either Bearer or session cookie when OAuth enabled.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/auth/deps.py Removes the non-templated deps file (replaced by .jinja).
aegis/templates/copier-aegis-project/{{ project_slug }}/app/models/user.py.jinja Adds CHECK constraint for OAuth provider and keeps provider as StrEnum.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/core/security.py.jinja Adds session-cookie helpers and SESSION_COOKIE_NAME for browser OAuth flows.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/core/log.py Suppresses noisy Stripe SDK INFO logs.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/core/config.py.jinja Adds OAuth-related settings + (currently) a DEBUG_OAUTH debug variable.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/frontend/dashboard/modals/modal_sections.py Adds reusable chart palette/tooltips/line-card + date-range chips.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/frontend/dashboard/modals/insights_modal.py Refactors Insights modal (hero/goals, charts, event chips dropdown/filtering, tables).
aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/backend/middleware/session.py.jinja Adds SessionMiddleware registration for OAuth flows (conditional).
aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/backend/api/routing.py.jinja Conditionally mounts the OAuth router under /api/v1.
aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/backend/api/auth/oauth.py.jinja Adds OAuth start/callback + connection list/unlink routes.
aegis/templates/copier-aegis-project/{{ project_slug }}/README.md.jinja Adds project-level OAuth setup docs + updates service list description.
aegis/core/template_generator.py Adds include_oauth to template context from parsed auth config.
aegis/core/post_gen_tasks.py Removes OAuth files/tests when include_oauth isn’t enabled.
aegis/core/migration_generator.py Adds CheckConstraintSpec support and renders sa.CheckConstraint(...) in migrations.
aegis/core/copier_manager.py Threads include_oauth into Copier data.
aegis/core/auth_service_parser.py Adds oauth modifier parsing and better unknown/duplicate errors.
aegis/constants.py Adds AnswerKeys.AUTH_OAUTH.

Comment thread aegis/templates/copier-aegis-project/{{ project_slug }}/app/core/config.py.jinja Outdated
Comment thread aegis/core/migration_generator.py
Comment thread aegis/core/template_generator.py Outdated
Comment thread aegis/core/copier_manager.py
@lbedner lbedner force-pushed the update-insights-overseer branch from 527e663 to b036dfb Compare April 28, 2026 20:50
@lbedner lbedner merged commit 021e440 into main Apr 28, 2026
8 checks passed
@lbedner lbedner deleted the update-insights-overseer branch April 28, 2026 20:59
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