feat: Add support for intra resolve compiler mutations#118
Merged
FogDong merged 2 commits intokubevela:mainfrom Mar 2, 2026
Merged
feat: Add support for intra resolve compiler mutations#118FogDong merged 2 commits intokubevela:mainfrom
FogDong merged 2 commits intokubevela:mainfrom
Conversation
64be190 to
0e6f92e
Compare
7029a1a to
4c0dd50
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #118 +/- ##
==========================================
+ Coverage 88.34% 88.35% +0.01%
==========================================
Files 82 82
Lines 3491 3505 +14
==========================================
+ Hits 3084 3097 +13
- Misses 273 274 +1
Partials 134 134
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Brian Kane <briankane1@gmail.com>
4c0dd50 to
295a6bb
Compare
This was referenced May 14, 2025
FogDong
approved these changes
Mar 2, 2026
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.
Description of your changes
Allows functions to be supplied into the CompilerOptions that will execute during the compilation process and allows mutations to be made on the cue value. These mutations run after initial parsing and before provider function resolution.
I have:
How has this code been tested
Compiler unit testing
Special notes for your reviewer
This feature won't do anything on it's own. This is to allow changes in the main Kubevela repo for loading of configuration within Components and Traits, in a similar fashion to the Trait
processingfield.e.g:
For this to work correctly, we need to load the config into the cue.Value{} after parsing but before CueX provider function processing, otherwise the use of a config field in the provider functions
$paramscauses a compilation issue. To solve, the logic for reading the config will be moved from running after compilation in the template.go file, to being passed as a IntraResolveMutation that runs before provider function processing.i.e.
Summary by mrge
Added support for intra resolve mutations in the compiler, allowing custom mutations to run after parsing but before provider function resolution.
WithIntraResolveMutationto let users inject mutation functions during compilation.