Repository navigation
fix(avro): drop the version from Avro namespaces - #290
Conversation
Avro names cannot contain '@' or segments that start with a digit, so avro-tools rejected every file generated from a versioned namespace. Use the namespace name without its version, as the Java and OData visitors do, and run the Avro verification cases that this unblocks. Signed-off-by: radhika agarwal <theradhika2410@gmail.com>
|
@mttrbrts PTAL. |
mttrbrts
left a comment
There was a problem hiding this comment.
Welcome to concerto-codegen, @radhikaa06, and thanks for this! 🎉
This is a great fix. A one-line change in AvroVisitor turns Avro verification from skipping every case to compiling 7 of 8, and it now handles namespaces the same way as the Java and OData generators. The issue (#289) was a model bug report: clear repro steps, before/after evidence, and you'd already worked out the follow-ups (imported types written by short name, and the leading-underscore fields). Updating the hr_integration skip reason to the failure it actually hits now was a nice touch too.
I checked the snapshot updates and the new unit test, and the codegen suite passes locally. Avro verification in CI will confirm the newly enabled cases compile with avro-tools.
After concerto#1582 last week, it's great to see you contributing across the Accord Project repos. The follow-ups you noted in #289 would make good next PRs if you're interested. Thanks again!
Generated by Claude Code
|
Thank you so much for the detailed feedback and guidance! I'll continue exploring the follow-ups from #289. |
Closes #289
Changes
AvroVisitornow writes@namespace("org.acme.hr")instead of@namespace("org.acme.hr@1.0.0"). It usesModelUtil.parseNamespace, the same as the Java and OData visitors.test/verification/cases.jsand from themetamodelcase inverification/corpus/manifest.json. They now compile with avro-tools 1.12.0.hr_integrationstays skipped for Avro. I replaced its reason with the failure it actually hits now.Flags
org.acme.hr.v1_0_0would work and I'm happy to switch._identifierand_timestamp. I left that out of this PR and described it in the issue.npm testfails the branch coverage gate at 95.91%.maingives the same number on my machine, and CI onmainreports 96.08%. This PR adds no branches.cases.jsand the snapshot file. Whichever lands second will need a small rebase.Screenshots or Video
Before:

After:

Related Issues
Author Checklist
--signoffoption of git commit.mainfromradhikaa06:fix/avro-versioned-namespace