Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Feature: Update pipelines parser to evaluate input variables #4132

Merged
merged 5 commits into from
Oct 28, 2022

Conversation

briancain
Copy link
Member

This pull request introduces input variables being evaluated inside pipeline {} stanzas. It ends up rearranging how we parse pipelines and steps to support the lazy-decoding that Waypoint does to evaluate and resolve variables later in the parsing process.

It also had to modify how waypoint init does its initial sync of pipeline definitions. Now instead we do a "shallow sync" of the pipeline name, owner, and a base step. This mirrors how we sync applications on waypoint init in that we don't sync the entire parsed hcl config, only the app name on init.

Fixes #4122

This commit updates the pipeline parsing for steps to store step values
in the Step struct rather than the hclStep raw struct. This is intended
to support lazy loading for when Waypoint resolves input variables later
on during config parsing.
Prior to this commit, the init CLI would upsert the full protobuf
structure of a pipeline. This was fine before input variables, but now
given how Waypoint internally lazy-evaluates input variables later, this
approach no logner works.

This commit updates the init cli to instead behave more like how the
init CLI handles syncing Applications: The smallest structure possible
i.e. a name, owner, and a root step. This data gets re-upserted on
configsync and before running a pipeline, so this init simply upserts a
basic structure on initialiation.
@briancain briancain added the pr/no-changelog No automatic changelog entry required for this pull request label Oct 28, 2022
@briancain briancain requested review from a team, catsby and xiaolin-ninja October 28, 2022 21:54
@github-actions github-actions bot added the core label Oct 28, 2022
@briancain
Copy link
Member Author

A note to the reviewer: It doesn't seem like waypoint pipeline run is properly sprinkling in CLI var flag overrides only defined within the app stanzas. I think I'll leave this as a follow-up since I don't think it's directly related to this PR 🤔

@briancain briancain removed the pr/no-changelog No automatic changelog entry required for this pull request label Oct 28, 2022
Copy link
Contributor

@evanphx evanphx left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Are variables not supported in Waypoint Pipelines?
2 participants