Repository navigation
fix(csharp): shared DecimalWire and MetaNetValidation helpers carry the auto-generated marker - #461
Merged
Merged
Conversation
…he auto-generated marker (#460)
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
EntityGeneratornow emits// <auto-generated/>as the first line of theDecimalWireandMetaNetValidationhelper files. Previously these were the only emitted files without the marker, so runs with noGenStateDirwrote them once and then refused to overwrite them on later runs. The helpers now regenerate. The marker is the only change to their text.DecimalWireruntime source and the two committed helper copies inMetaObjects.IntegrationTests/Generated/carry the same marker line.DecimalWireTestscoverage: one test asserts the marker is on the first line of every shared helper, and one test runs codegen twice with no state dir and asserts the second run rewrites all four helper files without a "refusing to overwrite" warning.CHANGELOG.mdgets a Fixed entry (C#: DecimalWire and MetaNetValidation helpers lack <auto-generated/>, so a runner without GenStateDir never regenerates them #460). It notes that a helper copy already on disk has no marker, so existingDecimalWire*.g.csandMetaNetValidation*.g.csfiles must be deleted once before regenerating.Validation
Risk Assessment
✅ Low: A one-line comment marker is added to two helper templates, and the fixed CHANGELOG upgrade note now tells adopters to delete the stale helpers before regenerating. The new tests run the real runner and would fail without the fix.
Testing
I drove the real C# codegen runner against a two-namespace model with no state dir. The helper files get the marker, and a rerun overwrites hand-edited helpers in both namespaces with no refusal warning. The two new tests fail on the pre-fix generator and pass with the fix. The C# Codegen, Cli, Render and Conformance suites all pass. The TypeScript suite did not finish within the time limit, but the change doesn't touch TypeScript. The CHANGELOG text now tells adopters to delete the existing helper files and then regenerate, as the review round 1 decision requested. The CHANGELOG wording was not driven live; it is untested.
Shared_helpers_carry_the_generated_marker_on_their_first_linepasses. It failed when run against the pre-fix generator.Rerun_without_a_state_dir_rewrites_the_helpers_in_every_namespacepasses. Against the pre-fix generator it failed with 'refusing to overwrite hand-written file: MetaNetVa…/DecimalWi…'.dotnet testpasses for Codegen, Cli, Render and Conformance. The updated IntegrationTests generated copies were not run, since they need Testcontainers.Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
CHANGELOG.md:25- CHANGELOG says "Regenerate once", but that does not recover an existing deployment. A pre-fix helper on disk has no// <auto-generated/>marker. With noGenStateDir,CodegenRunner.WriteOne(CodegenRunner.cs:193) still logsrefusing to overwrite hand-written fileand keeps the stale copy. The first run after upgrading therefore changes nothing. The adopter must delete the two helper files, or add the marker by hand, before the fix takes effect. This is exactly the population the issue describes. The code fix is sound and a migration path is out of scope. Only the upgrade instruction is wrong, so reword it to say to deleteDecimalWire*.g.csandMetaNetValidation*.g.csand then regenerate.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
Shared_helpers_carry_the_generated_marker_on_their_first_linepasses. It failed when run against the pre-fix generator.Rerun_without_a_state_dir_rewrites_the_helpers_in_every_namespacepasses. Against the pre-fix generator it failed with 'refusing to overwrite hand-written file: MetaNetVa…/DecimalWi…'.dotnet testpasses for Codegen, Cli, Render and Conformance. The updated IntegrationTests generated copies were not run, since they need Testcontainers.scripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchainsdotnet test MetaObjects.Codegen.Tests --filter DecimalWireTests(112 passed)Temporarily restored the pre-fixEntityGenerator.csand ran the two new tests: both failed, one on the missing marker and one withrefusing to overwrite hand-written file. I then restored the file withgit checkout.dotnet testfor MetaObjects.Codegen.Tests (1009 passed, 1 skipped), MetaObjects.Cli.Tests (309), MetaObjects.Render.Tests (332) and MetaObjects.Conformance.Tests (2078)cd server/typescript && bun testtimed out before reporting, so it gave no result. The change is C#-only, and the baselinescripts/ci-local.sh --only ts-fast --only ts-unit --strict-toolchainshad already passed.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Closes #460