Skip to content

Commit

Permalink
feat: add priority field to functions config (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoboucas authored Jan 31, 2024
1 parent f0713b5 commit bfc8fb2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions go/models/function_config.go

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

4 changes: 3 additions & 1 deletion go/porcelain/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,12 +822,14 @@ func bundleFromManifest(ctx context.Context, manifestFile *os.File, observer Dep
}
}

if function.DisplayName != "" || function.Generator != "" || len(routes) > 0 || len(function.BuildData) > 0 {
hasConfig := function.DisplayName != "" || function.Generator != "" || len(routes) > 0 || len(function.BuildData) > 0 || function.Priority != 0
if hasConfig {
functionsConfig[file.Name] = models.FunctionConfig{
DisplayName: function.DisplayName,
Generator: function.Generator,
Routes: routes,
BuildData: function.BuildData,
Priority: int64(function.Priority),
}
}

Expand Down
1 change: 1 addition & 0 deletions go/porcelain/functions_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type functionsManifestEntry struct {
BuildData map[string]interface{} `json:"buildData"`
InvocationMode string `json:"invocationMode"`
Routes []functionRoute `json:"routes"`
Priority int `json:"priority"`
}

type functionRoute struct {
Expand Down
2 changes: 2 additions & 0 deletions swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3714,6 +3714,8 @@ definitions:
type: array
items:
$ref: '#/definitions/functionRoute'
priority:
type: integer
functionRoute:
type: object
properties:
Expand Down

0 comments on commit bfc8fb2

Please sign in to comment.