Skip to content
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

Engine crashes when a bare string value is passed as a default in a workflow #87

Open
dustinblack opened this issue May 26, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@dustinblack
Copy link
Member

Describe the bug

When setting a default string value for a workflow input parameter, if a bare string is used, the engine will panic.

To reproduce

The supported syntax for a default string value is:

    default: '"foo"'

If instead this is used:

    default: foo

The engine will panic

panic: Default value for property kubeburner_churn is not a valid JSON (invalid character 'h' looking for beginning of value)                                                                    
                                                                                                                                                                                                                                              
goroutine 1 [running]:                                                                                                                                                                                                                        
go.flow.arcalot.io/pluginsdk/schema.extractObjectDefaultValues(0x15d9dc0?)
        /home/runner/go/pkg/mod/go.flow.arcalot.io/[email protected]/schema/object.go:601 +0x205                                                                                                                                               
go.flow.arcalot.io/pluginsdk/schema.(*ObjectSchema).GetDefaults(...)                           
        /home/runner/go/pkg/mod/go.flow.arcalot.io/[email protected]/schema/object.go:54                      
go.flow.arcalot.io/pluginsdk/schema.(*ObjectSchema).convertData(0xc0003efd60, {0x15d68e0?, 0xc0003f3c50?, 0x17f0aa8?})
        /home/runner/go/pkg/mod/go.flow.arcalot.io/[email protected]/schema/object.go:375 +0x14d
go.flow.arcalot.io/pluginsdk/schema.(*ObjectSchema).Unserialize(0xc0003efd60, {0x15d68e0?, 0xc0003f3c50?})
        /home/runner/go/pkg/mod/go.flow.arcalot.io/[email protected]/schema/object.go:84 +0x14a     
go.flow.arcalot.io/pluginsdk/schema.(*ScopeSchema).Unserialize(...)                                 
        /home/runner/go/pkg/mod/go.flow.arcalot.io/[email protected]/schema/scope.go:67
go.flow.arcalot.io/engine.workflowEngine.RunWorkflow({{0x1a8d458, 0xc0002e7bf0}, {0x1a81100, 0xc0002fe358}, 0xc0005249a0}, {0x1a8c458?, 0xc0004ba4c0}, {0xc00060e000, 0xcf5c, 0xcf5d}, ...)
        /home/runner/go/pkg/mod/go.flow.arcalot.io/[email protected]/engine.go:69 +0x187                                 
main.main()                                                                                                                                                                                                                                   
        /home/runner/go/pkg/mod/go.flow.arcalot.io/[email protected]/cmd/arcaflow/main.go:124 +0xa37

Additional context

It would be best if the fix for this included an enhancement to allow standard valid yaml values to be passed to the default key -- i.e., a bare string should be valid and should work.

@dustinblack dustinblack added the bug Something isn't working label May 26, 2023
@jdowni000 jdowni000 self-assigned this Aug 28, 2023
@jdowni000
Copy link
Contributor

jdowni000 commented Aug 29, 2023

I have tested locally and pushed to a new branch here. I still need to create some unit tests though for the code, but a lot of progress has been made

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: No status
Development

No branches or pull requests

2 participants