Repository navigation
Commit 3514686
authored
feat(codegen): skip generation when the model and generators are unchanged (ADR-0064) (#590)
* feat(codegen): skip gen when nothing changed, in every port (ADR-0064)
Forward-port of #585 from release/1.2 (b9bc9c7) onto main, merged with the
manifest written once per run (#584) and the uniform entity selection (#588).
The skip ADR is numbered ADR-0064 here: ADR-0062 and ADR-0063 are taken on main.
- gen builds a key from the loaded model (each root node in canonical effective
form), the generators' identity (built engine code, config, owned generators,
templates, declared extra inputs, project config) and the output-changing
flags, before anything renders. A match with the last successful run, with
every generated file still holding that run's bytes, renders and writes
nothing. --force (Maven: -Dmetaobjects.force=true) turns it off; a generator
that cannot declare its inputs opts out.
- A run that names entities (positional, --entities, -Dmeta.entities) forces
exactly those: it never skips, never stores a key and leaves the stored
full-run key alone, in every port.
- verify --codegen may answer "no drift" locally from the key; CI and --full
always render, and every port compares in memory.
- The hash manifest stays loaded once and written once, and only when an entry
changed; identical bytes are never rewritten; TypeScript runs git merge-file
only for a hand-edited file.
- fixtures/codegen-skip-conformance/cases.json: the shared case table.
Hand-resolved: TypeScript runner, overwrite-policy, gen/verify/args/index and
codegen-drift; Python cli, runner, overwrite_policy; C# CodegenRunner,
CodegenCli, CodegenDrift, Generator, Program; Java generate and verify mojos;
docs, changelog and the ADR index.
* no-mistakes(review): apply reviewer inline fixes
* no-mistakes(review): apply reviewer inline fixes
* no-mistakes(review): warn unknown attrs before gen skip; add regression test
* no-mistakes(review): apply reviewer inline fixes
* no-mistakes(review): Carry warnings in skipped gen json/toon document
* no-mistakes(test): Align C# agent-context fixture wording; sdk suite green
* no-mistakes(document): align codegen-skip docs with ADR-00641 parent 56a4d89 commit 3514686
109 files changed
Lines changed: 6636 additions & 646 deletions
File tree
- agent-context/skills
- metaobjects-audit/references
- metaobjects-codegen/references
- metaobjects-fit-assessment/references
- docs
- features
- llms
- ports
- recipes
- generators/java
- examples/showcase
- fixtures
- agent-context-conformance
- csharp/expected/.claude/skills/metaobjects-audit/references
- java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-audit/references
- java-react/expected/.claude/skills/metaobjects-audit/references
- python/expected/.claude/skills
- metaobjects-audit/references
- metaobjects-codegen/references
- ts-react-tanstack/expected/.claude/skills
- metaobjects-audit/references
- metaobjects-codegen/references
- codegen-skip-conformance
- server
- csharp
- MetaObjects.Cli.Tests
- MetaObjects.Cli
- MetaObjects.Codegen.Tests
- MetaObjects.Codegen
- TemplateCodegen
- java
- codegen-base/src
- main/java/com/metaobjects/generator
- direct
- metadata
- html
- json
- object/javacode
- template
- util
- test/java/com/metaobjects/generator/util
- codegen-kotlin/src/main/kotlin/com/metaobjects/generator/kotlin
- codegen-mustache/src/main/java/com/metaobjects/generator/mustache
- codegen-spring/src/main/java/com/metaobjects/generator/spring
- maven-plugin/src
- main/java/com/metaobjects/mojo
- test/java/com/metaobjects/mojo
- python
- src/metaobjects
- codegen
- tests
- codegen
- typescript/packages
- cli
- src
- commands
- lib
- test
- integration
- unit
- codegen-ts
- src
- generators
- test
- overwrite-policy
- sdk
- spec/decisions
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
198 | 215 | | |
199 | 216 | | |
200 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
166 | | - | |
| 165 | + | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments