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

Update Arg for specs to use interface{} instead of string #192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Member

@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.

2 participants