Commit graph

114 commits

Author SHA1 Message Date
Justin Van Patten
2b97340133
[codegen/docs] Emit docs for methods (#7731) 2021-08-12 14:31:15 -07:00
David Wrede
878af7aecf
Updating doc links to align with changes in docs #4707 (#6157)
Co-authored-by: David Wrede <dave@pulumi.com>
2021-07-28 14:14:48 -07:00
Justin Van Patten
42a1896bf9
[codegen/python] Delete dead code around casing tables (#7647)
Coincident with the release of Pulumi 3.0, we updated the provider SDK codegen for Python to no longer use casing tables for translating Python snake_case names to Pulumi camelCase names (and vice versa). Instead, the mapping is encoded in decorators applied on class properties.

Some of the code that was used to generate and use the casing tables has persisted. This commits removes this code, as it's no longer necessary, and will improve the quality of our generated examples.
2021-07-27 08:37:49 -07:00
Mikhail Shilkov
f2f918799d Rename Azure to Azure Classic in reference docs 2021-07-15 10:35:12 +02:00
Pat Gavlin
4d1ca1596b
[codegen/schema] YAML {un,}marshaling support. (#7509)
These changes add support for unmarshaling and marshaling package
schemas using YAML instead of JSON. Language-specific data is
canonically JSON. Users of the `*Spec` types will need to update the
types of the the their `Language` values to use the new
`schema.RawMessage` type instead of `json.RawMessage`: the former has
support for YAML while the latter does not.
2021-07-13 16:41:40 -07:00
Christian Nunciato
bc7a88e7d3
Change resource-docs filenames to _index.md (#7450)
* Change resource-docs filenames to _index.md
* Rename test files
2021-07-08 18:07:05 -07:00
Pat Gavlin
46400d502b
[codegen] Unify SDK codegen testing (#7433)
Rather than duplicating the list of tests and codegen driver across each
SDK, move its definition into `pkg/codegen/internal/test`. This has a
few notable benefits:

- All SDK code generators will be tested against each test. Though some
  tests may exercise a particular code generator more than others, the
  extra coverage will be generally beneficial.
- Adding a new test is simpler, as only a single file needs to be
  changed.
- All SDKs now honor the `PULUMI_ACCEPT` environment variable for
  updating baselines.
- Codegen tests now validate all generated files instead of only a
  particular subset.
2021-07-06 15:40:53 -07:00
Pat Gavlin
7b1d6ec1ac
Reify Input and Optional types in the schema type system. (#7059)
These changes support arbitrary combinations of input + plain types
within a schema. Handling plain types at the property level was not
sufficient to support such combinations. Reifying these types
required updating quite a bit of code. This is likely to have caused
some temporary complications, but should eventually lead to
substantial simplification in the SDK and program code generators.

With the new design, input and optional types are explicit in the schema
type system. Optionals will only appear at the outermost level of a type
(i.e. Input<Optional<>>, Array<Optional<>>, etc. will not occur). In
addition to explicit input types, each object type now has a "plain"
shape and an "input" shape. The former uses only plain types; the latter
uses input shapes wherever a plain type is not specified. Plain types
are indicated in the schema by setting the "plain" property of a type spec
to true.
2021-06-24 09:17:55 -07:00
Justin Van Patten
4e9e017cd2
[codegen/python] Rename conflicting ResourceArgs classes (#7171)
Python resource constructor overloads were recently added that accept a
`<Resource>Args` class for input properties, as an alternative to the
other constructor overload that accepts keyword arguments. The name of
the new args class is the name of the resource concatenated with an
`Args` suffix.

Some providers (e.g. Kubernetes, Azure Native, and Google Native) have
input types with the same name as resources in the same module, which
results in two different `<Resource>Args` classes in the same module.

When you try to use the new args class with the constructor, e.g.:

```python
pulumi_kubernetes.storage.v1.StorageClass(
            resource_name='string',
            args=pulumi_kubernetes.storage.v1.StorageClassArgs(...),
            opts=pulumi.ResourceOptions(...),
)
```

You run into an error, because
`pulumi_kubernetes.storage.v1.StorageClassArgs` is actually referring to
the existing input type rather than the intended `StorageClassArgs`
class for the constructor arguments.

Having the duplicate classes hasn't broken existing usage of the input
type because we "export" all the input types for a module _after_ all
the resources and resource args classes are exported, so the input type
just ends up "overwriting" the duplicate resource args class.

Other languages don't have this problem because the input type is either
in it's own module/namespace (e.g. Node.js and .NET) or a different name
is used for the input type (Go). But with Python, the input types and
resources are all available in the same module.

To address this for Python, when there is an input type in the same
module with the same name as the resource, the args class for the
resource will be emitted as `<Resource>InitArgs` instead of
`<Resource>Args`.
2021-06-10 10:41:49 -07:00
Paul Stack
3cf16b994d
Add RKE and SumoLogic to docs generation titles (#7108) 2021-05-21 18:48:25 +01:00
Christian Nunciato
3635dc28c3
Add a note to a README about regenerating test data (#6970) 2021-05-05 12:59:37 -07:00
Christian Nunciato
3b8a0dd3e3
Remove leading and trailing whitespace in resource properties (#6959)
* Remove leading and trailing whitespace in resource properties

* Make tests pass

* Add PULUMI_ACCEPT support to docs gen tests

* Handle a couple more places

Co-authored-by: Pat Gavlin <pat@pulumi.com>
2021-05-04 17:59:30 -07:00
stack72
fecbee5ca5 Ensuring Yandex is part of the docs title generations 2021-04-21 00:41:37 +01:00
Pat Gavlin
89595a3365
Do not wrap types in Input<> when generating docs. (#6812)
Just what it says on the tin. These changes also add more expansive
tests for documentation generation using our existing example schemas.

Fixes #6797.
2021-04-19 14:05:23 -07:00
Justin Van Patten
48a1d3f696
[docgen] Fix horizontal scroll in python resource docs (#6801)
Add line breaks and whitespace to avoid long horizontal scrolls for Python constructor/function arguments. Also, include the new ResourceArgs constructor overload.
2021-04-17 15:33:23 -07:00
Vivek Lakshmanan
c00dc5b4ca Rename gcp-native reference in docs 2021-04-16 09:06:11 -07:00
Pat Gavlin
1cc084dc0e
Fix inconsistent object type naming. (#6686)
See #6200 for a complete description of the issue. In short, we generate
inconsistent names for object types depending on whether or not they are
transitively reachable from resources or functions, which risks
unintentional breaking changes due to schema updates.

1. Name "input" types differently: `TArgs` for a type that is used in
   resource inputs, having `Input<T>` properties, and `T` for a type
   that is used in invoke inputs. The same schema type can produce both.

2. Always keep the name `T` for output types, avoid appending `Result` to
   the name.

3. As needed, introduce a flag in the existing providers' schemas to avoid
   breaking changes. Consider removing it on a major version bump.

Fixes #6200.
2021-04-15 19:03:28 -07:00
pulumi-bot
73a66f48ea [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
Vivek Lakshmanan
dc32980a51 Add new doc alias 2021-04-12 10:36:58 -07:00
Christian Nunciato
c20bdbe945
Update resource-docs templates to adjust for Hugo upgrade (#6524) 2021-03-14 07:24:55 -07:00
Mikhail Shilkov
d1bd1a6cef Add missing provider title lookup 2021-03-02 15:59:41 +01:00
Komal
f4f5aaf500
[codegen/docs] - More doc title fixes (#6357) 2021-02-17 09:08:19 -08:00
Komal
ae91a277df
[codegen/docs] - Standardize function and resource titles. (#6325) 2021-02-16 20:03:06 -08:00
Paul Stack
6479653f77
Fixing build of test TestResourceNestedPropertyPythonCasing inpkg/codegen (#6336) 2021-02-15 23:56:09 +00:00
Levi Blackstone
a1fc0d2095
[codegen/docs] Add environment variable info to Provider inputs (#6330)
The schema specifies supported environment variables
for Provider inputs, but these are not currently reflected
in the generated docs. This change adds any supported
environment variables to the input property comment
field on Provider resources.

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2021-02-12 17:11:56 -07:00
Christian Nunciato
e2b48d2f20
Fix up resource-docs links (#6279)
Co-authored-by: Praneet Loke <1466314+praneetloke@users.noreply.github.com>
2021-02-09 09:04:02 -08:00
Christian Nunciato
40ce511a2b
Remove language SDK blocks from resource templates (#6270) 2021-02-07 19:31:05 +00:00
Paul Stack
02b83f3203
Adding Splunk and Equinix Metal providers (#6007) 2020-12-23 23:27:09 +00:00
Komal
b0756cb703
Improve meta tags on documentation (#5968) 2020-12-17 10:44:57 -08:00
Komal
9b33dd84d5
[codegen/*] - Fix enum names that start with an underscore. (#5950) 2020-12-16 09:22:44 -08:00
Komal
791ccc58d4
[codegen/docs] - Remove primitive type links (#5911) 2020-12-14 19:56:45 -08:00
Komal
95c09d88c8
[codegen/docs] - Add enums to docs (#5912) 2020-12-14 14:40:14 -08:00
Komal
fed47e7334
[codegen/docs] - Fix html for property types (#5929) 2020-12-11 12:01:50 -08:00
Komal
cba68b0874
Fix union types in resource docs (#5909) 2020-12-09 18:18:34 -08:00
Komal
193b1f7d3b
Remove optional identifier before splitting type string. (#5907) 2020-12-09 12:20:11 -08:00
Komal
999c6fbd33
[codegen/docs] - Improve resource doc titles (#5894) 2020-12-08 15:04:36 -08:00
Levi Blackstone
948a9cc27d
[codegen/docs] Exclude eks package API links (#5843) 2020-12-01 12:03:08 -07:00
Komal
995d3b9b6c
Remove UsesIOClasses check. (#5827) 2020-11-24 19:15:37 -06:00
Mikhail Shilkov
6138ee1cc7
Populate package for doc args types (#5822) 2020-11-24 11:20:25 +01:00
Paul Stack
50725543a0
Ensure resource docs have a newline after description but before examples to render correctly (#5762) 2020-11-14 00:20:33 +00:00
Paul Stack
a6f8b9b205
Ensure we split the import away from the docs description (#5719) 2020-11-09 23:00:29 +00:00
stack72
f1b8bc79e2 Prevent panic when assembling the import details 2020-11-09 14:45:55 +00:00
Paul Stack
3d8068e355
adding the import documentation where specified (#5667) 2020-11-09 14:12:58 +00:00
Paul Stack
83f2aa613b
Adding the Venafi provider to the docs generation (#5620) 2020-10-23 20:25:37 +01:00
Paul Stack
5e8f219652
Reorder resource docs templates to make deprecated more prominent (#5523)
Fixes: https://github.com/pulumi/docs/issues/4340

The deprecated message sits below the examples so it is not clear
to the user that the resource / datasource is deprecated
2020-10-07 21:25:25 +01:00
Justin Van Patten
988ebd8b8e
[codegen/docs] Don't emit API links in Azure NextGen resource docs (#5421)
We're not going to generate language-specific API docs for the Azure NextGen provider, only resource docs. This change makes it so the resource docs do not emit any links to nonexistent API docs.
2020-09-20 11:56:52 -07:00
Komal
92a7d717a4
[codegen/schema] - Expand ObjectTypeSpec to ComplexTypeSpec (#5379)
Co-authored-by: Mikhail Shilkov <github@mikhail.io>
2020-09-16 13:47:40 -07:00
Mikhail Shilkov
573b95afaf
Add missing provider names for docs (#5374) 2020-09-16 11:28:34 +02:00
Praneet Loke
072aac2c79
[codegen/docs] Lower-case the module name for Go. (#5207) 2020-08-21 15:34:57 -07:00
Justin Van Patten
92c0d1dc30
Docgen changes for Python input/output types (#5137)
Resource doc changes for Python:

- Types are included in constructor/function args
- The property names for input/output types are now always snake_case, regardless of the generated mapping tables, to match the new input/output classes
- Some other minor tweaks to function/constructor signatures (e.g. removed the `__props__` arg, as it's not meant to be used directly; use `@staticmethod` for static `get` methods).
2020-08-19 08:34:06 -07:00