feat(enterprise) adoption recommendations#4215
Merged
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summary (commit 545fd5f)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 545fd5f)Status: 1 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (17 files)
Reviewed by gpt-5.4-2026-03-05 · Input: 85.8K · Output: 4.3K · Cached: 143.3K Review guidance: REVIEW.md from base branch |
marius-kilocode
approved these changes
Jun 23, 2026
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.
Summary
Adds an adoption Recommendations feature to the Enterprise usage analytics view. For Enterprise organizations, the feature-adoption page now surfaces actionable suggestions for getting more out of features the org already uses (for example: add a security focus to Code Reviewer, turn on a merge gate, enable Security Agent SLAs, reconnect a broken integration, set up SSO, invite members to unused seats). Recommendations are grouped into Open, Completed, and Dismissed tabs, and owners can dismiss or restore them.
The recommendation set is computed in code from the organization's current state, so there is no per-recommendation storage. The only new persisted data is which recommendations an org has dismissed.
Changes
recommendations.ts.buildRecommendationsis a pure function over an org'sRecommendationState; each rule reportsopen(gap exists),completed(good state reached), or is omitted when the feature is not enabled.getRecommendationStateandgetOrganizationRecommendationsgather the state from the DB and apply dismissals. Non-enterprise orgs return an empty result.RecommendationsView.tsxcomponent with Open/Completed/Dismissed tabs, per-recommendation deep links, owner-only dismiss/restore, and an undo toast on dismiss.StatusDonutChart.tsx(recharts), used by both the recommendations view and the feature-adoption card.FeatureAdoptionViewnow renders the status donut and switches between the feature-adoption and recommendations queries based on itscompactprop.UsageAnalyticsDashboardrendersRecommendationsViewbelow the adoption view, passingcanDismissonly for owners.getRecommendations(member access), anddismissRecommendation/restoreRecommendation(owner-only mutations). All three are gated to the Enterprise plan.organization_recommendation_dismissalstable (migration0172plus schema), unique on (organization, recommendation key).dismissed_by_user_idis nullable and set to null on user delete so dismissals persist.softDeleteUsernow nulls these actor references.getOrganizationSeatUsagereworked to count seats with direct aggregate queries: active non-bot, non-billing-manager members plus pending (unaccepted, unexpired) non-billing-manager invitations. Previously it only counted loaded members. This feeds the unused-seats recommendation. Note: pending invitations now count toward used seats.getFeatureAdoptionStateandFeatureAdoptionStatefromfeature-adoption.ts, andfeatureIconsfromFeatureAdoptionView, for reuse by the recommendation code.Verification
Visual Changes
Reviewer Notes
org-github-lite-apprule.