feat: add persistent parameter shorthand#3574
Draft
kichristensen wants to merge 5 commits intogetporter:mainfrom
Draft
feat: add persistent parameter shorthand#3574kichristensen wants to merge 5 commits intogetporter:mainfrom
kichristensen wants to merge 5 commits intogetporter:mainfrom
Conversation
Add `persistent: true` on a parameter as shorthand for wiring up a matching output so the value is remembered across bundle executions (install → upgrade/uninstall). Requires schema version 1.2.0 and the `persistent-parameters` experimental feature flag. At validation time, a persistent parameter expands to: - path: /cnab/app/<name> - source.output: <name> - applyTo: [install, upgrade, uninstall, ...] - auto-generated matching output definition Closes getporter#1889 Signed-off-by: Kim Christensen <kimworking@gmail.com>
Add 1.2.0 manifest file format changelog, update version table in _index.md, and expand persisting-data guide with Approach 3 (Persistent Parameters, experimental) listed last. Signed-off-by: Kim Christensen <kimworking@gmail.com>
Enable FlagPersistentParameters before loading the manifest in Run(), so that expandPersistentParameters() succeeds inside the bundle container without requiring the flag in the container's config. Mirrors the existing SchemaCheck=none pattern. Update golden schema files to include the persistent property in the parameter definition. Signed-off-by: Kim Christensen <kimworking@gmail.com>
Signed-off-by: Kim Christensen <kimworking@gmail.com>
Signed-off-by: Kim Christensen <kimworking@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change
Adds a
persistent: trueshorthand on parameter definitions so a value provided at install is automatically remembered for subsequent upgrade and uninstall runs — without manually wiring outputs and parameter sources.Enable the feature:
export PORTER_EXPERIMENTAL=persistent-parametersAt manifest validation time,
persistent: trueexpands into:/cnab/app/<name>source.output: <name>applyTolist covering all declared actions (including install)No changes to the CNAB adapter are required — after expansion the param is identical to the longhand.
What issue does it fix
Closes #1889
Notes for the reviewer
1.2.0is required; gated behind thepersistent-parametersexperimental feature flag (same pattern as DepsV2 /1.1.0)persistent: truehard-errors when combined withsource,path/env, orapplyToapplyTois set explicitly (includinginstall) to preventexemptFromInstall()from silently dropping install from the listChecklist