feat: lets block for bundles#2355
Merged
Merged
Conversation
Preview of macos-15/go tests in bf75b08🔍 View Details on Terramate Cloud .
commands/scaffold
commands/ui
config
hcl
preempt
test
|
Preview of ubuntu/go tests in bf75b08🔍 View Details on Terramate Cloud .
commands/scaffold
commands/ui
config
hcl
preempt
test
|
|
5ec41ae to
8f82036
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2e82b33. Configure here.
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 this PR does / why we need it:
This PR adds support for a lets block in bundle definitions. The are evaluated after bundle inputs, but before exports and bundle stacks.
The lets defined expressions are available as
bundle.let.<name>outside of the lets block.Note: The PR also contains some opportunistic fixes in
evalBundleExports.Which issue(s) this PR fixes:
Implements #2299
Does this PR introduce a user-facing change?
Note
Medium Risk
Adds a new evaluation phase for bundle configuration (
lets) that affects how bundle inputs/scaffolding/exports/stacks are computed, so regressions could change bundle rendering and UI behavior. Also refactorspreempt.Runscheduling/drain logic, which is concurrency-sensitive but covered by new deadlock-focused tests.Overview
Bundles now support a
letsblock indefine bundle, merged across files and exposed to expressions asbundle.let.<name>, evaluated after inputs but before exports and bundle stacks.Bundle evaluation is updated to populate
bundle.file.path.*on thebundlenamespace and to callconfig.LoadBundleLets()from core bundle eval as well as the scaffold and UI change flows soletsare available when computing scaffolding name/path and other derived fields.Separately,
preempt.Runis refactored to track in-flight goroutines and drain/resume waiters without deadlocking when a goroutine issues additionalAwaitcalls after receivingErrUnresolvable, with new tests covering these late-await scenarios.Reviewed by Cursor Bugbot for commit bf75b08. Bugbot is set up for automated code reviews on this repo. Configure here.