ROX-34908: Add --no-serialized flag to walker and pg-table-bindings#21014
ROX-34908: Add --no-serialized flag to walker and pg-table-bindings#21014dashrews78 wants to merge 4 commits into
Conversation
|
Skipping CI for Draft Pull Request. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
This change is part of the following stack: Change managed by git-spice. |
🚀 Build Images ReadyImages are ready for commit 2474ba1. To use with deploy scripts: export MAIN_IMAGE_TAG=4.12.x-117-g2474ba14e5 |
Walker gains WalkOption/WithNoSerialized() to produce schemas where all proto fields become individual DB columns with no serialized bytea blob. Field.Include() returns true for all fields in this mode. The pg-table-bindings generator accepts --no-serialized and passes it through to the walker and templates. Also adds MessageBytes DataType for future use with inlined repeated messages. This is the foundational PR — no stores use the flag yet. The store templates, search integration, and test proto follow in subsequent PRs. Partially generated by AI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ields Moves repeated-field storage strategy from a CLI flag to a per-field proto annotation. A repeated message field tagged with sql:"strategy(bytea)" is stored as a MessageBytes column instead of creating a child table. This keeps schema definition in one place (the proto file) rather than split between proto and gen.go. Eliminates the need for the --repeated-field-strategy CLI flag. Partially generated by AI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
026eef1 to
7f03b70
Compare
…no-serialized Fix: addCommonFields incorrectly let root NoSerialized schemas fall into the child-table else branch, adding a spurious idx PK. Restructured to cleanly separate root vs child cases. Fail generation if a proto field has sql:"-" when --no-serialized is used — there is no serialized blob for excluded fields to fall back on. Partially generated by AI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| continue | ||
| } | ||
|
|
||
| if opts.RepeatedStrategy == "bytea" { |
There was a problem hiding this comment.
This is probably fine, but do we want to log/handle a case where someone sets RepeatedStrategy to a different value?
|
@dashrews78: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Description
Walker gains WalkOption/WithNoSerialized() to produce schemas where all
proto fields become individual DB columns with no serialized bytea blob.
Field.Include() returns true for all fields in this mode. The
pg-table-bindings generator accepts --no-serialized and passes it through
to the walker and templates. Also adds MessageBytes DataType for future
use with inlined repeated messages.
This is the foundational PR — no stores use the flag yet. The store
templates, search integration, and test proto follow in subsequent PRs.
Partially generated by AI.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
User-facing documentation
Testing and quality
Automated testing
How I validated my change
Unit test and the rest of the stack.