Repository navigation
refactor(dlq): keep start identity decoding private - #1088
sbalabanov wants to merge 1 commit into
Conversation
|
|
1 similar comment
|
|
sbalabanov
left a comment
There was a problem hiding this comment.
If DecodeLandRequestID is only used by "start" dlq, should it be placed there? Can put it on top of a PR implementing a separate start dlq.
Also, the goal was to make deserialization as safe as possible, so if LandRequest slightly changes, ID and queue could still be safely deserialized. Present me with options; if switching away from deserialization helper only brings us subtle performance/memory saving benefits, it does not worth the additional complexity of the code.
|
In reply to your review: yes, this is start-specific. On main only the start-DLQ registration uses it; the separate start-DLQ controller becomes its sole production caller, so the helper can be private in that controller's file. Both the existing helper and this PR deserialize the complete generated Options:
For the resilience goal you described, option 3 is the meaningful behavior change; otherwise I recommend option 1. No code, stacking, or PR-state changes made while waiting for your choice. [addressed by agent] |
In that light, keep using UnmarshalLandRequest(). However, refactor the whole helper function to be private and move to a new start dlq controller introduced in another PR. Base this PR on top of that another PR. |
Summary: Move the start-payload identity helper next to its dedicated DLQ controller and make it private. Keep UnmarshalLandRequest and all identity and wire validation behavior unchanged. Update the existing same-package test reference and the Start DLQ wiring example. Test Plan: Existing DLQ Start reconciliation, malformed-payload, and retry tests cover the unchanged behavior. Five focused controller/contract/pipeline test targets, the DLQ build target, formatting, lint, and BUILD synchronization checks pass. Revert Plan: Revert this commit.
1d5b137 to
2a08ae3
Compare
|
In reply to your comment: moved the identity helper into It still calls [addressed by agent] |
TLDR: Keep start-payload identity decoding private to the dedicated start DLQ without changing deserialization.
Summary
Move the start-only identity helper into the start DLQ controller's file and make it private. It continues to use
UnmarshalLandRequest, preserving complete canonical wire validation and the existing identity checks. Update the existing test reference and the Start DLQ wiring example.Based on #1040, which introduces the dedicated start DLQ controller.
Repro
Run
./tool/bazel test //submitqueue/orchestrator/controller/dlq:go_default_test --test_filter='TestDLQStartController_(ReconcilesOnlyError|RejectsMalformedPayload)' --test_output=all. Complete Start payloads retain their existing reconciliation behavior; malformed known fields and invalid identities are still rejected.Test Plan
make gazelle,make fmt,make lint, andmake check-gazellepass.Revert Plan
Revert this PR.
Issue Links
None.