Skip to content

Support array result include sequence action #150

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

Conversation

ningyougang
Copy link
Contributor

@ningyougang ningyougang commented Jul 26, 2022

Depend on below prs:

@ningyougang
Copy link
Contributor Author

The steps of test support array result for sequence action in swift(4.2, 5.1, 5.3)

  • Write actions
[root@nccddev130026 ~]# cat ~/split.swift 
func main(args: Any) -> Any {
    // don't do real split operation, just return array for next action's input param
    return ["e1", "e2"]
}

[root@nccddev130026 ~]# cat ~/sort.swift 
func main(args: Any) -> Any {
    // don't do real sort operation, just return the array direclty
    return args
}
  • Create actions and invoke it
wsk -i action create /whisk.system/utils/split-swift --kind swift:5.3 ~/split.swift
wsk -i action create /whisk.system/utils/sort-swift --kind swift:5.3 ~/sort.swift
wsk -i action create mySequence-swift --sequence /whisk.system/utils/split-swift,/whisk.system/utils/sort-swift
wsk -i action invoke --result mySequence-swift -r -v

@ningyougang ningyougang force-pushed the support-array-result-include-sequence-action branch from 2b4df84 to 9252363 Compare August 8, 2022 07:53
@@ -33,15 +33,38 @@ The traditional support for the dictionary still works:
```swift
import Foundation

func main(args: [String:Any]) -> [String:Any] {
if let name = args["name"] as? String {
func main(args: Any) -> Any {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to support array result, from the new main signature. we can see, the the input param and outout param should be changed to Any both.


FROM swift:5.1.5

# select the builder to use
ARG GO_PROXY_BUILD_FROM=release
ARG GO_PROXY_BUILD_FROM=source
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change it to release due to apache/openwhisk-runtime-java#140 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already changed to release

Copy link
Member

@dgrove-oss dgrove-oss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dgrove-oss dgrove-oss merged commit 027bb83 into apache:master Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants