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

Daisy: Recursively build child workflows in NewFromFile #1693

Merged
merged 4 commits into from
Jul 26, 2021

Conversation

EricEdens
Copy link
Contributor

Although workflow.NewFromFile's documentation says that it recursively reads subworkflows, that feature was never implemented. This PR ensures that sub workflows and included workflows are read when workflow.NewFromFile is called.

To avoid double reading child workflow files, it also adds a guard in the respective populate methods.

daisy/workflow.go Outdated Show resolved Hide resolved
@EricEdens EricEdens requested a review from dntczdx July 14, 2021 22:26
@EricEdens
Copy link
Contributor Author

Pausing review for a bit; while running some tests, OVF import is failing with error populating workflow: Unresolved var "${imported_disk}" found in "${imported_disk}".

@EricEdens
Copy link
Contributor Author

Re-opening: Fixed the "Unresolved var" error, added unit test to verify it, and ran additional e2e tests locally.

daisy/common.go Outdated Show resolved Hide resolved
daisy/common.go Show resolved Hide resolved
daisy/step_includeworkflow.go Show resolved Hide resolved
@EricEdens EricEdens requested a review from dntczdx July 22, 2021 00:21
@google-oss-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dntczdx, EricEdens, zoran15

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [EricEdens,dntczdx,zoran15]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@EricEdens EricEdens merged commit e532542 into GoogleCloudPlatform:master Jul 26, 2021
EricEdens added a commit to EricEdens/compute-image-tools that referenced this pull request Jul 26, 2021
EricEdens added a commit to EricEdens/compute-image-tools that referenced this pull request Jul 27, 2021
EricEdens added a commit that referenced this pull request Jul 27, 2021
…sn't have variable. (#1701)

This adds support for recursively reading child workflows. The feature was first added in #1693, but rolled back in #1700 due to a bug that it introduced.

The issue: Variable instantiate occurs during populate, and callers expect that behavior. Callers also expect to define child workflow names using variables. Those are in conflict if we want to read child workflows before populate.

To address this, I added a fix in eacb97a where child workflows are eagerly read only when they're fully specified. If the filename contains a variable, then the legacy behavior of reading the workflow during the step's populate is retained.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants