Skip to content

[backport core/1.55] FE-3013 feat(pricing): read the plan's raw credit grant from the catalog - #19446

Closed
comfy-pr-bot wants to merge 1 commit into
core/1.55from
backport-18873-to-core-1.55
Closed

comfy-pr-bot wants to merge 1 commit into
core/1.55from
backport-18873-to-core-1.55

Conversation

@comfy-pr-bot

Copy link
Copy Markdown
Member

Backport of #18873 to core/1.55

Automatically created by backport workflow.

…log (#18873)

## Summary

The pricing cards read the plan's raw credit grant from the backend
(`Plan.credits`, added in Comfy-Org/cloud#10703) instead of the
hardcoded `TIER_PRICING` figure. They fall back to the static grant only
when the field is absent.

- Follows #18867 (the FE-3013 hotfix). Part of FE-3013.
- Comfy-Org/cloud#10703 is merged and live on test-v2. The generated
`Plan.credits` type and its SDK projection landed on `main` through
#19212, so this PR is now only the pricing surfaces reading it. Until
prod serves the field, both tables fall back to the static grant.

## Why

The hotfix #18867 stops misreading `credits_cents` by going back to a
static grant. A static grant cannot follow a catalog change. Converting
`credits_cents` cannot produce the real grant either, because the
backend rounds it to whole cents: 23,887¢ → 50,402, while the catalog
grants 50,400. The backend now sends the grant itself.

## Root cause

`Plan` exposed the grant only as `credits_cents`. The raw count the
subscription actually receives, the catalog's `credit_grant`, never
reached the client.

## How

- `Plan.credits` (generated types) and its safe-number projection in
`billingPlansView.ts` are on `main` via #19212.
- `UnifiedPricingTable.vue` / `PricingTableWorkspace.vue`: `plan.credits
?? amountForBillingCycle(static)`. The value is read straight off the
server; nothing is derived.
- Tests: the catalog grant wins over the static figure on the matching
cycle only. The #18867 tests still pin the fallback (field absent) to
the static grant.

## Screenshots

Both builds run locally against the Comfy-Org/cloud#10703 preview
backend (`pr-10703.testenvs.comfy.org`). The page's own `GET
/api/billing/plans` response already carries `credits`:

| slug | `credits_cents` | `credits` |
| --- | --- | --- |
| standard-monthly | 1,991 | 4,200 |
| standard-annual | 23,887 | 50,400 |
| creator-monthly | 3,508 | 7,400 |
| creator-annual | 42,086 | 88,800 |
| pro-monthly | 10,000 | 21,100 |
| pro-annual | 120,000 | 253,200 |

AS IS (#18867, `86fba0349b`, static grant): Yearly 50,400 / 88,800 /
253,200; Monthly 4,200 / 7,400 / 21,100.

| Yearly | Monthly |
| --- | --- |
| <img width="480" alt="asis-yearly"
src="https://github.com/user-attachments/assets/a790c178-0acd-4a1f-9f38-b1925ddbddc2"
/> | <img width="480" alt="asis-monthly"
src="https://github.com/user-attachments/assets/3dfb46e7-f7cc-486b-98af-8f49a15265ef"
/> |

TO BE (`a7270257f7`, reads `plan.credits`): same figures, Yearly 50,400
/ 88,800 / 253,200; Monthly 4,200 / 7,400 / 21,100. The numbers now come
from the API instead of the static table.

| Yearly | Monthly |
| --- | --- |
| <img width="480" alt="tobe-yearly"
src="https://github.com/user-attachments/assets/94eafd26-f717-4d31-a6c6-8d2e861617fe"
/> | <img width="480" alt="tobe-monthly"
src="https://github.com/user-attachments/assets/6e7733e0-71d1-44ee-9b43-b5f318dbcbe7"
/> |
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🌾 Fallow: ✅ Passed

Fallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened.

No new findings in the changed files.

Reproduce locally
# the base the gate compared against
npx fallow audit --root . --quiet --format json \
  --changed-since 6635cb05905e0086d88ea7de51f1e61295f6e685

Full docs: ADR-DEVEX-LINT-0015

🎭 Playwright: 🕵🏻 0 passed, 0 failed

📊 Browser Reports
  • chromium: ❌ Deployment failed
  • chromium-2x: ❌ Deployment failed
  • chromium-0.5x: ❌ Deployment failed
  • mobile-chrome: ❌ Deployment failed

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 09/29/2026, 06:35:54 PM UTC

Links

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance

⚠️ Performance tests failed. Check the CI workflow logs.

🔬 E2E Coverage

⚠️ Coverage collection failed. Check the CI workflow logs.

🧩 Custom Nodes Ecosystem Matrix: ✅ Passed

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

Stage Result What a failure here means
pin-status success Informational. It never fails the build; it warns when the corpus snapshot is over 30 days old.
corpus success Infrastructure: the pack mirror could not be fetched, validated or cached. Not your diff.
shards success Harness integrity, not pack breakage. A shard only checks that every built spec wrote its row; vitest's own exit code is deliberately ignored because pack code leaks unhandled rejections.
verdicts success The population verdict per renderer. This is the stage that judges packs. Exit 1 is FAIL; exit 2 is withheld — rows were missing, so nothing was measured, which is not the same as your change breaking packs.
detection-proofs success The instrument self-test: the matrix must FAIL on a deliberately poisoned corpus. A failure here means the gate cannot be trusted this run, in either direction.

On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff.

Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped.

Reproduce locally
# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
  npx vitest run --config vitest.matrix.config.mts

Full docs: scripts/registry-census/README.md

@github-actions github-actions Bot added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Sep 29, 2026
@datadog-official

datadog-official Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Pipelines

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 9 Pipeline jobs failed

CI: Dist Telemetry Scan | scan — 🔧 Needs a code fix, caused by this PR

View in Datadog · View in GitHub Actions

CI: Lint Format | typecheck — 🔧 Needs a code fix, caused by this PR

View in Datadog · View in GitHub Actions

CI: Lint Format | typecheck-aux — 🔧 Needs a code fix, caused by this PR

View in Datadog · View in GitHub Actions

View all 9 failed jobs.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2887193 | Docs | View more details | Give us feedback!

@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@              Coverage Diff              @@
##           core/1.55   #19446      +/-   ##
=============================================
- Coverage      84.69%   84.69%   -0.01%     
=============================================
  Files           2322     2322              
  Lines         132841   132843       +2     
  Branches       35638    33746    -1892     
=============================================
- Hits          112507   112505       -2     
- Misses         19982    19986       +4     
  Partials         352      352              
Flag Coverage Δ
unit 80.66% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...orm/workspace/components/PricingTableWorkspace.vue 80.92% <100.00%> (+0.11%) ⬆️
...tform/workspace/components/UnifiedPricingTable.vue 93.75% <100.00%> (+0.02%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dante01yoon

Copy link
Copy Markdown
Collaborator

Closing without a core/1.55 backport. This change makes the Cloud pricing table read Plan.credits, and core/1.55 has neither the generated Plan.credits type nor its int64 projection (#19212 was not backported there). Core builds never render the Cloud pricing surfaces, so skipping this backport changes nothing for core users. The cloud/1.55 backport is #19447.

auto-merge was automatically disabled September 29, 2026 21:55

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Backporting a PR onto a release candidate risk:xhigh PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants