Skip to content

Remove output type raw_string

Problem

The raw_string type is confusing and exposes an implementation detail to the step specification. It is not intuitive to understand the difference between raw_string and string, especially given that the result is that both values are treated as a string.

Example

A step's step.yml may define and return a raw_string output:

spec:
  outputs:
    name:
      type: raw_string
---
exec:
  command: [bash, -c, "echo name=Fred Flintstone >${{output_file}}"]

Proposal

Remove raw_string as an output type, leaving only string to represent text. While this requires users to add quotes around the value when writing to the output file, it is simpler as all values written to the output file must be JSON.

The above example would change as follows. Note the " around Fred Flintstone:

spec:
  outputs:
    name:
      type: string
---
exec:
  command: [bash, -c, 'echo name="Fred Flintstone" >${{output_file}}']

The above step should work, at the moment it does not. The default output type should change from raw_string to string.

Reference

This came up during the Steps engineering huddle, see https://docs.google.com/document/d/1YZkHfH9WY4Q1O72rY9fqdjc9fOSszeyh6pQETtHtYHU/edit#bookmark=id.8ytw426nw0g5 (internal).

Edited by Cameron Swords