Skip to content

feat: add inline hooks quota support#9078

Merged
wangsijie merged 9 commits into
masterfrom
wangsijie-log-13690-add-inlinehooksenabled-subscription-quota-flag
Jun 25, 2026
Merged

feat: add inline hooks quota support#9078
wangsijie merged 9 commits into
masterfrom
wangsijie-log-13690-add-inlinehooksenabled-subscription-quota-flag

Conversation

@wangsijie

@wangsijie wangsijie commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Completes Logto-side support for the inlineHooksEnabled subscription quota key.

This PR keeps inlineHooksEnabled on the boolean feature-quota path: Core and Console treat older Cloud responses as false when the key is absent, Console includes the key in subscription usage/quota types, and the default Console development SKU keeps inline hooks disabled. The rollout plan is still selected-enterprise-only: only selected enterprise SKUs should be manually enabled, and everyone else stays disabled.

The SKU quota item is intentionally hidden from the Console plan quota UI for now, with an inline comment noting that it should wait until further testing before being opened.

It is intentionally not added to add-on/reportable usage reporting.

Cloud companion PR: logto-io/cloud#1956.

Testing

Tested locally


Note

Medium Risk
Touches subscription typing and quota normalization used for entitlements; behavior stays opt-in (default false) but incorrect defaults could affect feature gating when Cloud enables the flag.

Overview
Adds inlineHooksEnabled as a boolean subscription quota across Console and Core, aligned with an updated @logto/cloud package.

Core extends subscription quota/usage types and tenant-usage guards, defaults missing Cloud values to false in getTenantSubscription, and includes the flag in the Redis subscription cache schema. It is not added to reportable item-updates usage keys.

Console merges API quota/usage with defaults via normalizeSubscriptionQuota / normalizeSubscriptionUsage, sets inlineHooksEnabled: false on default SKUs, and keeps the quota out of plan UI (hidden downgrade diff, excluded phrase maps, filtered in upgrade/downgrade modals) until further testing.

Also bumps default dev SKU fields for samlApplicationsLimit and customDomainsLimit in tenant constants.

Reviewed by Cursor Bugbot for commit 6e5e585. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added the feature Cool stuff label Jun 23, 2026
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

COMPARE TO master

Total Size Diff 📈 +1.82 KB

Diff by File
Name Diff
packages/console/package.json 0 Bytes
packages/console/src/cloud/types/router.ts 📈 +290 Bytes
packages/console/src/consts/plan-quotas.ts 📈 +126 Bytes
packages/console/src/consts/quota-item-phrases.ts 📈 +222 Bytes
packages/console/src/consts/tenants.ts 📈 +146 Bytes
packages/console/src/contexts/SubscriptionDataProvider/use-subscription-data.ts 📈 +674 Bytes
packages/console/src/pages/TenantSettings/Subscription/DowngradeConfirmModalContent/PlanQuotaDiffCard/PlanQuotaList/DiffQuotaItem/SkuQuotaItemPhrase.tsx 📈 +96 Bytes
packages/console/src/pages/TenantSettings/components/NotEligibleSwitchPlanModalContent/index.tsx 📈 +101 Bytes
packages/console/src/types/skus.ts 📈 +5 Bytes
packages/core/package.json 0 Bytes
packages/core/src/mocks/cloud-connection.ts 📈 +29 Bytes
packages/core/src/queries/tenant-usage/types.ts 📈 +48 Bytes
packages/core/src/utils/subscription/index.ts 📈 +242 Bytes
packages/core/src/utils/subscription/types.ts 📈 +110 Bytes
pnpm-lock.yaml 📈 +217 Bytes

@wangsijie wangsijie force-pushed the wangsijie-log-13689-define-logtoinlinehookkey-enum-and-zod-config-guards branch from 6881986 to 0ea9051 Compare June 23, 2026 13:56
@wangsijie wangsijie force-pushed the wangsijie-log-13690-add-inlinehooksenabled-subscription-quota-flag branch from 045b209 to 00e09a2 Compare June 23, 2026 13:56
@github-actions github-actions Bot added size/s and removed size/s labels Jun 23, 2026
@wangsijie wangsijie changed the title feat(core): add LOG-13690 inline hooks quota flag feat(core): add inline hooks quota flag Jun 23, 2026
@github-actions github-actions Bot added size/s and removed size/s labels Jun 23, 2026
@github-actions github-actions Bot added size/l and removed size/s labels Jun 24, 2026
@wangsijie wangsijie changed the title feat(core): add inline hooks quota flag feat: add inline hooks quota support Jun 24, 2026
@github-actions github-actions Bot added size/l and removed size/l labels Jun 24, 2026
@github-actions github-actions Bot added size/l and removed size/l labels Jun 24, 2026
@github-actions github-actions Bot added size/m and removed size/l labels Jun 24, 2026
@github-actions github-actions Bot removed the size/m label Jun 24, 2026
@wangsijie wangsijie marked this pull request as ready for review June 24, 2026 06:41

@charIeszhao charIeszhao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the quota plumbing. No standalone blockers from my side; runtime enforcement is tracked in the runner PR.

@simeng-li simeng-li 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.

core changes LGTM

Base automatically changed from wangsijie-log-13689-define-logtoinlinehookkey-enum-and-zod-config-guards to master June 25, 2026 06:34
@github-actions github-actions Bot added size/m and removed size/s labels Jun 25, 2026
…add-inlinehooksenabled-subscription-quota-flag

# Conflicts:
#	packages/schemas/src/types/logto-config/inline-hook.ts
Copilot AI review requested due to automatic review settings June 25, 2026 06:42
@github-actions github-actions Bot added size/m and removed size/m labels Jun 25, 2026

Copilot AI 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.

Pull request overview

Completes Logto Core + Console support for the Cloud subscription quota key inlineHooksEnabled, ensuring older Cloud payloads (missing the key) are treated as disabled by default and keeping the capability hidden from plan quota UI for now.

Changes:

  • Extend Core/Console subscription quota + usage types to include inlineHooksEnabled.
  • Normalize Core/Console subscription data to default inlineHooksEnabled to false when absent.
  • Hide inlineHooksEnabled from quota UI phrasing/diff rendering while still being represented in types and defaults.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pnpm-lock.yaml Updates lockfile entries for the bumped Cloud package version.
packages/core/src/utils/subscription/types.ts Adds inlineHooksEnabled to Core subscription quota/usage types and zod guards.
packages/core/src/utils/subscription/index.ts Normalizes fetched subscription quota to default inlineHooksEnabled: false.
packages/core/src/queries/tenant-usage/types.ts Adds inlineHooksEnabled to Core quota usage key enums (boolean quota path).
packages/core/src/mocks/cloud-connection.ts Extends mocked quota to include inlineHooksEnabled.
packages/core/package.json Bumps @logto/cloud dependency revision.
packages/console/src/types/skus.ts Adjusts comment formatting for SKU type definitions.
packages/console/src/pages/TenantSettings/Subscription/DowngradeConfirmModalContent/PlanQuotaDiffCard/PlanQuotaList/DiffQuotaItem/SkuQuotaItemPhrase.tsx Guards phrase rendering to skip hidden/non-phrase quota keys (incl. inline hooks).
packages/console/src/pages/TenantSettings/components/NotEligibleSwitchPlanModalContent/index.tsx Excludes inlineHooksEnabled from “not eligible” quota rendering and adds phrase-key guarding.
packages/console/src/contexts/SubscriptionDataProvider/use-subscription-data.ts Normalizes subscription quota/usage objects by merging defaults (covers missing inlineHooksEnabled).
packages/console/src/consts/tenants.ts Adds inlineHooksEnabled (and required quota fields) to default SKU/quota/usage constants.
packages/console/src/consts/quota-item-phrases.ts Excludes inlineHooksEnabled from quota phrase maps and adds a type guard helper.
packages/console/src/consts/plan-quotas.ts Hides inlineHooksEnabled in plan quota UI diff list with an explanatory comment.
packages/console/src/cloud/types/router.ts Extends subscription quota/usage types with inlineHooksEnabled and relaxes SKU quota typing for backward compatibility.
packages/console/package.json Bumps @logto/cloud dependency revision.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/utils/subscription/types.ts Outdated
Comment thread packages/core/src/utils/subscription/types.ts Outdated
Comment thread packages/console/src/cloud/types/router.ts Outdated
Comment thread packages/console/src/cloud/types/router.ts Outdated
@github-actions github-actions Bot added size/m and removed size/m labels Jun 25, 2026
@wangsijie wangsijie merged commit 9ff119f into master Jun 25, 2026
38 of 39 checks passed
@wangsijie wangsijie deleted the wangsijie-log-13690-add-inlinehooksenabled-subscription-quota-flag branch June 25, 2026 07:24
wangsijie added a commit that referenced this pull request Jun 25, 2026
Merge origin/master to resolve conflicts in subscription quota types and
inline hook schema. Accept master's versions for files already merged via
#9077 and #9078.

Add DeletionError test case for deleteInlineHook when rowCount is 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants