Skip to content

rpk: bump twmb/avro to v1.4.1#30138

Open
twmb wants to merge 2 commits intodevfrom
twmb/bump-avro-v1.4.1
Open

rpk: bump twmb/avro to v1.4.1#30138
twmb wants to merge 2 commits intodevfrom
twmb/bump-avro-v1.4.1

Conversation

@twmb
Copy link
Copy Markdown
Contributor

@twmb twmb commented Apr 11, 2026

Summary

Routine maintenance bump from v1.3.4 to v1.4.1 for rpk's Avro serde.

v1.4.1 release notes: https://github.com/twmb/avro/releases/tag/v1.4.1

v1.4.1 fixes an edge case where records with zero fields emitted as {"type":"record","name":"x"} (missing the required fields attribute), which strict Avro readers reject. rpk is highly unlikely to hit this in practice — pkg/serde/avro.go parses schemas from schema registry and produces/consumes records, and empty-record schemas are rare in normal data. Primarily a "stay current" bump.

v1.4.0 (also included) added atype subpackage, SchemaNode struct-literal construction, case-insensitive JSON parsing for janky encoders, duplicate-JSON-key tolerance, and named-type dedup. None of these change behavior for rpk's existing usage.

Test plan

  • go mod tidy clean
  • go build ./... clean
  • go test ./pkg/serde/... passes

@twmb twmb requested review from a team, kbatuigas and r-vasquez as code owners April 11, 2026 20:38
- generateAvroSchema: drop the no-references fast path. SchemaCache.Parse
  with an empty cache is equivalent to avro.Parse, so one path covers
  both cases.

- parseAvroReferences: track in-progress references on a stack (added
  on entry, deleted on exit) and return an explicit "circular avro
  schema reference detected" error on cycle hits. The old code used a
  monotonically-growing "seen" set with `continue`, which avoided
  infinite loops but silently dropped cyclic branches and then failed
  further down with a cryptic parse error. Also track a separate
  "parsed" set to avoid redundant registry fetches on shared subgraphs
  (e.g. A->B->D and A->C->D).

- Wrap errors with %w instead of %v so errors.Is/As can walk the chain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant