Repository navigation
fix: name the old valueObjectModuleSpecifier call, print generator error causes, and document rc.1 upgrade diffs - #662
Merged
Merged
Conversation
…list A downstream estate's run against 1.3.0-rc.1 found diffs the "Upgrading from 1.2.0" list did not explain. This adds them and hardens the two owned-generator breaks. - CHANGELOG upgrade list: the removed codegen-spring string helpers (SpringRecordBuilder.members, SpringTypeMapper.enumDeclaration) and their writer replacements; valueObjectModuleSpecifier's node-first signature, each with a before/after snippet; the Kotlin Exposed enum column with no length moving from VARCHAR(64) to TEXT (intended: it is what meta migrate creates and what the Drizzle and EF Core bindings declare); the partial-index predicate in Exposed; literal @default as Kotlin constructor defaults; the unreadable-body 400's issues list in the generated MetaDecimalWire. - valueObjectModuleSpecifier refuses a first argument that is not a node with a CodegenError naming the 1.3 signature, instead of "node.resolutionKey is not a function". - meta gen prints the cause of a generator or template throw and the frame it was thrown at; the new --verbose prints its stack. - estate-run.sh: the java install default is `mvn -B -q -U test-compile`, which builds a multi-module reactor whose modules depend on each other; estate-run.md documents lifecycle-bound generation (--gen-cmd/--verify-cmd) and snapshot diffs for gitignored output.
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 Changed
Upgrade-list documentation. The CHANGELOG "Upgrading from 1.2.0" list now covers each rc.1 change that was missing from it, with before/after code where it helps:
valueObjectModuleSpecifiersignature change, with the new call shape.SpringRecordBuilder.membersandSpringTypeMapper.enumDeclaration, replaced bywriteMembersandwriteEnumDeclaration, which write into aJavaWriter.customEnumeration(..., "TEXT", ...)instead ofenumerationByName(..., 64, ...).filterCondition.@defaultis now the constructor default on Kotlin data classes.issueslist (code,path,message).The Added entry for enum length and the Kotlin docs (
docs/features/field-types.md,codegen-kotlin/README.md) are corrected to match.Clearer generator errors.
valueObjectModuleSpecifiernow checks that its first argument is a node. A template that still uses the 1.2 call shape gets aCodegenErrorthat names the 1.3 signature, not a barenode.resolutionKey is not a function.meta gennow prints acaused by:line for each error in the cause chain, with the frame where it was thrown.meta gen --verboseflag prints the full stack.gen-generator-throw-cause.test.tsand new cases inimport-path.test.ts).Pre-release estate checker (
tools/prerelease/estate-run.sh).mvn -B -q -U test-compile, so a multi-module reactor resolves sibling modules instead of failing independency:resolve.estate-run.mdhas a new "Multi-module JVM estates" section. It explains how to pass--gen-cmd/--verify-cmdwhen generation is bound to a phase, and how to check generated output that git ignores.test-estate-run.shcover both script changes.Operator notes
@maxLengthnorenums.maxLength"stays unbounded text";meta migratecreatestextfor it (fixtures/enum-length-conformance/README.md); the Drizzle (Postgres) and EF Core bindings declare no length there (codegen-ts/src/column-mapper.ts,DbContextGenerator.csHasMaxLengthonly when a length resolves); and the 1.2.0 KotlinVARCHAR(64)came from a hard-codedKotlinTypeMapper.ENUM_VARCHAR_LEN = 64, which disagreed with the migrated column. The upgrade entry says what it does to an existingVARCHAR(64)column (nothing at read/write; only Exposed-written DDL seesTEXT) and how to keep a sized column (@maxLengthorenums.maxLength).tools/prerelease/test-estate-run.sh, run by the operator at pipeline head982d1996: 15/15 ok, including E14 (the java install default ismvn -B -q -U test-compile) and E15 (a file the install generates is listed in the report).meta gen --verboseflag stays by decision (review finding F3 declined). The live-validation gaps for D1 and D4–D7 (test findings test-3/test-4) were declined by decision: their live proof is the downstream estate's rc.2 rerun.Validation
Risk Assessment
✅ Low: The change covers docs, a CLI diagnostic and the prerelease tooling. I verified the round-1 fixes in code. F1: install-time changes are now diffed from a map taken after link and listed in the report, and test E15 would fail without that. F4: the --verbose hint is gated on a stack frame. F5: the CHANGELOG preamble is softened. The JVM and Kotlin claims in the CHANGELOG match the source signatures.
Testing
The configured affected-lanes CI command had already passed at this commit and supplied broad regression. I then ran the real
metaCLI on a throwaway project with a 1.2-style owned template. It fails with exit 1 and prints a CodegenError naming the new signature. It also prints acaused by:line with the throwing frame and a--verbosehint.--verboseprints the full stack down to the owned template's file and line. After the template is updated to the 1.3 shape,meta genwritesexport * from "./Address". I also ranestate-run.shon a real two-module Maven reactor, offline. The olddependency:resolveinstall fails: it cannot find the sibling module. The newtest-compiledefault passes, and the report lists the tracked file the install regenerated under "Files changed by install". The estate is restored to its starting commit.test-estate-run.shpassed 15/15. The CHANGELOG upgrade list contains all of D1 to D7. Scratch projects were removed and the worktree is clean. There is no UI surface, so the evidence is CLI transcripts and Markdown reports.meta genwith an owned TypeScript template that calls valueObjectModuleSpecifier in the 1.2 shape(name, ctx.packageOf, ...). Expected: gen exits 1 with a CodegenError naming the 1…estate-run.sh --port javawith the default install on a multi-module Maven reactor. Module b depends on sibling a, and a regenerates a tracked source at generate-sources.…Evidence: D2: meta gen with a 1.2-shape owned template (error, caused-by line, --verbose hint)
Evidence: D2: meta gen --verbose full stack naming the owned template file:line
Evidence: D2: meta gen with the 1.3-shape template succeeds and writes vo.ts
Evidence: D3: estate-run.sh report with the old dependency:resolve install, failing on the multi-module reactor
Evidence: D3: estate-run.sh report with the new test-compile default, passing and listing the install-regenerated file
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
tools/prerelease/estate-run.sh:107- The new Java install defaultmvn -B -q -U test-compileruns the generate-sources phase.MetaDataGeneratorMojodeclaresdefaultPhase = GENERATE_SOURCES, so any estate whose pom has a plaingenerateexecution regenerates with the candidate duringinstall (clean). That happens beforedirtymap > base.txt(line 201). The "files changed by the first gen" list iscomm -13 base after, so every git-visible file the install already regenerated drops out of it, and the list reads 0. Affected files include committed generated sources and the new committed.metaobjects/.gen-state/.hashes/<package>.jsonmanifests (the downstream estate's report shows these in 5 JVM modules). The run then reports a clean change list with nothing to explain. This is a silent false-clean in the step that enforces "every rc.1 diff must be explained".dependency:resolvenever generated, so this is a regression. Sibling sites that assume install does not generate: the estate-run.sh:196-197 comment ("beyond what link and install already did (the repinned manifests, the lockfile)"); estate-run.md:41-45, which advises--gen-cmd 'mvn -B -q generate-sources'while the install default already ran that phase; and the test-estate-run.sh E14 test, which pins the default without checking the change list. Fix: take the base map before the install step and subtract only link/install-owned paths (manifests, lockfile), or report install-time regeneration as its own list.tools/prerelease/estate-run.md:56- The doc told the estate to snapshot ignored generated trees "before the first gen and after each gen". The script runs both gens in one invocation, so a snapshot between them is impossible. I reworded it as an inline fix: snapshot before the run and after it (with--keep-linked), then run--gen-cmdonce more and snapshot again. The second diff must be empty.server/typescript/packages/cli/src/lib/args.ts:174- Simplification: the newmeta gen --verboseflag is an extra mode, documented at cli/src/index.ts:237, error-text.ts:35-44 and CHANGELOG.md:158. Intent D2 asks only thatmeta genstop hidingerr.cause. The newcaused by: <name>: <message> (<frame>)line already does that, because it names the file and line that threw. A full-stack mode, its hint line and its help text are not required by any intent item. The smallest remedy is to remove the flag, along with theverbosebranches indescribeErrorCause, the hint line and the--verbosetest. Keep the cause line and frame.server/typescript/packages/cli/src/lib/error-text.ts:44- When the only cause is not anError(for example{ cause: "socket closed" }),describeErrorCausestill adds "run again with --verbose for the full stack". Under--verbose, that case prints no stack: the loop breaks on the non-Error, and the outer stack is printed only when the chain is empty. The hint promises output that does not exist. Fix: add the hint only when at least oneErrorframe was found.CHANGELOG.md:51- The upgrade-list preamble says "Each item below is described in full under Security, Added, Changed or Fixed". Several new items have no such entry. These are the Kotlin TEXT enum column (line ~267), the Kotlin unreadable-bodyissuesenvelope (line ~292), thevalueObjectModuleSpecifierCodegenErrorand the newmeta gen --verboseCLI flag (line ~157, not under Added). The Kotlin partial-index item has a Fixed entry (line ~3285). Fix: add the missing Added/Changed entries, or soften the preamble.🔧 Fix applied.
3 issues (1 warning, 2 infos) still open:
tools/prerelease/estate-run.md:56- The doc told the estate to snapshot ignored generated trees "before the first gen and after each gen". The script runs both gens in one invocation, so a snapshot between them is impossible. I reworded it as an inline fix: snapshot before the run and after it (with--keep-linked), then run--gen-cmdonce more and snapshot again. The second diff must be empty.server/typescript/packages/cli/src/lib/args.ts:174- Simplification: the newmeta gen --verboseflag is an extra mode, documented at cli/src/index.ts:237, error-text.ts:35-44 and CHANGELOG.md:158. Intent D2 asks only thatmeta genstop hidingerr.cause. The newcaused by: <name>: <message> (<frame>)line already does that, because it names the file and line that threw. A full-stack mode, its hint line and its help text are not required by any intent item. The smallest remedy is to remove the flag, along with theverbosebranches indescribeErrorCause, the hint line and the--verbosetest. Keep the cause line and frame.tools/prerelease/estate-run.md:44- Applied an inline fix to a sentence the round-1 fix added. It said install-regenerated files are listed "separately from the lockfile". The script lists the lockfile in the same "Files changed by install" section, and the report says "A lockfile is the install's own". I reworded it to "beside the lockfile and separately from the first gen's list".🔧 **Test** - 4 issues found → no changes applied ✅
server/typescript/packages/cli/test/gen-generator-throw-cause.test.ts:121- server/typescript/packages/cli/test/gen-generator-throw-cause.test.ts:121 failedtscunder exactOptionalPropertyTypes (TS2412: undefined not assignable to string). Fixed by casting to{ stack?: string | undefined }. The uncommitted fix is in the worktree.meta genon a live project with a throwing owned generator. Not run live in this pass for time.scripts/ci-local.sh --affected --strict-toolchainsscripts/ci-local.sh --affected --strict-toolchains(failed before fix, passed after, exit 0)bun run buildandbun run typecheckat server/typescript (typecheck failed before fix, exit 0 after)bun run typecheckin server/typescript/packages/cli (exit 0 after fix)bun test test/gen-generator-throw-cause.test.tsin server/typescript/packages/cli (6 pass)🔧 No changes applied.
✅ Re-checked - no issues remain.
meta genwith an owned TypeScript template that calls valueObjectModuleSpecifier in the 1.2 shape(name, ctx.packageOf, ...). Expected: gen exits 1 with a CodegenError naming the 1…estate-run.sh --port javawith the default install on a multi-module Maven reactor. Module b depends on sibling a, and a regenerates a tracked source at generate-sources.…scripts/ci-local.sh --affected --strict-toolchainsBroad regression: the configured test commandscripts/ci-local.sh --affected --strict-toolchainsalready passed at this commit (baseline). It was not re-run because I changed no source or test files.bun server/typescript/packages/cli/bin/meta.ts gen --format text, run on a throwaway project whose owned template callsvalueObjectModuleSpecifier("Address", ctx.packageOf, ...)(1.2 shape)bun .../meta.ts gen --format text --verbose, same projectbun --no-install .../meta.ts gen --format text, same project with the template moved to the 1.3 shape(ctx.renderContext.resolveValueObject(field), name, ...)MAVEN_ARGS=-o bash tools/prerelease/estate-run.sh --port java --install-cmd 'mvn -B -q -U dependency:resolve' ..., run on a throwaway 2-module reactor (b depends on a; a regenerates a tracked source at generate-sources)MAVEN_ARGS=-o bash tools/prerelease/estate-run.sh --port java ...with the default install (mvn -B -q -U test-compile), same reactorbash tools/prerelease/test-estate-run.sh(15/15 ok)Read the CHANGELOG 'Upgrading from 1.2.0' section for D1, D2, D4, D5, D6 and D7 (not a live check)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.