Closed mikemccracken closed 8 months ago
Note that there are two commits. The first commit removes support for the other sub styles, but just warns when they are found to be shadowed. The second commit upgrades them to errors, which I think is the right way to go, but am open to discussion.
^ breaking test.
Attention: Patch coverage is 93.47826%
with 3 lines
in your changes are missing coverage. Please review.
Project coverage is 57.38%. Comparing base (
da5e3c8
) to head (0b8f4cc
). Report is 2 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
pkg/types/stackerfile.go | 93.47% | 2 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I noticed that I hadn't limited the test changes to the last commit, so I just reworked the last two. The test changes should work even without the other commits, so we could even consider putting them first, if we want every commit to be able to pass CI on its own
Did you want to squash these (to combine the commit msgs yourself), or just squash-and-merge?
What type of PR is this?
This is a breaking change to the substitution syntax, which was bad and should be made good.
What does this PR do / Why do we need it:
This makes it an error to have placeholders that are valid shell like
$PATH
or${PATH}
if you have provided a substitution forPATH
to stacker via--substitute PATH=why:oh:why
.Those placeholders are too easy to confuse with a valid shell variable, and stacker can't tell if you intended to provide a value for them but typoed it - and you can't tell by looking at it if it is intended to be a stacker sub or just a shell var.
So they are bad and should be made good by becoming fatal errors.
The documented behavior in docs was not tested fully, and was in fact wrong. Now it's right.
This change is confined to one function that has go unit tests, so I just updated those and the one place where our tests were using
$PLAIN
syntax.Will this break upgrades or downgrades?
Possibly. If people were doing confusing things like
--substitute PATH=ouch
, then their builds will fail with a helpful message about how to fix it.Does this PR introduce any user-facing change?:
An example of the new error output is:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.