Skip to content

Rotate CLI partners by sponsorship tier#486

Merged
tannerlinsley merged 1 commit into
mainfrom
taren/rotate-cli-partners
Jul 15, 2026
Merged

Rotate CLI partners by sponsorship tier#486
tannerlinsley merged 1 commit into
mainfrom
taren/rotate-cli-partners

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

  • order CLI partner integrations by gold, silver, and bronze sponsorship tiers
  • rotate partners within each tier for every CLI run using the same seeded placement algorithm as tanstack.com
  • reserve Cloudflare as the first deployment partner
  • add partner metadata only to currently active partners with CLI integrations

Validation

  • full monorepo build
  • 305 unit tests
  • 3 blocking end-to-end tests

Summary by CodeRabbit

  • New Features

    • Partner integrations are now displayed according to sponsorship tier.
    • Partner options rotate between CLI runs while remaining consistent within each run.
    • Deployment selections prioritize Cloudflare.
    • Added partner metadata for supported integrations and hosting providers.
  • Documentation

    • Added patch release notes for the CLI and project creation tools.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Partner metadata and schema support were added across add-ons and hosts. The CLI now orders partner options by tier with deterministic seeded rotation, prioritizes Cloudflare for deployments, integrates ordering into prompts, and adds behavioral tests and package changesets.

Changes

Partner placement

Layer / File(s) Summary
Partner metadata contract
packages/create/src/types.ts, packages/create/src/frameworks/*/add-ons/*/info.json, packages/create/src/frameworks/*/hosts/*/info.json
Add-on schemas now support partner IDs, sponsorship tiers, and optional placement weights; supported manifests declare partner metadata.
Deterministic partner ordering
packages/cli/src/partner-placement.ts, packages/cli/tests/partner-placement.test.ts
Partner add-ons are ordered by tier with seeded intra-tier rotation, stable tie-breaking, and Cloudflare-first deployment handling; tests cover these behaviors.
Prompt integration and release metadata
packages/cli/src/ui-prompts.ts, .changeset/fair-partner-placement.md
Add-on and deployment prompts use the ordering function, and patch changesets are added for the CLI and create packages.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: ordering and rotating CLI partners by sponsorship tier.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taren/rotate-cli-partners

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: private package registry requires authentication. Disable ESLint in CodeRabbit settings or use public packages.


Comment @coderabbitai help to get the list of available commands.

@tannerlinsley tannerlinsley merged commit 0c2c22b into main Jul 15, 2026
6 of 7 checks passed
@tannerlinsley tannerlinsley deleted the taren/rotate-cli-partners branch July 15, 2026 19:23
@github-actions github-actions Bot mentioned this pull request Jul 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
packages/cli/src/partner-placement.ts (2)

26-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Correct weighted-random ordering, but the math deserves a comment.

The seeded comparator correctly implements exponential-key weighted sampling (min-key variant of Efraimidis–Spirakis) for deterministic-but-rotating tie-breaking. It's mathematically sound, but non-obvious to a future reader without context.

📝 Suggested doc comment
+// Exponential-key weighted random ordering (Efraimidis–Spirakis, min-key
+// variant): each item gets a fixed pseudo-random key derived from the seed
+// and its id; smaller key sorts first, and higher `placementWeight` shrinks
+// the key, making the item more likely to appear earlier.
 function compareSeededPartnerOrder(left: AddOn, right: AddOn, seed: string) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/src/partner-placement.ts` around lines 26 - 42, Add a concise
explanatory comment above compareSeededPartnerOrder documenting that it uses
deterministic seeded exponential-key weighted sampling (the min-key
Efraimidis–Spirakis variant), while preserving compareIdentity as the
tie-breaker.

44-48: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Narrow surface to a literal union to catch typos at compile time.

surface is compared against the literal 'deployment' internally (Line 61, 65), but its type is bare string. A typo at a call site (e.g. in ui-prompts.ts) would silently skip the Cloudflare-first rule with no type error.

♻️ Suggested type narrowing
+type PartnerPlacementSurface = 'add-ons' | 'deployment'
+
 export function orderAddOnsForPartnerPlacement(
   addOns: Array<AddOn>,
-  surface: string,
+  surface: PartnerPlacementSurface,
   sessionSeed = cliSessionSeed,
 ) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/src/partner-placement.ts` around lines 44 - 48, Update the
surface parameter of orderAddOnsForPartnerPlacement to a literal union
containing the supported surface values, including deployment, so invalid
call-site strings fail at compile time while preserving the existing deployment
comparison behavior.
packages/cli/tests/partner-placement.test.ts (1)

39-55: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

No test coverage for placementWeight.

placementWeight directly affects the seeded comparator's key computation but is never exercised here — both fixtures use the default weight of 1. A regression in the weight handling (e.g. inverted division) wouldn't be caught.

Consider adding a case where one partner has a much larger placementWeight and asserting it wins across a spread of seeds (or at least a specific seed where the effect is deterministic and verifiable).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/tests/partner-placement.test.ts` around lines 39 - 55, The test
covering orderAddOnsForPartnerPlacement only uses the default placementWeight,
so weighted comparator regressions are untested. Update the partners fixture to
include a substantially different placementWeight and add assertions across
representative CLI session seeds confirming the expected weighted ordering,
while preserving the existing default-weight rotation coverage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/cli/src/partner-placement.ts`:
- Around line 26-42: Add a concise explanatory comment above
compareSeededPartnerOrder documenting that it uses deterministic seeded
exponential-key weighted sampling (the min-key Efraimidis–Spirakis variant),
while preserving compareIdentity as the tie-breaker.
- Around line 44-48: Update the surface parameter of
orderAddOnsForPartnerPlacement to a literal union containing the supported
surface values, including deployment, so invalid call-site strings fail at
compile time while preserving the existing deployment comparison behavior.

In `@packages/cli/tests/partner-placement.test.ts`:
- Around line 39-55: The test covering orderAddOnsForPartnerPlacement only uses
the default placementWeight, so weighted comparator regressions are untested.
Update the partners fixture to include a substantially different placementWeight
and add assertions across representative CLI session seeds confirming the
expected weighted ordering, while preserving the existing default-weight
rotation coverage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 55c68efa-5aa1-451d-9273-1e03b1cc05c7

📥 Commits

Reviewing files that changed from the base of the PR and between 12c31df and 2836d44.

📒 Files selected for processing (16)
  • .changeset/fair-partner-placement.md
  • packages/cli/src/partner-placement.ts
  • packages/cli/src/ui-prompts.ts
  • packages/cli/tests/partner-placement.test.ts
  • packages/create/src/frameworks/react/add-ons/clerk/info.json
  • packages/create/src/frameworks/react/add-ons/prisma/info.json
  • packages/create/src/frameworks/react/add-ons/sentry/info.json
  • packages/create/src/frameworks/react/add-ons/workos/info.json
  • packages/create/src/frameworks/react/hosts/cloudflare/info.json
  • packages/create/src/frameworks/react/hosts/netlify/info.json
  • packages/create/src/frameworks/react/hosts/railway/info.json
  • packages/create/src/frameworks/solid/add-ons/sentry/info.json
  • packages/create/src/frameworks/solid/hosts/cloudflare/info.json
  • packages/create/src/frameworks/solid/hosts/netlify/info.json
  • packages/create/src/frameworks/solid/hosts/railway/info.json
  • packages/create/src/types.ts

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.

1 participant