Skip to content
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

Prod deploy #2853

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions api/beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,8 @@ paths:
type: array
items:
$ref: '#/components/schemas/V1ServiceHealthResponse'
'403':
description: ''
'500':
description: Failed to retrieve project's service health status
tags:
Expand Down Expand Up @@ -3063,16 +3065,20 @@ components:
ApiKeyResponse:
type: object
properties:
type:
nullable: true
type: string
enum:
- publishable
- secret
- legacy
name:
type: string
api_key:
type: string
id:
type: string
nullable: true
type:
nullable: true
type: object
prefix:
type: string
nullable: true
Expand Down Expand Up @@ -3786,6 +3792,8 @@ components:
type: string
statement_timeout:
type: string
track_commit_timestamp:
type: boolean
wal_keep_size:
type: string
wal_sender_timeout:
Expand Down Expand Up @@ -3847,6 +3855,8 @@ components:
type: string
statement_timeout:
type: string
track_commit_timestamp:
type: boolean
wal_keep_size:
type: string
wal_sender_timeout:
Expand Down
15 changes: 12 additions & 3 deletions internal/functions/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,22 @@ func GetFunctionConfig(slugs []string, importMapPath string, noVerifyJWT *bool,
for _, name := range slugs {
function := utils.Config.Functions[name]
// Precedence order: flag > config > fallback
functionDir := filepath.Join(utils.FunctionsDir, name)
if len(function.Entrypoint) == 0 {
function.Entrypoint = filepath.Join(utils.FunctionsDir, name, "index.ts")
function.Entrypoint = filepath.Join(functionDir, "index.ts")
}
if len(importMapPath) > 0 {
function.ImportMap = importMapPath
} else if len(function.ImportMap) == 0 && fallbackExists {
function.ImportMap = utils.FallbackImportMapPath
} else if len(function.ImportMap) == 0 {
denoJsonPath := filepath.Join(functionDir, "deno.json")
denoJsoncPath := filepath.Join(functionDir, "deno.jsonc")
if _, err := fsys.Stat(denoJsonPath); err == nil {
function.ImportMap = denoJsonPath
} else if _, err := fsys.Stat(denoJsoncPath); err == nil {
function.ImportMap = denoJsoncPath
} else if fallbackExists {
function.ImportMap = utils.FallbackImportMapPath
}
}
if noVerifyJWT != nil {
function.VerifyJWT = cast.Ptr(!*noVerifyJWT)
Expand Down
18 changes: 15 additions & 3 deletions pkg/api/types.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.