Skip to content

Conversation

@Areson
Copy link
Contributor

@Areson Areson commented Aug 9, 2023

Currently the Arg struct for spec arguments parses argument values in the spec as string types. This causes some pain for jobs that are running using values directly from the spec as they cannot be defined using more meaningful types (e.g. int or bool) and instead must expect values to be strings. Changing this to use interface{} allows values to be parsed by the yaml parser into primitives based on the content of the yaml file rather than forcing everything to be strings.

Currently the `Arg` struct for spec arguments parses argument values in the spec as `string` types. This causes some pain for jobs that are running using values directly from the spec as they cannot be defined using more meaningful types (e.g. `int` or `bool`) and instead must expect values to be strings. Changing this to use `interface{}` allows values to be parsed by the yaml parser into primitives based on the content of the yaml file rather than forcing everything to be strings.
Copy link
Contributor

@daniel-nichter daniel-nichter left a comment

Choose a reason for hiding this comment

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

Talked with @Areson and this should be ok in Spin Cycle itself since the Job method is already Create(jobArgs map[string]interface{}). However, it could be a breaking change in users' jobs if a job presumes string types. Now jobs need to "dereference" the interface{} to its real underlying type. So I suggest a new minor version for this change.

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.

3 participants