Skip to content

[chore] Update Ingest API types from cloud@2f554c4 - #15813

Closed
comfy-pr-bot wants to merge 1 commit into
mainfrom
update-ingest-types
Closed

comfy-pr-bot wants to merge 1 commit into
mainfrom
update-ingest-types

Conversation

@comfy-pr-bot

@comfy-pr-bot comfy-pr-bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Member

Automated Ingest API Type Update

This PR updates the Ingest API TypeScript types and Zod schemas from the latest cloud OpenAPI specification.

  • Cloud commit: 2f554c4
  • Generated using @hey-api/openapi-ts with Zod plugin

These types cover the FE-facing ingest API (workspaces, billing, secrets, assets, tasks, etc.).
Cloud's internal / machine-to-machine surface — x-internal operations and the
/admin/, /api/internal/, /api/webhooks/ rails — is stripped before generation
(BE-2669), so it is not code-generated into this public package.

@comfy-pr-bot
comfy-pr-bot requested a review from a team August 24, 2026 20:23
@dosubot dosubot Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Aug 24, 2026
@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 08/24/2026, 10:25:47 PM UTC

Links

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

🎭 Playwright: 🕵🏻 0 passed, 0 failed

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

📦 Bundle Size

⚠️ Size data collection failed. Check the CI workflow logs.

⚡ Performance

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

@github-actions
github-actions Bot requested a review from thedatalife August 24, 2026 20:24
@codecov

codecov Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main   #15813      +/-   ##
==========================================
+ Coverage   80.00%   80.06%   +0.05%     
==========================================
  Files        2250     2250              
  Lines      114208   114539     +331     
  Branches    31131    31131              
==========================================
+ Hits        91375    91700     +325     
+ Misses      22366    22363       -3     
- Partials      467      476       +9     
Flag Coverage Δ
unit 74.33% <ø> (+<0.01%) ⬆️
website-unit 27.00% <ø> (ø)

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

Files with missing lines Coverage Δ
packages/ingest-types/src/zod.gen.ts 100.00% <ø> (ø)

... and 9 files 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.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Aug 24, 2026
@github-actions github-actions Bot added the risk:R2 PR risk grade (advisory shadow check; grader-owned) label Aug 24, 2026
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Aug 24, 2026
@datadog-official

datadog-official Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

🚦 8 Pipeline jobs failed

CI: Dist Telemetry Scan | scan

View in Datadog · View in GitHub Actions

Type error in useBillingPolicyState.ts: string is not assignable to type BillingPolicyState and 'ENTERPRISE' does not satisfy expected type 'never'.

CI: Lint Format | lint-and-format

View in Datadog · View in GitHub Actions

Type 'string' is not assignable to type 'BillingPolicyState' at src/platform/cloud/subscription/composables/useBillingPolicyState.ts:47

CI: OSS Assets Validation | validate-fonts

View in Datadog · View in GitHub Actions

Type 'string' is not assignable to type 'BillingPolicyState' in useBillingPolicyState.ts:47:7.

View all 8 failed jobs.

Useful? React with 👍 / 👎

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

@comfy-pr-bot comfy-pr-bot changed the title [chore] Update Ingest API types from cloud@fa7150b [chore] Update Ingest API types from cloud@2f554c4 Aug 24, 2026
dante01yoon added a commit that referenced this pull request Aug 25, 2026
Stacked on the ingest-types regeneration (#15813) and the tier guard
(#15838). ENTERPRISE now arrives through the generated union, so the
policy derivation matches it as a typed case instead of string-sniffing
tier or plan_slug: active takes the team policy states, lapsed keeps a
dedicated Enterprise state so a sales-managed customer is never shown
the personal subscribe upsell. The workspace tier label maps ENTERPRISE
and tolerates lowercase plan slugs (enterprise_monthly).

No regression to existing tiers: a characterization matrix pins all 28
pre-ENTERPRISE input combinations in both distributions, and the same
matrix passes unchanged against main's implementation.
dante01yoon added a commit that referenced this pull request Aug 25, 2026
…act (#15855)

## Why this is needed

Enterprise workspaces exist in production (cloud#6873 provisioned the
plan rows, cloud#6874 published the tier in the contract), but the
frontend cannot represent them: the tier label renders nothing and a
lapsed Enterprise workspace is classified as an ordinary no-subscription
state, exposing the personal subscribe upsell to a sales-managed
customer. The prior attempt (#15403) blocked on deriving this from
`tier`/`plan_slug` string-sniffing because the generated enum could not
carry `ENTERPRISE`. It can now — this PR consumes it as a typed contract
value, no hand-declared or inferred types anywhere.

## Stack — merge order

1. #15838 — tier guard (makes main tolerate unknown tiers)
2. #15813 — ingest-types regeneration (bot-generated, brings
`ENTERPRISE` into the union)
3. **this PR** — typed Enterprise rendering

This branch is stacked on both, so the diff shown against `main`
includes their commits until they merge; the ENTERPRISE handling itself
is the single commit `e7c9ca9` (139 lines, 9 files).

## Root cause

`deriveBillingPolicyState` had no representation for a workspace-level,
sales-managed tier: active-or-lapsed Enterprise fell through to either
the Team branch (never — `isTeamPlan` is false for it) or the generic
`WithoutActiveSubscription`, whose capabilities row upsells self-serve
subscribe. The tier label map simply had no `ENTERPRISE` entry, and
cloud sends lowercase plan slugs (`enterprise_monthly`) that the
uppercase-keyed matcher missed.

## How it changes

- `deriveBillingPolicyState`: typed `input.tier === 'ENTERPRISE'` branch
— active → `{Cloud,Local}AndTeam` (existing team policy), lapsed → new
`{Cloud,Local}EnterpriseWithoutActiveSubscription` state.
- `getBillingPolicyCapabilities`: rows for the new states —
`topUpAccess: 'allowed'`, `showsSubscribeUpsellUI: false`. Sales-managed
reactivation goes through sales, so unlike the lapsed self-serve Team
state it neither withholds top-up nor upsells. This matches the
server-side capability resolver, which resolves
`can_subscribe_self_serve=false` while leaving `can_top_up` open for
Enterprise (verified by executing cloud's resolver during the cloud#7223
review).
- `useWorkspaceTierLabel`: `ENTERPRISE → 'enterprise'` label key;
plan-slug matching now uppercases first so cloud's lowercase slugs
resolve.
- Locale: `subscription.tiers.enterprise.name`.

These policy rows live in the client-side layer that the capabilities
migration stack (#15802–#15675) later deletes in favor of
server-resolved `can_*` values — at which point only the label mapping
survives. That is the intended end state; this PR is the bridge that
makes Enterprise render correctly until then.

## Regression guarantee

- **Characterization matrix**: a new test pins all 28 pre-ENTERPRISE
input combinations (7 tiers × canAccess × isTeamPlan) in both
distributions. The identical matrix was executed against `main`'s
implementation — 28/28 pass — proving every non-ENTERPRISE input
produces byte-identical output before and after.
- **Exhaustive capabilities table**: the per-state test enumerates every
`BillingPolicyState` kind; adding a state without a row is a compile
error, and every pre-existing row is unchanged.
- 26 test files / 380 tests green across
`src/platform/cloud/subscription` and the tier-label suite; `pnpm
typecheck` green against the regenerated types.
- Unknown-future-tier behavior from #15838 retained and re-pinned with a
non-ENTERPRISE exemplar.

## AS-IS / TO-BE

- AS-IS: Enterprise workspace shows no tier label; lapsed Enterprise
sees personal subscribe/upgrade upsell.
- TO-BE: "Enterprise" label renders from the typed tier (including from
`enterprise_monthly`/`enterprise_annual` plan slugs); lapsed Enterprise
keeps top-up but never sees self-serve upsell.

UI screenshots require an Enterprise-provisioned cloud workspace; the
rendered-behavior coverage here is the unit matrix plus the full
Playwright suite on CI. Real-app captures can be added once a staging
Enterprise workspace is available.

---------

Co-authored-by: dante01yoon <6510430+dante01yoon@users.noreply.github.com>
Co-authored-by: Wei Hai <wei@comfy.org>
Co-authored-by: GitHub Action <action@github.com>
@dante01yoon

Copy link
Copy Markdown
Collaborator

Content landed on main via #15855 (commit d853072), which carried this branch's generated commit byte-identical — the diff against main is now empty. Closing; the projection workflow will reuse/recreate this fixed branch on the next cloud openapi change.

nav-tej pushed a commit to balpreetgrowthnatives/ComfyUI_frontend that referenced this pull request Aug 25, 2026
## Summary

Restores `packages/ingest-types` to the pipeline-projected output.
Comfy-Org#15802 regenerated these files by running the generator locally, which
bypassed part of the projection filter.

## What went wrong

`packages/ingest-types/openapi-ts.config.ts` excludes only the webhook
and internal rails. The `push-ingest-types-to-frontend` pipeline
additionally strips `x-internal` operations and the admin rails before
generating. Running `pnpm generate` against the raw spec therefore
emitted operations the projection has never carried:

| | before Comfy-Org#15802 | after Comfy-Org#15802 | this PR |
|---|---|---|---|
| `Admin` references in `types.gen.ts` | 0 | 43 | **0** |
| admin paths | 0 | 24 | **0** |

Concretely that added `AdminBillingCancelSubscription`,
`AdminBillingCreditGrant`, `AdminBillingPlanChange` and related
operation types to a public repo. Generated files should change only
through the bot's `[chore]` PRs; this restores that invariant.

## Why the regeneration wasn't needed

It was done to pull `rollout_defaults_applied`, `revision` and
`expires_at` into `BillingCapabilitiesResponse` for the capabilities
stack. Those fields were **already** on `main` — they arrived with
Comfy-Org#15855 via the bot regeneration in Comfy-Org#15813. The gap was only ever on the
stack's own branch, not on main.

## Scope

Restores the three generated files to their state at `d853072426` (the
last pipeline-projected version). Nothing else changes.

The billing capability contract is unaffected: all three fields predate
Comfy-Org#15802, `ENTERPRISE` is present in both `types.gen.ts` and `zod.gen.ts`,
and cloud has had **no** `openapi.yaml` commits since that projection
was taken — so this is current, not a rollback to something stale.

## Verification

- `pnpm typecheck` — clean
- `pnpm typecheck:browser` — clean
- Full unit suite: **17,474 passed**. The 12 `check-binary-size`
failures are pre-existing and environmental — they fail identically
without this change.
@huang47 huang47 added the risk:high PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026 — with ChatGPT Codex Connector
@huang47 huang47 removed the risk:R2 PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high PR risk grade (advisory shadow check; grader-owned) size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants