feat(activation): one-step maintainer activation preview + advisory ramp (#701) - #708
Conversation
…amp (#701) Make the maintainer payoff self-evident at install: a repo-specific demo of what Gittensory would surface, plus a one-click advisory ramp. - `src/services/maintainer-activation.ts`: `buildMaintainerActivationPreview` runs the deterministic advisory engine (buildPullRequestAdvisory) over the repo's most recent PRs and returns "here's what Gittensory would have surfaced on N of your last M PRs" — per-PR findings + distinct finding-code counts + the current gate mode + whether AI review is configured + the single recommended next action. Pure over already-loaded data; NEVER runs AI (no surprise cost) — it only reports whether AI review is already on. - `recommendedAdvisoryActivationSettings()`: the one-click patch — enables the gate + deterministic rules in ADVISORY (non-blocking) mode, advisory-first per the #525 cross-cutting AC. AI review stays opt-in (separate ai-review route). - Routes (maintainer-scoped via requireRepoMaintainer; new `isRepoActivationPath` in canSessionAccessPath): GET `/v1/repos/:owner/:repo/activation-preview` and POST `/v1/repos/:owner/:repo/activation` (merges the advisory patch onto current settings, preserving unrelated fields). Reuses the existing gate engine + repo-settings infra (#647/#648); does not duplicate settings-preview (which previews ONE hypothetical PR — this previews the repo's REAL recent PRs). The dashboard rendering of this preview stays owner-led (visual). Email/AI live-preview remain out of scope. Tests: service unit (finding summary, recommended-action logic, AI-config flag, empty repo, sample-size clamp + recency fallback, code-count tie-break) + integration (maintainer preview + one-click flip persists; non-maintainer 403; server-to-server allowed). 97% coverage gate green; workers tests pass.
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
gittensory · advisory review Reviewed 4 changed file(s) — two independent AI reviewers. Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
…hboard Closes JSONbored#2217 Adds OnboardingPreviewCard, which auto-runs the existing settings-preview simulator (buildSettingsPreviewRequest) against a repo's most recently cached pull request on first visit, so a maintainer sees "here's what Gittensory would have flagged" without filling out SurfacePreview's form. Reuses PreviewResult (now exported) for the decision/checklist/comment rendering rather than duplicating it. Dismissible via the same localStorage first-visit idiom app.index.tsx's OnboardingChecklist uses. Distinct from ActivationPreview (JSONbored#701/JSONbored#708): that shows aggregate multi-PR evaluation stats from a dedicated endpoint; this shows one demo run's full policy decision from the settings-preview pipeline.
…hboard (#4718) * feat(ui): add first-session onboarding preview card to maintainer dashboard Closes #2217 Adds OnboardingPreviewCard, which auto-runs the existing settings-preview simulator (buildSettingsPreviewRequest) against a repo's most recently cached pull request on first visit, so a maintainer sees "here's what Gittensory would have flagged" without filling out SurfacePreview's form. Reuses PreviewResult (now exported) for the decision/checklist/comment rendering rather than duplicating it. Dismissible via the same localStorage first-visit idiom app.index.tsx's OnboardingChecklist uses. Distinct from ActivationPreview (#701/#708): that shows aggregate multi-PR evaluation stats from a dedicated endpoint; this shows one demo run's full policy decision from the settings-preview pipeline. * test(ui): add checkRunReadiness to the onboarding-preview-card fixture Required field added by the merged check-run-readiness-table PR (#2216); keeps the SettingsPreviewResponse test fixture in sync post-rebase.
What
Makes the maintainer payoff self-evident at install (#701): a repo-specific demo of what Gittensory would surface on the repo's recent PRs, plus a one-click advisory ramp.
src/services/maintainer-activation.ts—buildMaintainerActivationPreviewruns the deterministic advisory engine (buildPullRequestAdvisory) over the repo's most recent PRs and returns "Gittensory reviewed your N most recent PRs and would have surfaced guidance on M of them": per-PR findings, distinct finding-code counts, the current gate mode, whether AI review is already configured, and the single recommended next action. Pure over already-loaded data; never runs AI (no surprise cost) — it only reports whether AI review is on.recommendedAdvisoryActivationSettings()— the one-click patch: enables the gate + deterministic rules in advisory (non-blocking) mode, advisory-first per the roadmap: contribution quality & adoption wave #525 cross-cutting AC. AI review stays opt-in (separateai-reviewroute).requireRepoMaintainer; newisRepoActivationPathincanSessionAccessPath):GET /v1/repos/:owner/:repo/activation-previewPOST /v1/repos/:owner/:repo/activation— merges the advisory patch onto current settings, preserving unrelated fields.Why / boundaries
Reuses the existing gate engine + repo-settings infra (#647/PR #648) — does not duplicate
settings-preview(which previews one hypothetical PR; this previews the repo's real recent PRs). The dashboard rendering of this preview stays owner-led (visual). A live AI run over recent PRs + email remain out of scope (the live AI run would need cached diffs + incur cost).Access boundary
Both routes are maintainer-scoped (
requireRepoMaintainer→ role check + per-reporequireSessionRepoAccess); operators and server-to-server tokens bypass per-repo scope by design. No public/miner surface added.Tests
maintainer-activation.test.ts(unit): finding summary + counts, recommended-action logic (off → enable / enabled → null), AI-config flag, empty repo, sample-size clamp + recency fallback, code-count tie-break.maintainer-activation.test.ts(integration): maintainer preview → one-click flip persists (getRepositorySettingsreflectsgateCheckMode: enabled) → preview now reports nothing to enable; non-maintainer session → 403; server-to-server token allowed.git diff --check+ui:openapi:checkpass.Advances #701 (the non-visual activation-preview service + one-click ramp). Dashboard rendering is the remaining owner-led visual piece.