Aiven-Open / Aiven-Open/karapace

De-couple JSONSchema and Protobuf implementations from Avro

Aperta
#633 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
634
Fork
110
Merge medio
4g 7h
PR unite (30g)
4

Descrizione

The Protobuf and JSONSchema implementations currently have dependencies on Avro's `SchemaCompatibilityResult`. These implementations should be independent from each other. If we need a container to carry compatibility check results, we should define our own and not piggy-back on Avro's implementation.

- https://github.com/aiven/karapace/blob/85d8cc73f538d8af11aad0d2bc8681258c4aa1f0/karapace/compatibility/jsonschema/checks.py#L5
- https://github.com/aiven/karapace/blob/85d8cc73f538d8af11aad0d2bc8681258c4aa1f0/karapace/compatibility/protobuf/checks.py#L5

Other than best-practice, this also has implications on type-checking, since we pass in objects of the wrong type to the fields of Avro-specific entities. In this example, we pass in `list[str]` for `incompatibilities`, where a `avro.compatibility.SchemaIncompatibilityType` is expected.

- https://github.com/aiven/karapace/blob/85d8cc73f538d8af11aad0d2bc8681258c4aa1f0/karapace/compatibility/protobuf/checks.py#LL27C1-L28C1

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.