0.37.0 release#139
Merged
Merged
Conversation
`{{ ... }}` templates inside an extension's `source` block (e.g.
`sparse_checkout`, `url`, `ref`) were being passed verbatim to git,
producing empty checkouts when users wrote things like:
avocado-bsp-{{ avocado.target }}:
source:
type: git
url: ...
sparse_checkout:
- bsp/{{ avocado.target }}
Only the extension *name* key was interpolated (via the narrow
`interpolate_name` helper, which handles only `{{ avocado.target }}`).
The source body was deserialized straight from raw YAML into
`ExtensionSource`, so any template inside a string field landed in the
struct unresolved.
Fix the architecture rather than the symptom: every config entry point
now runs the full interpolator (`parse_config_value_with_interpolation`)
immediately after parsing, before any code reads field values.
Downstream consumers (`discover_remote_extensions_from_value`,
`parse_extension_source`, `find_extension_in_dependency_tree`, the
build.rs walkers) treat their input as already-resolved. As a side
effect, `{{ env.* }}`, `{{ config.* }}`, and `{{ avocado.distro.* }}`
now work in any source field — not just `{{ avocado.target }}`.
`load_composed` interpolates `main_config` before merging external
extension configs (so source URLs and sparse paths resolve before
fetch) and again after merging (so templates introduced by merged-in
configs also resolve). Drop the now-redundant `target` parameter from
`discover_remote_extensions_from_value` and from
`find_extensions_for_runtime`. Document the new contract on
`parse_extension_source`.
Add a regression test asserting `{{ avocado.target }}` and
`{{ avocado.distro.channel }}` resolve in `Git.url`, `Git.ref`, and
`Git.sparse_checkout[]`.
Sibling concept to `avocado.target` for the physical board variant within
a target. Sourced (in precedence order) from the env var
`AVOCADO_TARGET_BOARD` then the top-level config field
`default_target_board`. When neither is set, falls back to the resolved
`avocado.target` value, so `{{ avocado.target.board }}` is always
meaningful even for users who don't care about board variants.
- Add `default_target_board: Option<String>` to `Config`.
- Add `target_board` field to `AvocadoContext`, populated by
`from_main_config` from env/config (no CLI flag).
- Add `["target", "board"]` arm to `avocado::resolve`, with a fallback
to `resolve_target` so the default-to-target semantics live in one
place.
- Update `with_values` signature to thread `target_board`. Doc tests
and existing struct-literal tests updated for the new field.
- Unit tests for each precedence rung (context, env, config, target
fallback, env-target fallback, default_target fallback, unavailable)
and integration tests in tests/interpolation.rs.
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.
Summary
Release 0.37.0. Brings forward
rek/0.36.3fixf1f4e7e(interpolate full config tree before reading extension sources), adds{{ avocado.target.board }}interpolation, and stacks on the new features merged tomainsince0.36.2.Changes since 0.36.2
{{ avocado.target.board }}interpolation — sibling to{{ avocado.target }}for the board variant within a target. Sourced from envAVOCADO_TARGET_BOARDthen configdefault_target_board; falls back to the resolved target when neither is set.rek/0.36.3) —{{ ... }}templates inside extensionsourceblocks (url,ref,sparse_checkout) now resolve. Every config entry point runs the full interpolator immediately after parsing; downstream consumers treat input as already-resolved.{{ env.* }},{{ config.* }},{{ avocado.distro.* }}now work in any source field.stone_include_pathsfrom runtime + extensionsTest plan
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo build --verbosecargo test --verbose(all tests pass; 905 lib + integrations + 6 doc tests, including new target-board unit/integration tests)cargo audit