Skip to content

feat(archera): soft-pitch insurance after CLI purchase + update web signup link#1280

Merged
cristim merged 3 commits into
mainfrom
feat/archera-cli-pitch-web-link
Jul 1, 2026
Merged

feat(archera): soft-pitch insurance after CLI purchase + update web signup link#1280
cristim merged 3 commits into
mainfrom
feat/archera-cli-pitch-web-link

Conversation

@cristim

@cristim cristim commented Jun 25, 2026

Copy link
Copy Markdown
Member

What

Two related Archera changes:

  1. CLI soft pitch after a purchase. After a successful real Reserved Instance purchase, the CLI now prints a short, non-blocking suggestion to insure commitments to 100% coverage through Archera within the first 7 days, followed by the sponsorship disclosure.
  2. Web interface signup link. The frontend ARCHERA_SIGNUP_URL is updated to the new canonical attribution URL https://www.archera.ai/cudly, matching the URL used by the CLI pitch.

Details

  • cmd/multi_service_stats.go: new archeraSignupURL const + printArcheraPitch(). The pitch is gated on !isDryRun && riSuccess > 0, so it never appears on dry runs or runs with zero successful purchases.
  • cmd/multi_service_stats_test.go: TestPrintFinalMessage regression test covering all three cases — dry-run (no pitch), zero-success (no pitch), and success (pitch + URL + 7-day window + sponsorship disclosure all visible).
  • frontend/src/archera.ts: ARCHERA_SIGNUP_URL -> https://www.archera.ai/cudly (and its docstring). The existing frontend tests assert against the exported const, so they remain green.

Pitch copy (CLI)

🛡️ Want to push your coverage to 100% without the risk that a future capacity decrease leaves you paying for commitments you no longer use? You can buy underutilization insurance for Reserved Instances and Savings Plans from Archera by signing up at https://www.archera.ai/cudly within the first 7 days of the purchase.

For full disclosure, Archera sponsors CUDly's Open Source development from a fraction of their insurance premiums.

Out of scope / follow-up

The approval/confirmation email templates (internal/email/templates.go, asserted in internal/email/template_renderers_test.go) still reference the prior https://archera.ai/signup?mode=cudly URL. This PR is scoped to the web interface + CLI as requested. If the new URL should be canonical everywhere, the email templates and their test should be updated in a follow-up.

Testing

  • go build ./cmd/... — success
  • go test ./cmd/ -run TestPrintFinalMessage — 4 pass
  • npx jest archera (frontend) — pass

Summary by CodeRabbit

  • New Features
    • Added an additional post-purchase messaging block after successful reserved instance purchases, including a sponsorship/disclosure note and a signup link (not shown in dry-run mode).
  • Bug Fixes
    • Updated the signup link to the current canonical Archera website URL so offer and education signups point to the correct destination.
  • Tests
    • Added coverage to verify the messaging block and signup link behavior across dry-run and purchase-success scenarios.

…ignup link

After a successful real RI purchase, the CLI now prints a non-blocking
suggestion to insure commitments to 100% coverage via Archera within the
first 7 days, followed by the sponsorship disclosure. The pitch is gated on
`!isDryRun && riSuccess > 0` so it never shows on dry runs or zero-purchase
runs.

The web interface (frontend) Archera signup link is updated to the new
canonical attribution URL https://www.archera.ai/cudly, matching the URL used
by the CLI pitch.

- cmd/multi_service_stats.go: add archeraSignupURL const + printArcheraPitch()
- cmd/multi_service_stats_test.go: regression test covering dry-run (no pitch),
  zero-success (no pitch), and success (pitch + URL + disclosure visible)
- frontend/src/archera.ts: ARCHERA_SIGNUP_URL -> https://www.archera.ai/cudly

Note: email templates (internal/email/templates.go) still reference the prior
archera.ai/signup?mode=cudly URL; left out of this change as it targets the
web interface + CLI only.
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@cristim, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 34 minutes and 19 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 75f44d37-e43d-44a4-ad3d-96e0e0c949e7

📥 Commits

Reviewing files that changed from the base of the PR and between a4ed50e and e250de0.

📒 Files selected for processing (2)
  • cmd/multi_service_stats.go
  • cmd/multi_service_stats_test.go
📝 Walkthrough

Walkthrough

The CLI final message now prints an Archera pitch after successful reserved-instance purchases, tests cover the new output conditions, and the frontend Archera signup URL now points to the canonical destination.

Changes

Archera pitch and signup URL

Layer / File(s) Summary
CLI pitch output
cmd/multi_service_stats.go, cmd/multi_service_stats_test.go
printFinalMessage now emits the Archera pitch only after successful purchases, and the new test checks dry-run, zero-success, and success output.
Frontend signup URL
frontend/src/archera.ts
ARCHERA_SIGNUP_URL now points to https://www.archera.ai/cudly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I’m a rabbit with a twitchy nose,
I hopped through pitches and URL glows.
A carrot toast for code so neat,
With tests and links and bunny feet. 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: a CLI post-purchase Archera pitch and an updated web signup link.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/archera-cli-pitch-web-link

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

@cristim cristim added type/feat New capability priority/p2 Backlog-worthy severity/low Minor harm urgency/this-quarter Within the quarter impact/all-users Affects every user effort/s Hours triaged Item has been triaged labels Jun 25, 2026
@cristim

cristim commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
cmd/multi_service_stats_test.go (1)

529-532: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Pin the canonical URL in this assertion.

Using archeraSignupURL here only proves the message prints whatever the production constant currently contains. It will not catch a regression where the constant changes to the wrong destination. Assert the canonical literal URL (or add a dedicated literal-value test) so this PR’s contract is actually covered.

Suggested change
-			wantOutput: []string{"Purchase operations completed", "underutilization insurance", archeraSignupURL, "first 7 days", "sponsors CUDly's Open Source"},
+			wantOutput: []string{"Purchase operations completed", "underutilization insurance", "https://www.archera.ai/cudly", "first 7 days", "sponsors CUDly's Open Source"},
🤖 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 `@cmd/multi_service_stats_test.go` around lines 529 - 532, The test case in
multi_service_stats_test.go is only checking the archeraSignupURL constant value
indirectly, so it won’t catch a bad redirect target. Update the assertion in the
"Successful purchase shows Archera pitch with URL and disclosure" case to pin
the canonical literal URL directly (or add a separate literal-value assertion)
in the wantOutput for the purchase flow. Use the existing test data around the
purchase-success scenario and the archeraSignupURL reference to locate the
assertion.
🤖 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 `@cmd/multi_service_stats_test.go`:
- Around line 529-532: The test case in multi_service_stats_test.go is only
checking the archeraSignupURL constant value indirectly, so it won’t catch a bad
redirect target. Update the assertion in the "Successful purchase shows Archera
pitch with URL and disclosure" case to pin the canonical literal URL directly
(or add a separate literal-value assertion) in the wantOutput for the purchase
flow. Use the existing test data around the purchase-success scenario and the
archeraSignupURL reference to locate the assertion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d2dddb6d-f56a-4c26-85bd-98e19e93dd7f

📥 Commits

Reviewing files that changed from the base of the PR and between 451a70f and 3e45c11.

📒 Files selected for processing (3)
  • cmd/multi_service_stats.go
  • cmd/multi_service_stats_test.go
  • frontend/src/archera.ts

Replace archeraSignupURL constant with the literal URL in the positive
wantOutput assertion so the test catches regressions where the constant
changes to a wrong destination, not just that the constant's current
value appears in output.
@cristim

cristim commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@cristim

cristim commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

The CLI pitch printed after a successful RI purchase included the
sponsorship disclosure but not the non-gating disclosure ("CUDly works
fully without Archera"). The project_archera_partnership memory commits
to keeping BOTH disclosures visible everywhere the Archera integration
is surfaced: education pages, modal CTAs, email templates, and now the
CLI pitch.

Add the non-gating disclosure as a short paragraph between the signup
prompt and the sponsorship paragraph, and extend the regression test to
assert both disclosures appear in the success-path output.
@cristim

cristim commented Jun 26, 2026

Copy link
Copy Markdown
Member Author

Adversarial review applied (PR #1280):

In-scope fix landed (e250de0): the CLI pitch carried the sponsorship disclosure but was missing the non-gating disclosure. The project_archera_partnership memory commits to keeping both disclosures visible everywhere the integration is surfaced (education pages, modal CTAs, email templates — and now the CLI). Added a short "This is entirely optional. CUDly's purchase and management features work fully without Archera." paragraph between the signup prompt and the sponsorship paragraph, and extended TestPrintFinalMessage to assert both disclosures in the success-path output.

Adversarial findings on the rest of the PR — all green:

  • CLI UX: printArcheraPitch() is pure stdout via AppLogger.Println — non-blocking, no prompt, no stdin. Matches the feedback_no_confirmations rule.
  • Signup URL: static https://www.archera.ai/cudly, no UTM, no PII. Matches feedback_pii_in_logs.
  • Conditional emission: gated on !isDryRun && riSuccess > 0. Negative tests cover both dry-run and zero-success.
  • Magic values: the "7-day" enrollment window is a contractual partnership policy (see feat(frontend): Archera Insurance CTA in Purchase + Plan-creation modals + education pages #314 scope), not a derivable value — comment makes the source explicit.
  • No em-dashes in the pitch copy.

UNSTABLE check: all three failing checks (Lint Code, Security Scanning, Integration Tests) reproduce on main and originate in files entirely outside this PR's diff (errcheck across cmd/configure_*.go, internal/api/*, internal/auth/*; npm @typescript-eslint advisories in frontend/node_modules; Postgres integration tests in internal/config). They predate #1280 and are not regressions introduced by it.

Follow-ups filed (out of scope):

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@cristim Thanks for the detailed adversarial pass — noted the in-scope disclosure fix, the non-gating requirement across all Archera surfaces, and the out-of-scope follow-ups in #1281 and #1282. I’ll review the PR again with that context in mind.

(•ᴗ•)っ🐇


✏️ Learnings added
Learnt from: cristim
URL: https://github.com/LeanerCloud/CUDly/pull/1280

Timestamp: 2026-06-26T13:26:59.753Z
Learning: In the LeanerCloud/CUDly codebase, all Archera integration surfaces must show both disclosures: a sponsorship disclosure and an explicit non-gating disclosure that Archera is entirely optional and CUDly purchase/management features work fully without it. This applies across education pages, modal CTAs, email templates, and the CLI, per the `project_archera_partnership` guidance.

Learnt from: cristim
URL: https://github.com/LeanerCloud/CUDly/pull/1280

Timestamp: 2026-06-26T13:26:59.753Z
Learning: In the LeanerCloud/CUDly Archera messaging, the "7-day" enrollment window is a contractual partnership policy referenced from issue `#314` scope, not a derivable value, so reviews should treat it as intentional policy text rather than a magic number to compute.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim cristim merged commit 5f712a0 into main Jul 1, 2026
14 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours impact/all-users Affects every user priority/p2 Backlog-worthy severity/low Minor harm triaged Item has been triaged type/feat New capability urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant