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

Add back preferred runtime env with option #36

Merged
merged 5 commits into from
Apr 26, 2024

Conversation

patrobinson
Copy link
Contributor

In #35 we reverted a breaking change to the way we interpolate environment variables.
This PR adds a flag to optionally enable the functionality that was introduced in v0.4.0.

Instead of adding back the tests I undid in #35 I opted to add new tests in parser_test.go, which is where this functionality exists, interpolate just does the interpolation, pipeline.go decides the precedence of variables.

This helper reduces the boiler plate needed and allows us to add unexported variables to Pipeline struct without much fuss
This preserves the v0.4.0->v0.7.0 behaviour which was reverted in v0.8.0
Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

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

Storing preferRuntimeEnv inside Pipeline in order to maybe use it later on doesn't make a lot of sense to me. I think it makes more sense as an arg on the Interpolate method.

As long as the module is still v0.something and we are the overwhelming majority of users of it, I wouldn't worry about breaking API compatibility.

Prefer a simpler, breaking change, over an unnecessary backwards compatibility change
Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

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

LGTM

pipeline.go Outdated Show resolved Hide resolved
Co-authored-by: Josh Deprez <jd@buildkite.com>
@patrobinson patrobinson force-pushed the add-back-prefered-runtime-env-with-option branch from bc55088 to e678690 Compare April 26, 2024 01:08
@patrobinson patrobinson merged commit 9839142 into main Apr 26, 2024
1 check passed
@patrobinson patrobinson deleted the add-back-prefered-runtime-env-with-option branch April 26, 2024 01:19
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