rackspace/runway

String "<inferred-change: ...>" causes yaml mapping values error

krschwab opened this issue · 0 comments

Bug Description

During a dev-plan step, runway produced this error:

[runway] waf-xyz-public-ip-set:complete
100[runway] mapping values are not allowed here
101 in "<unicode string>", line 105, column 40:
102   ...      Arn: <inferred-change: dev0-waf-xyz-public-ip-set.oSw... 
103                                 ^          

It's difficult for me to pin down where exactly in runway this is happening, since it's parsing something from a unicode string. However, the fix seems fairly easy.

What appears to be happening is that runway is putting a string with a colon in it into a dict, that later ends up in a yaml file (or string?) in the yaml unquoted style, like:

Arn: <inferred-change: dev0-waf-xyz-public-ip...>

The PyYAML module won't parse that since the value side of the key:value pair has a colon in it. It raises that "mapping values not allowed here" exception. It would expect the value to be single or double quoted.

The string "inferred-change:" only shows up in two places in runway:
image

So, an easy fix would be to just use some character other than a colon in those two places. Perhaps a dash character or comma?

Expected Behavior

No "mapping values are not allowed here" error in a runway plan step.

Steps To Reproduce

Unfortunately, I can't provide steps to reproduce it, as I'm only an indirect user of runway...it runs in my company's CI/CD pipeline on my behalf. You can reproduce the generic yaml error with:

#!/usr/bin/env python
import yaml
yaml.safe_load("""
Arn: <inferred-change: dev0-waf-xyz-public-ip>
Test: me
""")

Runway version

2.14.0

Installation Type

npm (npm, yarn, etc)

OS / Environment

  • OS: AmazonLinux 2
  • Python version: 3.8

Anything else?

No response