Vault Automation 773f056792
Backport [VAULT-43364] pipeline: add template generation support into ce/main
* [VAULT-43364] pipeline: add template generation support

Add a new `template` to the `pipeline generate` command tree. It allows
rendering Go text templates with pipeline requests available via context
functions. The new system is now product agnostic and can be used to
generate any template we wish. This will supersede the enos specific
configuration command.

We also add support for multiple cadences when fetching the list of
release versions. Previously it was assumed that we followed a minor
version bump cadence when fetching versions with an n-minus style lower
bound. Now we can specify the major or minor cadence. To support a
migration from one cadence to another you can also specify an prior
cadence and the version at which the transition happened. This allows
the n-3 reverse traversal to drop into the prior cadence if/when
necessary.

**Template Rendering System**
- New `pipeline generate template` command renders Go templates with
  pipeline data access
- Supports stdin/stdout or file-based input/output
- Templates access version data via function calls rather than
  pre-populated context

**Version Cadence Support**
- Added `VersionCadence` type with `minor` and `major` release cadence
  tracking
- Supports cadence transitions (e.g., minor→major) with
  `TransitionVersion` and `PriorCadence` fields
- Calculates version ranges respecting different release cadences

**Template Functions**
- `VersionsNMinus` / `VersionsBounded` - List versions with explicit
  cadence parameter
- `VersionsNMinusTransition` / `VersionsBoundedTransition` - Handle
  cadence transitions
- `ParseVersion`, `CompareVersions`, `FilterVersions` - Version
  utilities
- All functions require cadence to be explicitly specified

**CLI Integration**
- `--version` and `--edition` flags expose current version/edition to
  templates
- Templates reference these via `.Version` and `.Edition` context fields

**Enos Migration**
- Converted `enos-dynamic-config.hcl` to template-based generation
- Uses `VersionsNMinusTransition` to handle Vault's minor→major cadence
  shift at 1.21.5

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-03-25 14:41:11 -04:00
..