From 108dc27a32e5e41ad0f58e114706826018e80c16 Mon Sep 17 00:00:00 2001 From: Hugh Neale Date: Fri, 9 May 2025 12:09:33 +0100 Subject: [PATCH 1/3] Allow for http function calls to provide objects Signed-off-by: Hugh Neale --- model/function.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/model/function.go b/model/function.go index 7cf4197..567cb00 100644 --- a/model/function.go +++ b/model/function.go @@ -37,6 +37,8 @@ const ( // FunctionTypeCustom property defines a list of function types that are set by the specification. Some runtime // implementations might support additional function types that extend the ones defined in the specification FunctionTypeCustom FunctionType = "custom" + // FunctionTypeHttp defines a https://datatracker.ietf.org/doc/html/rfc2616#page-36 as the operation input + FunctionTypeHttp FunctionType = "http" ) // FunctionType ... @@ -51,6 +53,7 @@ func (i FunctionType) KindValues() []string { string(FunctionTypeAsyncAPI), string(FunctionTypeOData), string(FunctionTypeCustom), + string(FunctionTypeHttp), } } @@ -58,6 +61,8 @@ func (i FunctionType) String() string { return string(i) } +type FunctionOperation any + // Function ... // +builder-gen:new-call=ApplyDefault type Function struct { @@ -70,8 +75,16 @@ type Function struct { // If type is `expression`, defines the workflow expression. If the type is `custom`, // #. // +kubebuilder:validation:Required - Operation string `json:"operation" validate:"required"` - // Defines the function type. Is either `custom`, `rest`, `rpc`, `expression`, `graphql`, `odata` or `asyncapi`. + // If type is `http`, provide the http requst object. https://datatracker.ietf.org/doc/html/rfc2616#page-36 + // { + // "method": "POST", + // "uri": "https://petstore.swagger.io/v2/pet/", + // "headers": { + // "Content-Type": "application/json" + // } + // } + Operation FunctionOperation `json:"operation" validate:"required"` + // Defines the function type. Is either `custom`, `rest`, `rpc`, `expression`, `graphql`, `odata` or `asyncapi` or `http`. // Default is `rest`. // +kubebuilder:validation:Enum=rest;rpc;expression;graphql;odata;asyncapi;custom // +kubebuilder:default=rest From 8ca212c861cd41649ff1bf53d8056ee92c0079c3 Mon Sep 17 00:00:00 2001 From: Ricardo Zanini Date: Fri, 9 May 2025 09:54:25 -0400 Subject: [PATCH 2/3] Fixing lint recipe Signed-off-by: Ricardo Zanini --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a8f36db..ce0bc4f 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,14 @@ goimports: @goimports -w . lint: - @echo "πŸš€ Running lint..." - @command -v golangci-lint > /dev/null || (echo "πŸš€ Installing golangci-lint..."; curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin") + @echo "πŸš€ Installing/updating golangci-lint…" + GO111MODULE=on go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + + @echo "πŸš€ Running lint…" @make addheaders @make goimports @make fmt - @./hack/go-lint.sh ${params} + @$(GOPATH)/bin/golangci-lint run ./... ${params} @echo "βœ… Linting completed!" .PHONY: test From 0ebd6292c4051d49c9576ce76520e9da301f6e07 Mon Sep 17 00:00:00 2001 From: Ricardo Zanini Date: Fri, 9 May 2025 09:55:34 -0400 Subject: [PATCH 3/3] Remove labeler Signed-off-by: Ricardo Zanini --- .github/labeler.yml | 20 ----------------- .github/workflows/pull_request_labeler.yml | 26 ---------------------- 2 files changed, 46 deletions(-) delete mode 100644 .github/labeler.yml delete mode 100644 .github/workflows/pull_request_labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index 49abd17..0000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2022 The Serverless Workflow Specification Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"documentation :notebook:": - - changed-files: - - any-glob-to-any-file: ['contrib/*', '**/*.md'] -kubernetes: - - changed-files: - - any-glob-to-any-file: ['kubernetes/*', 'hack/builder-gen.sh', 'hack/deepcopy-gen.sh', 'Makefile'] diff --git a/.github/workflows/pull_request_labeler.yml b/.github/workflows/pull_request_labeler.yml deleted file mode 100644 index f270294..0000000 --- a/.github/workflows/pull_request_labeler.yml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2022 The Serverless Workflow Specification Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: "Pull Request Labeler" -on: - - pull_request_target - -jobs: - labeler: - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: actions/labeler@v5 \ No newline at end of file