Skip to content

Commit

Permalink
Generate shorter names for properties
Browse files Browse the repository at this point in the history
- Most of the `schemaNestedTypes` code was just moved from
  `generate_schema.go`
- The new code is the code related to `nestedTypeGraph`

I picked an arbitrary max character limit of 120, but those still look
pretty long. I checked in `pulumi-aws` and there are still a lot of
types that are up to and over 120.

I currently just pick the shorter name if the normal name would be +120,
but I feel like it would be better to introduce a new schema property to
enable this at the resource level.

TODO:
 - I need to add some more tests to ensure this is deterministic, but I
   am not yet sure it is possible to make it completely deterministic
   without tracking state (maybe by reading in the existing schema.json)

re #1118
  • Loading branch information
corymhall committed Aug 8, 2024
1 parent f18ff2f commit a931b2c
Show file tree
Hide file tree
Showing 9 changed files with 2,547 additions and 153 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.21.12
replace github.com/pulumi/pulumi-terraform-bridge/x/muxer => ./x/muxer

require (
github.com/YakDriver/regexache v0.24.0
github.com/apparentlymart/go-cidr v1.1.0
github.com/blang/semver v3.5.1+incompatible
github.com/davecgh/go-spew v1.1.1
Expand Down Expand Up @@ -129,7 +130,7 @@ require (
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
github.com/agext/levenshtein v1.2.3
github.com/armon/go-radix v1.0.0 // indirect
github.com/aws/aws-sdk-go v1.50.36 // indirect
github.com/aws/aws-sdk-go v1.50.36
github.com/aws/aws-sdk-go-v2 v1.26.1 // indirect
github.com/aws/aws-sdk-go-v2/config v1.27.11 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.11 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,8 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
github.com/ProtonMail/go-crypto v1.1.0-alpha.0 h1:nHGfwXmFvJrSR9xu8qL7BkO4DqTHXE9N5vPhgY2I+j0=
github.com/ProtonMail/go-crypto v1.1.0-alpha.0/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE=
github.com/YakDriver/regexache v0.24.0 h1:zUKaixelkswzdqsqPc2sveiV//Mi/msJn0teG8zBDiA=
github.com/YakDriver/regexache v0.24.0/go.mod h1:awcd8uBj614F3ScW06JqlfSGqq2/7vdJHy+RiKzVC+g=
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA=
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
Expand Down
Loading

0 comments on commit a931b2c

Please sign in to comment.