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

Execute bundle from a pre-computed Run #3051

Merged
merged 6 commits into from
Apr 29, 2024

Conversation

kichristensen
Copy link
Contributor

What does this change

This takes Carolyns draft PR #2722, and "merges" it with the main branch, but it also removes some parts from the PR that unrelated to the actual functionality.

From Carolyns draft PR:

Update our CNAB runtime implementation to accept a pre-computed Run, which may have already been persisted in a pending state. We now execute it as defined and have moved more of the logic for how the bundle should be executed out of the runtime. This allows us to generate the runs ahead of time, store them on a workflow, and execute later.

What issue does it fix

Closes #2732

Notes for the reviewer

From Carolyns draft PR:

I have carved out in the runtime where we should do JIT resolution of parameters and credentials. Credentials have always been resolved JIT, but parameters are still being resolved earlier. The rest of the fix will come in a follow-up PR for #2698

I am moving away from using intermediate representations of resolved credentials and parameters in favor of using the existing field on parameter/credential sets that store the resolved value. In a follow-up PR (this was too big to include), I complete the switch over so that we delay resolution as much as possible and avoid excessive type conversions from string to the typed value (e.g. "3" -> 3).

If this PR is accepted a follow up story, as described above, should be created probably be created to remember it.

Checklist

  • Did you write tests?
  • Did you write documentation?
  • Did you change porter.yaml or a storage document record? Update the corresponding schema file.
  • If this is your first pull request, please add your name to the bottom of our Contributors list. Thank you for making Porter better! 🙇‍♀️

Reviewer Checklist

  • Comment with /azp run test-porter-release if a magefile or build script was modified
  • Comment with /azp run porter-integration if it's a non-trivial PR

Signed-off-by: Kim Christensen <kimworking@gmail.com>
@kichristensen kichristensen changed the title "Merge" the changes from Carolyns PR #2722 Execute bundle from a pre-computed Run Mar 31, 2024
typed := run.TypedParameterValues()
require.Equal(t, len(params), len(typed))
require.Equal(t, len(run.Parameters.Parameters), len(typed))
Copy link
Member

Choose a reason for hiding this comment

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

This is a future nit: run.Parameters.Parameters should have a different naming scheme, run.ParametersSets.Parameters or something more to what it really is.

Copy link
Member

@schristoff schristoff left a comment

Choose a reason for hiding this comment

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

I've been kicking this one for awhile to make sure it is "safe".
It looks good.

@schristoff schristoff merged commit 7422f37 into getporter:main Apr 29, 2024
15 checks passed
@kichristensen kichristensen deleted the preComputedRun branch June 10, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Execute a bundle from a pre-computed Run
2 participants