Skip to content

Commit b2efa75

Browse files
authored
Merge pull request #426 from netlify/feat-415/pass-generator-with-functionconfig
feat: pass along generator to functionconfig
2 parents 04c6ead + ef22e6b commit b2efa75

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

go/models/function_config.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/porcelain/deploy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,9 +755,10 @@ func bundleFromManifest(ctx context.Context, manifestFile *os.File, observer Dep
755755
})
756756
}
757757

758-
if function.DisplayName != "" {
758+
if function.DisplayName != "" || function.Generator != "" {
759759
functionsConfig[file.Name] = models.FunctionConfig{
760760
DisplayName: function.DisplayName,
761+
Generator: function.Generator,
761762
}
762763
}
763764

go/porcelain/deploy_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ func TestBundleWithManifest(t *testing.T) {
346346
"runtime": "a-runtime",
347347
"mainFile": "/some/path/hello-js-function-test.js",
348348
"displayName": "Hello Javascript Function",
349+
"generator": "@netlify/[email protected]",
349350
"name": "hello-js-function-test",
350351
"schedule": "* * * * *"
351352
},
@@ -376,6 +377,7 @@ func TestBundleWithManifest(t *testing.T) {
376377

377378
assert.Equal(t, 1, len(functionsConfig))
378379
assert.Equal(t, "Hello Javascript Function", functionsConfig["hello-js-function-test"].DisplayName)
380+
assert.Equal(t, "@netlify/[email protected]", functionsConfig["hello-js-function-test"].Generator)
379381
}
380382

381383
func TestReadZipRuntime(t *testing.T) {

go/porcelain/functions_manifest.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ type functionsManifest struct {
77
}
88

99
type functionsManifestEntry struct {
10-
MainFile string `json:"mainFile"`
11-
Name string `json:"name"`
12-
Path string `json:"path"`
13-
Runtime string `json:"runtime"`
14-
Schedule string `json:"schedule"`
10+
MainFile string `json:"mainFile"`
11+
Name string `json:"name"`
12+
Path string `json:"path"`
13+
Runtime string `json:"runtime"`
14+
Schedule string `json:"schedule"`
1515
DisplayName string `json:"displayName"`
16+
Generator string `json:"generator"`
1617
}

swagger.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3576,6 +3576,8 @@ definitions:
35763576
properties:
35773577
display_name:
35783578
type: string
3579+
generator:
3580+
type: string
35793581
parameters:
35803582
page:
35813583
type: integer

0 commit comments

Comments
 (0)