Skip to content

Commit 72453ba

Browse files
committed
feat: pass invocation_mode field to deploy
1 parent cbe7c92 commit 72453ba

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

go/porcelain/deploy.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -781,10 +781,11 @@ func bundleFromManifest(ctx context.Context, manifestFile *os.File, observer Dep
781781
})
782782
}
783783

784-
if function.DisplayName != "" || function.Generator != "" {
784+
if function.DisplayName != "" || function.Generator != "" || function.InvocationMode != "" {
785785
functionsConfig[file.Name] = models.FunctionConfig{
786-
DisplayName: function.DisplayName,
787-
Generator: function.Generator,
786+
DisplayName: function.DisplayName,
787+
Generator: function.Generator,
788+
InvocationMode: function.InvocationMode,
788789
}
789790
}
790791

go/porcelain/deploy_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,8 @@ func TestBundleWithManifest(t *testing.T) {
448448
"path": "%s",
449449
"runtime": "some-other-runtime",
450450
"mainFile": "/some/path/hello-py-function-test",
451-
"name": "hello-py-function-test"
451+
"name": "hello-py-function-test",
452+
"invocation_mode": "stream"
452453
}
453454
],
454455
"version": 1
@@ -468,8 +469,9 @@ func TestBundleWithManifest(t *testing.T) {
468469
assert.Equal(t, 2, len(functions.Files))
469470
assert.Equal(t, "a-runtime", functions.Files["hello-js-function-test"].Runtime)
470471
assert.Equal(t, "some-other-runtime", functions.Files["hello-py-function-test"].Runtime)
472+
assert.Equal(t, "stream", functionsConfig["hello-py-function-test"].InvocationMode)
471473

472-
assert.Equal(t, 1, len(functionsConfig))
474+
assert.Equal(t, 2, len(functionsConfig))
473475
assert.Equal(t, "Hello Javascript Function", functionsConfig["hello-js-function-test"].DisplayName)
474476
assert.Equal(t, "@netlify/[email protected]", functionsConfig["hello-js-function-test"].Generator)
475477
}

go/porcelain/functions_manifest.go

+1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ type functionsManifestEntry struct {
1515
Schedule string `json:"schedule"`
1616
DisplayName string `json:"displayName"`
1717
Generator string `json:"generator"`
18+
InvocationMode string `json:"invocation_mode"`
1819
}

0 commit comments

Comments
 (0)