Repository navigation
feat(csharp): run the codegen gate on bare verify via csharp.outDir - #477
Merged
Merged
Conversation
…fig.json A plain `dotnet meta verify` skipped the codegen gate unless --out was passed. `csharp.outDir` now names the directory; gen writes there, verify diffs against it, and --out still wins.
…ures/cli.md and docs/ports/csharp.md. Doc-only change; no code or tests touched. CHANGELOG and agent-context references already matched the new behavior.
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
csharp.outDirsetting to.metaobjects/config.json, read byNeutralConfigand surfaced onResolvedMetadata.OutDir. Relative paths resolve against the directory holding.metaobjects/. Unknown keys, a non-object block, or an empty or non-stringoutDirare refused withERR_BAD_ATTR_VALUE.dotnet meta genanddotnet meta verify --codegenfall back tocsharp.outDirwhen--outis omitted, so a baredotnet meta verifyruns the codegen gate against the directorygenwrites to. An explicit--outstill wins. With neither set, the skip note now names the setting. A malformed config is reported as the real error, not as a usage line.ConfigSchemadeclares thecsharpblock so the shared config validates without unknown-key warnings. Docs (docs/features/cli.md,docs/ports/csharp.md), the CHANGELOG entry, and the C# agent-context references are updated to match.Validation
Risk Assessment
✅ Low: Change is small and additive: csharp.outDir is read, validated and resolved consistently for gen and verify, an explicit --out still wins, and the prior round's malformed-config fix now reports the real error. The other ports ignore the new config block, and the TypeScript reader declares it. No concrete failing path found.
Testing
Driven live against the built C# CLI in a disposable project. Bare verify runs the codegen gate from csharp.outDir: clean passes, drift and missing files fail naming the file. --out overrides config, no-config keeps the skip note, and malformed config shows the real error on bare verify, gen and verify --codegen, so the review-1 fix holds. Full C# solution tests passed with 0 failures, plus the TS baseline. Overall pass; one cosmetic info on the drift hint wording.
Evidence: Live transcript: bare verify and gen scenarios S1 to S9b
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
server/csharp/MetaObjects.Codegen/CodegenCli.cs:667- ConfiguredOutDir swallows MetaModelException/MetadataLocationException and returns null. In the ownedgenandverify --codegenrunners, a malformed config (e.g."csharp": { "outdir": "x" }, a non-stringoutDir, or a badsources) with no--outhits the usage branch. The runner printsusage: ... --out <dir>and(or set "csharp": { "outDir": ... }), then exits 2. The real error (ERR_BAD_ATTR_VALUE naming the bad key) is never shown. The user is told to set the very key they already set wrongly. Same class at CodegenCli.cs:854 (verify --codegenrunner). Program.cs bare verify is unaffected because ResolveMetadataDirOrExit reports first. Fix: when resolution throws, fall through to ResolveOrReport so the real error prints, instead of reporting usage.server/csharp/MetaObjects.Codegen/CodegenCli.cs:597- The XML doc summary for ResolveOrReport had been displaced above the new ConfiguredOutDir method, leaving two stacked summaries on one member. Moved the ResolveOrReport summary back above ResolveOrReport. Comment-only change.🔧 Fix applied.
1 info still open:
server/csharp/MetaObjects.Codegen/CodegenCli.cs:597- The XML doc summary for ResolveOrReport had been displaced above the new ConfiguredOutDir method, leaving two stacked summaries on one member. Moved the ResolveOrReport summary back above ResolveOrReport. Comment-only change.server/csharp/MetaObjects.Codegen/CodegenCli.cs- Drift hint still says it needs --out, the same directory you gave this command, after a bare verify that took its directory from csharp.outDir. Cosmetic only; exit codes and the gate are unaffected.scripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchainsdotnet build server/csharp/MetaObjects.Cli/MetaObjects.Cli.csproj -c Release -o /tmp/mo-verify-e2e/cliDisposable project in /tmp/mo-verify-e2e/proj: dotnet MetaObjects.Cli.dll init, codegen/Codegen.csproj ProjectReference to worktree MetaObjects.Codegen, EntityGenerator in list, .metaobjects/config.json with csharp.outDirLive scenarios S1 to S9b via dotnet MetaObjects.Cli.dll gen|verify (transcript: csharp-bare-verify-outdir.txt)dotnet test server/csharp/MetaObjects.Cli.Tests/MetaObjects.Cli.Tests.csproj (317 passed)dotnet test server/csharp/MetaObjects.sln (Render 332, Conformance 2094, Cli 317, Codegen 1037 passed, 1 skipped, 0 failed)Baseline scripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchains (already green)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.