From fbd609c7fd6f7a77366b9a0e075286a81f5f7ed3 Mon Sep 17 00:00:00 2001 From: Alex Stephen Date: Tue, 10 Jul 2018 22:05:01 +0000 Subject: [PATCH 1/3] NatIP not required true --- products/compute/instance_networkinterfaces.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/products/compute/instance_networkinterfaces.yaml b/products/compute/instance_networkinterfaces.yaml index 188265641845..422e5b8f6c4b 100644 --- a/products/compute/instance_networkinterfaces.yaml +++ b/products/compute/instance_networkinterfaces.yaml @@ -50,7 +50,6 @@ from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. - required: true - !ruby/object:Api::Type::Enum name: 'type' description: | From b1bb39c509cb32db62c6dc628a440fe082bc201b Mon Sep 17 00:00:00 2001 From: Nathan McKinley Date: Tue, 10 Jul 2018 15:45:52 -0700 Subject: [PATCH 2/3] There must be one and only one newline after each documentation element. (#336) Merged PR #336. --- build/terraform | 2 +- products/compute/terraform.yaml | 29 +++++++------- .../terraform/property_documentation.erb | 3 +- .../terraform/resource.html.markdown.erb | 39 ++++++++++++++----- 4 files changed, 47 insertions(+), 26 deletions(-) diff --git a/build/terraform b/build/terraform index b93a759b2539..bbed86dd0b22 160000 --- a/build/terraform +++ b/build/terraform @@ -1 +1 @@ -Subproject commit b93a759b25399dc88e09cae86703deb33794a40a +Subproject commit bbed86dd0b22089f648f4983a3421178e50fad33 diff --git a/products/compute/terraform.yaml b/products/compute/terraform.yaml index e28ad70e9db0..4c0a4194ae41 100644 --- a/products/compute/terraform.yaml +++ b/products/compute/terraform.yaml @@ -506,30 +506,28 @@ overrides: !ruby/object:Provider::ResourceOverrides custom_expand: templates/terraform/custom_expand/route_gateway.erb # Description here is overridden because puppet won't compile if you ask # it to include docs greater than 80 characters. - description: | + description: |+ URL to a gateway that should handle matching packets. - Currently, you can only specify the internet gateway, using a full or partial valid URL: - - * https://www.googleapis.com/compute/v1/projects/project/global/gateways/default-internet-gateway - * projects/project/global/gateways/default-internet-gateway - * global/gateways/default-internet-gateway - You can also provide the string 'default-internet-gateway'. + * `https://www.googleapis.com/compute/v1/projects/project/global/gateways/default-internet-gateway` + * `projects/project/global/gateways/default-internet-gateway` + * `global/gateways/default-internet-gateway` + * The string `default-internet-gateway`. + nextHopInstance: !ruby/object:Provider::Terraform::PropertyOverride diff_suppress_func: 'compareSelfLinkOrResourceName' custom_expand: templates/terraform/custom_expand/route_instance.erb # Description here is overridden because puppet won't compile if you ask # it to include docs greater than 80 characters. - description: | + description: |+ URL to an instance that should handle matching packets. You can specify this as a full or partial URL. For example: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance - * projects/project/zones/zone/instances/instance - * zones/zone/instances/instance - You can also provide just the instance name, with the zone in - `next_hop_instance_zone`. + * `https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance` + * `projects/project/zones/zone/instances/instance` + * `zones/zone/instances/instance` + * Just the instance name, with the zone in `next_hop_instance_zone`. + tags: !ruby/object:Provider::Terraform::PropertyOverride custom_expand: templates/terraform/custom_expand/set_to_list.erb is_set: true @@ -537,11 +535,12 @@ overrides: !ruby/object:Provider::ResourceOverrides decoder: templates/terraform/decoders/route.erb extra_schema_entry: templates/terraform/extra_schema_entry/route.erb docs: !ruby/object:Provider::Terraform::Docs - optional_properties: | + optional_properties: |+ * `next_hop_instance_zone` - (Optional when `next_hop_instance` is specified) The zone of the instance specified in `next_hop_instance`. Omit if `next_hop_instance` is specified as a URL. + Snapshot: !ruby/object:Provider::Terraform::ResourceOverride exclude: true SslCertificate: !ruby/object:Provider::Terraform::ResourceOverride diff --git a/templates/terraform/property_documentation.erb b/templates/terraform/property_documentation.erb index a1004e11b849..cee9d1224f57 100644 --- a/templates/terraform/property_documentation.erb +++ b/templates/terraform/property_documentation.erb @@ -1,10 +1,11 @@ + * `<%= Google::StringUtils.underscore(property.name) -%>` - <% if property.required -%> (Required) <% elsif !property.output -%> (Optional) <% end -%> -<%= indent(property.description.strip, 2) -%> +<%= indent(property.description.strip.gsub("\n\n", "\n"), 2) -%> <% if property.is_a?(Api::Type::NestedObject) || (property.is_a?(Api::Type::Array) && property.item_type.is_a?(Api::Type::NestedObject)) -%> Structure is documented below. <% end -%> diff --git a/templates/terraform/resource.html.markdown.erb b/templates/terraform/resource.html.markdown.erb index c6da3e7d5f05..9b6f27253d8b 100644 --- a/templates/terraform/resource.html.markdown.erb +++ b/templates/terraform/resource.html.markdown.erb @@ -12,6 +12,29 @@ # See the License for the specific language governing permissions and # limitations under the License. <% end -%> +<%# NOTE NOTE NOTE + The newlines in this file are *load bearing*. This file outputs + Markdown, which is extremely sensitive to newlines. You have got + to have a newline after every attribute and property, because + otherwise MD will think the next element is part of the previous + property's bullet point. You cannot have any double newlines in the + middle of a property or attribute, because MD will think that the + empty line ends the bullet point and the indentation will be off. + You must have a newline before and after all --- document indicators, + and you must have a newline before and after all - - - hlines. + You cannot have more than one blank line between properties. + The --- document indicator must be the first line of the file. + As long as you only use `build_property_documentation`, it all works + fine - but when you need to add custom docs (notes, etc), you need + to remember these things. + + Know also that the `lines` function in heavy use in MagicModules will + strip exactly one trailing newline - unless that's what you've designed + your docstring for, it's easier to insert newlines where you need them + manually. That's why, in this file, we use `lines` on anything which + is generated from a ruby function, but skip it on anything that is + directly inserted from YAML. +-%> <% api_name_lower = product_ns.downcase resource_name = Google::StringUtils.underscore(object.name) @@ -50,10 +73,9 @@ To get more information about <%= object.name -%>, see: <% unless object.examples.nil? -%> ## Example Usage +<%= "\n" + object.examples -%> -<%= object.examples -%> <% end -%> - ## Argument Reference The following arguments are supported: @@ -61,14 +83,13 @@ The following arguments are supported: <% properties.select(&:required).each do |prop| -%> <%= lines(build_property_documentation(prop)) -%> <% end -%> - <% properties.select(&:required).each do |prop| -%> <%= lines(build_nested_property_documentation(prop)) -%> <% end -%> - <%- unless object.docs.required_properties.nil? -%> -<%= lines(object.docs.required_properties) -%> +<%= "\n" + object.docs.required_properties -%> <% end -%> + - - - <% properties.reject(&:required).reject(&:output).each do |prop| -%> @@ -82,10 +103,10 @@ The following arguments are supported: <% properties.reject(&:required).reject(&:output).each do |prop| -%> <%= lines(build_nested_property_documentation(prop)) -%> <% end -%> - <%- unless object.docs.optional_properties.nil? -%> -<%= lines(object.docs.optional_properties) -%> +<%= "\n" + object.docs.optional_properties -%> <% end -%> + ## Attributes Reference In addition to the arguments listed above, the following computed attributes are exported: @@ -100,10 +121,10 @@ In addition to the arguments listed above, the following computed attributes are <% properties.select(&:output).each do |prop| -%> <%= lines(build_nested_property_documentation(prop)) -%> <% end -%> - <%- unless object.docs.attributes.nil? -%> -<%= lines(object.docs.attributes) -%> +<%= "\n" + object.docs.attributes -%> <% end -%> + <% unless object.async.nil? -%> ## Timeouts From e3d2c58e016307c38a0a4f196c32866126f6ad60 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Tue, 10 Jul 2018 22:54:31 +0000 Subject: [PATCH 3/3] Update tracked submodules -> HEAD on Tue Jul 10 22:54:31 UTC 2018 Tracked submodules are build/puppet/compute build/puppet/sql build/puppet/storage build/chef/compute build/chef/sql build/chef/storage build/terraform build/ansible. --- build/ansible | 2 +- build/chef/compute | 2 +- build/puppet/compute | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/ansible b/build/ansible index b1ed6ff765f4..7df520678603 160000 --- a/build/ansible +++ b/build/ansible @@ -1 +1 @@ -Subproject commit b1ed6ff765f4248cceb4bef0eedde27fe5303cf4 +Subproject commit 7df5206786031600adf689a0dcc749eb279f41a3 diff --git a/build/chef/compute b/build/chef/compute index 34d43bee5bd8..39b7f7a65a49 160000 --- a/build/chef/compute +++ b/build/chef/compute @@ -1 +1 @@ -Subproject commit 34d43bee5bd8de99de7f76177a702c32adb2fa6e +Subproject commit 39b7f7a65a49e06ba7e214827d1d3f64801d9db0 diff --git a/build/puppet/compute b/build/puppet/compute index 518670c10c34..58fb89c09793 160000 --- a/build/puppet/compute +++ b/build/puppet/compute @@ -1 +1 @@ -Subproject commit 518670c10c34f365e133eaeb13a1f681750de138 +Subproject commit 58fb89c09793edaa8906719c37280c69e887ce6d