-
Notifications
You must be signed in to change notification settings - Fork 562
[SDK] Feature: Adds gateway usage source #7641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughA new "gateway" capability and service were introduced across the codebase. The types, service definitions, usage sources, and mock data were updated to include the "gateway" entry, with associated properties such as Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant ServiceUtils
participant Gateway
Client->>ServiceUtils: Request with usage source "gateway"
ServiceUtils->>Gateway: Forward request based on gateway capability/rateLimit
Gateway-->>ServiceUtils: Respond with data/status
ServiceUtils-->>Client: Return gateway response
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7641 +/- ##
=======================================
Coverage 56.46% 56.46%
=======================================
Files 908 908
Lines 58159 58159
Branches 4225 4225
=======================================
Hits 32840 32840
Misses 25211 25211
Partials 108 108
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
packages/service-utils/src/core/usageV2.ts (1)
13-14
: Consider keeping the source list alphabetically sortedPlacing
"gateway"
at the correct lexical position (between"engine-cloud"
and"insight"
) makes future diffs easier to reason about."engine-cloud", // Engine Cloud "insight", + "gateway", "nebula",
packages/service-utils/src/core/services.ts (1)
86-92
: Polish the new service definition
- The description string is less informative than the others.
- If the Gateway will eventually expose distinct verbs (e.g.
"read"
), documenting them now prevents a breaking change later.gateway: { // all actions allowed actions: [], - description: "api.thirdweb.com", + description: "Gateway HTTP API (api.thirdweb.com)", name: "gateway", title: "Gateway", },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/service-utils/src/core/api.ts
(3 hunks)packages/service-utils/src/core/services.ts
(1 hunks)packages/service-utils/src/core/usageV2.ts
(1 hunks)packages/service-utils/src/mocks.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}
Instructions used from:
Sources:
📄 CodeRabbit Inference Engine
- CLAUDE.md
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Surface breaking changes prominently in PR descriptions
packages/service-utils/src/mocks.ts (2)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Applies to **/*.test.{ts,tsx} : Use Mock Service Worker (MSW) for fetch/HTTP call interception in tests
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Applies to **/*.test.{ts,tsx} : Use real function invocations with stub data in tests; avoid brittle mocks
packages/service-utils/src/core/usageV2.ts (2)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.489Z
Learning: Applies to src/wallets/**/*.{ts,tsx} : Unified `Wallet` and `Account` interfaces in wallet architecture
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.489Z
Learning: Applies to src/wallets/**/*.{ts,tsx} : Smart wallets with account abstraction in wallet architecture
packages/service-utils/src/core/api.ts (2)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/api/**/*.{ts,tsx} : Return typed results (`Project[]`, `User[]`, …) – avoid `any`.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.489Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Server Side Data Fetching: Return typed results (`Project[]`, `User[]`) – avoid `any`
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Build Packages
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Unit Tests
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
packages/service-utils/src/mocks.ts (1)
87-90
: Gateway capability mock looks correctThe new mock entry matches the shape declared in
TeamCapabilities
(enabled: boolean
,rateLimit: number
). No issues spotted.packages/service-utils/src/core/api.ts (1)
115-118
: Capability wiring LGTMThe
gateway
capability mirrors the existing pattern for simple features (boolean + rateLimit). ✅
size-limit report 📦
|
20e5107
to
e25a96c
Compare
e25a96c
to
ca2bb3f
Compare
@@ -83,6 +83,13 @@ export const SERVICE_DEFINITIONS = { | |||
name: "storage", | |||
title: "Storage", | |||
}, | |||
gateway: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the dashboard reads this btw, would make sure it does what you want (particularly enabled by default) also api server needs to have this if this is gonna be a proper projectService
we can store dev settings in there in the future
PR-Codex overview
This PR introduces support for a new service named
gateway
across various files in theservice-utils
package, enhancing the existing functionality by defining its structure and properties.Detailed summary
gateway
to theUSAGE_V2_SOURCES
constant inusageV2.ts
.gateway
properties (enabled
andrateLimit
) inmocks.ts
.gateway
configuration inservices.ts
with attributes likeactions
,description
,name
, andtitle
.ProjectService
type inapi.ts
to includegateway
with its properties.Summary by CodeRabbit
New Features
Chores