Skip to content

fix(avro): drop the version from Avro namespaces - #290

Merged
mttrbrts merged 1 commit into
accordproject:mainfrom
radhikaa06:fix/avro-versioned-namespace
Oct 19, 2026
Merged

mttrbrts merged 1 commit into
accordproject:mainfrom
radhikaa06:fix/avro-versioned-namespace

Conversation

@radhikaa06

@radhikaa06 radhikaa06 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes #289

Changes

  • AvroVisitor now writes @namespace("org.acme.hr") instead of @namespace("org.acme.hr@1.0.0"). It uses ModelUtil.parseNamespace, the same as the Java and OData visitors.
  • Removed the Avro skip from 7 cases in test/verification/cases.js and from the metamodel case in verification/corpus/manifest.json. They now compile with avro-tools 1.12.0.
  • hr_integration stays skipped for Avro. I replaced its reason with the failure it actually hits now.
  • Updated the 4 Avro snapshots and added a unit test for the namespace line.

Flags

  • Two versions of one namespace now map to the same Avro namespace. A single model file can't import both (Concerto rejects that), so a clash only happens if a consumer loads both protocols side by side. If you'd rather keep the version in, something like org.acme.hr.v1_0_0 would work and I'm happy to switch.
  • The newly enabled cases pass on exit code, but avro-tools still drops the leading underscore from _identifier and _timestamp. I left that out of this PR and described it in the issue.
  • Locally npm test fails the branch coverage gate at 95.91%. main gives the same number on my machine, and CI on main reports 96.08%. This PR adds no branches.
  • fix(graphql): generate valid GraphQL for empty enums #273 and fix(rust): resolve scalar maps and recursion #282 also edit cases.js and the snapshot file. Whichever lands second will need a small rebase.

Screenshots or Video

Before:
before

After:
after

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from radhikaa06:fix/avro-versioned-namespace

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>
@radhikaa06

radhikaa06 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

@mttrbrts PTAL.

@mttrbrts mttrbrts left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@mttrbrts
mttrbrts enabled auto-merge (squash) October 19, 2026 18:39
@mttrbrts
mttrbrts merged commit af4fa25 into accordproject:main Oct 19, 2026
27 checks passed
@radhikaa06

Copy link
Copy Markdown
Contributor Author

Thank you so much for the detailed feedback and guidance! I'll continue exploring the follow-ups from #289.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Avro IDL generated from a versioned namespace fails avro-tools

2 participants