-
Notifications
You must be signed in to change notification settings - Fork 442
feat: use site caps for AIG gating, add support to dev-exec and serve #7904
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
base: main
Are you sure you want to change the base?
Conversation
e44f9f5 to
71dd033
Compare
ndhoule
left a comment
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.
LGTM!
| capabilities?: Record<string, unknown> & { | ||
| ai_gateway_disabled?: boolean | ||
| } |
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.
Assuming the linter doesn't whine:
| capabilities?: Record<string, unknown> & { | |
| ai_gateway_disabled?: boolean | |
| } | |
| capabilities?: { | |
| ai_gateway_disabled?: boolean | |
| [key: string]: unknown; | |
| } |
| } | ||
| } | ||
| } else if (capabilities.aiGatewayDisabled) { | ||
| log(`${NETLIFYDEVLOG} AI Gateway is disabled for this account`) |
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.
Should we skip this log line if we're in offline mode?
| await setupAIGateway({ api, env, siteID: site.id, siteURL: siteUrl }) | ||
|
|
||
| // Parse AI Gateway context and inject provider API keys | ||
| // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- AI_GATEWAY is conditionally set by setupAIGateway |
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 haven't looked at the type on env, but based on this lint error, I would think the type is incorrect? Assuming I'm right about that: Is it possible to mark env.AI_GATEWAY as optional, or is that too much work?
|
Just a few minor nits and suggestions |
serhalp
left a comment
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.
no cap
🎉 Thanks for submitting a pull request! 🎉
Summary
All of the following commands properly check the ai gateway disabled flag as part of the site capabilities. Support for injecting aig env vars is also newly added for the latter two:
netlify devnetlify functions:servenetlify servenetlify dev:execFor us to review and ship your PR efficiently, please perform the following steps:
passes our tests.
A picture of a cute animal (not mandatory, but encouraged)