fix(schema-compiler): invalidate Jinja render cache when imported macro file changes#10818
Conversation
…orted macro file changes
|
Claude finished @igorlukanin's task in 2m 20s —— View job Code Review:
|
| const cacheKey = crypto.createHash('md5') | ||
| .update(file.content) | ||
| .update('|') | ||
| .update(options.jinjaMacrosFingerprint || '') |
There was a problem hiding this comment.
Nit: The | separator works fine here since the fingerprint is always hex or empty. For consistency with computeJinjaMacrosFingerprint (which uses \0 separators), you could use \0 here too — but this is purely stylistic and doesn't affect correctness.
| const cacheKey = crypto.createHash('md5') | |
| .update(file.content) | |
| .update('|') | |
| .update(options.jinjaMacrosFingerprint || '') | |
| const cacheKey = crypto.createHash('md5') | |
| .update(file.content) | |
| .update('\0') | |
| .update(options.jinjaMacrosFingerprint || '') | |
| .digest('hex'); |
| this.loadJinjaTemplates(jinjaTemplatedFiles); | ||
| } | ||
|
|
||
| const jinjaMacrosFingerprint = DataSchemaCompiler.computeJinjaMacrosFingerprint(jinjaTemplatedFiles); |
There was a problem hiding this comment.
Good placement — this runs once per compile cycle (after templates are loaded into minijinja's store) and the result is shared across all file transpilations in the phase. The cost is proportional to macro-file count, which is typically very small.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10818 +/- ##
===========================================
- Coverage 78.79% 58.24% -20.56%
===========================================
Files 470 216 -254
Lines 92135 16914 -75221
Branches 3424 3428 +4
===========================================
- Hits 72597 9851 -62746
+ Misses 19035 6561 -12474
+ Partials 503 502 -1
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:
|
Summary
Test plan