Add support for submessages in template - part1. #1617
Conversation
douglas-reid
left a comment
There was a problem hiding this comment.
There's a lot going on here, but it looks reasonable to me. Just a few very small questions.
There was a problem hiding this comment.
fwiw: you can use raw string literals if you would like to avoid escaping nested quotes.
There was a problem hiding this comment.
should Resource1 be referenced anywhere? what is this testing? Is this just verifying that all messages within the proto file get types and instance params, etc. ?
There was a problem hiding this comment.
So, every message in the proto will have an equivalent *InstanceParam and *Type. For simplicity I choose to generate these artifacts for every message irrespective if they are reachable from the parent 'Template' message or not. We can certainly traverse from the Template and only include what is reachable, however, doing it the existing way is simple and I hope people just don't write dead messages (not referenced from anywhere). The Template developer should be a reasonable person :-), and will fix the dead message if he/she accidentally defines any.
Thoughts ?
There was a problem hiding this comment.
As you stated in your comment, this PR and the test is testing what gets generated for Go Instances, Type and InstanceParam messages.
guptasu
left a comment
There was a problem hiding this comment.
@douglas-reid PTAL. I have addressed your comments.
There was a problem hiding this comment.
So, every message in the proto will have an equivalent *InstanceParam and *Type. For simplicity I choose to generate these artifacts for every message irrespective if they are reachable from the parent 'Template' message or not. We can certainly traverse from the Template and only include what is reachable, however, doing it the existing way is simple and I hope people just don't write dead messages (not referenced from anywhere). The Template developer should be a reasonable person :-), and will fix the dead message if he/she accidentally defines any.
Thoughts ?
There was a problem hiding this comment.
As you stated in your comment, this PR and the test is testing what gets generated for Go Instances, Type and InstanceParam messages.
|
/test istio-presubmit |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: douglas-reid The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
…l contain the bootstraping code generation (code that constructs the recurrsive submessages)
537cc0e to
6f24751
Compare
Automatic merge from submit-queue. Fix submessage support part1 **What this PR does / why we need it**: NOTE: The changes in this PR were already approved by @douglas-reid @geeknoid. Old PR contained 12 files (#1617) but was reverted because of missing 2 generated pb.go file. I have added the missing 2 generated file in this PR (this PR therefore contains 14 files). Note this is part 1 of sub message support. It is based on the proposal https://docs.google.com/document/d/1GL_EOitfBJDfgbQJOSROceK5RdqNPuiggeAebaNqyf8/edit# This PR contains the code generation for the go Instances and the augmented proto messages (Type and InstanceParam) Part 2 (following [PR](#1702)) will contain the bootstraping code generation (code that runs at run-time, inside Mixer framework and instantiates these sub-message artifacts generated in this PR). **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note none ```
Automatic merge from submit-queue. Fix submessage support part1 **What this PR does / why we need it**: NOTE: The changes in this PR were already approved by @douglas-reid @geeknoid. Old PR contained 12 files (istio/istio#1617) but was reverted because of missing 2 generated pb.go file. I have added the missing 2 generated file in this PR (this PR therefore contains 14 files). Note this is part 1 of sub message support. It is based on the proposal https://docs.google.com/document/d/1GL_EOitfBJDfgbQJOSROceK5RdqNPuiggeAebaNqyf8/edit# This PR contains the code generation for the go Instances and the augmented proto messages (Type and InstanceParam) Part 2 (following [PR](istio/istio#1702)) will contain the bootstraping code generation (code that runs at run-time, inside Mixer framework and instantiates these sub-message artifacts generated in this PR). **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note none ```
What this PR does / why we need it:
Note this is part 1 of sub message support. It is based on the proposal https://docs.google.com/document/d/1GL_EOitfBJDfgbQJOSROceK5RdqNPuiggeAebaNqyf8/edit#
This PR contains the code generation for the go Instances and the augmented proto messages (Type and InstanceParam)
Part 2 (following PR) will contain the bootstraping code generation (code that runs at run-time, inside Mixer framework and instantiates these sub-message artifacts generated in this PR).
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
Release note: