Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Build schema on upstream version 3.9.0-rc5 #213

Merged
merged 8 commits into from
Oct 30, 2024

Conversation

aiven-anton
Copy link
Collaborator

@aiven-anton aiven-anton commented Oct 11, 2024

This bumps schema to 3.9.0-rc5. The intention is that we can release this as some pre-release, most likely an alpha, pending the upstream final version.

This PR adds an @xfail to the compatibility test of UpdateRaftVoterResponse. This model is hitting #215 which already exists prior to schema vertsion 3.9.0. That bug should be addressed separately.

Base automatically changed from aiven-anton/3.8.0 to main October 18, 2024 13:32
@aiven-anton aiven-anton force-pushed the aiven-anton/3.9.0 branch 2 times, most recently from 7740b84 to 1244be0 Compare October 21, 2024 13:29
@codecov-commenter
Copy link

codecov-commenter commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a4a78b1) to head (6055532).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #213   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          854       854           
  Branches       119       119           
=========================================
  Hits           854       854           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aiven-anton aiven-anton marked this pull request as ready for review October 25, 2024 14:23
@aiven-anton aiven-anton requested review from a team as code owners October 25, 2024 14:23
@aiven-anton aiven-anton requested a review from gpkc October 25, 2024 14:23
@aiven-anton aiven-anton changed the title feature: Build schema on upstream version 3.9.0-rc2 feature: Build schema on upstream version 3.9.0-rc3 Oct 25, 2024
codegen/__init__.py Outdated Show resolved Hide resolved
Because UUID fields can always be None, the "optional" semantics around
them are special. Tagged fields also have special semantics, they can
always be omitted and are therefore by default also optional. With
3.9.0, the first field that combines both being UUID _and_ being a
tagged field was introduced, and it turns out we had buggy behavior for
this combination, resulting in generating code with an extra `| None`:

```python
replica_directory_id: uuid.UUID | None | None = field(
    metadata={"kafka_type": "uuid", "tag": 0}, default=None
)
```
To accomodate for tagged UUID fields, where we have forced optionality
for two reasons (all tagged fields are optional, all UUID fields are
optional). We change the `get_reader()` implementation to not take
optionality into account for UUID fields.

This is in line with the corresponding `get_writer()` implementation.

A somewhat more semantically correct option to this would be to not
squash "is tag" and "is optional" into the same boolean value in
`get_field_reader`,  and rather keep track of that one level down.
However, that would cause the already large combinatorial realm of
possibilities to test for `get_reader()` to expand even larger. Living
the semantically slightly worse, but much less complex option seems like
the right thing to do.
See reasoning in #215
@aiven-anton aiven-anton changed the title feature: Build schema on upstream version 3.9.0-rc3 feature: Build schema on upstream version 3.9.0-rc5 Oct 29, 2024
@aiven-anton aiven-anton added this pull request to the merge queue Oct 30, 2024
Merged via the queue into main with commit c73175a Oct 30, 2024
15 checks passed
@aiven-anton aiven-anton deleted the aiven-anton/3.9.0 branch October 30, 2024 14:10
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.

3 participants