-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly handle MaxItems: 1 for extractSchemaInputs #1812
Correctly handle MaxItems: 1 for extractSchemaInputs #1812
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1812 +/- ##
==========================================
- Coverage 60.60% 60.19% -0.42%
==========================================
Files 303 310 +7
Lines 42348 42771 +423
==========================================
+ Hits 25667 25745 +78
- Misses 15208 15554 +346
+ Partials 1473 1472 -1 ☔ View full report in Codecov by Sentry. |
8ffcc83
to
5e453f9
Compare
// To match previous behavior, we insert the default key for Map types. | ||
// | ||
// TODO: We should probably remove the extraneous defaultsKey here. | ||
v[defaultsKey] = resource.NewArrayProperty([]resource.PropertyValue{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this PR, we didn't clearly distinguish between Map and Object very well, so we inserted the defaults list in all cases. To avoid changing a bunch of existing tests, I'm leaving the old behavior as is for now.
Map's can't have field defaults, so I'm pretty sure that this is wrong. Fixing is a followup PR job.
Thanks for wrangling this, looking forward to the tests. Not the easiest code to work on. |
459d269
to
39d4dc9
Compare
39d4dc9
to
bc6f82a
Compare
ps = &SchemaInfo{} | ||
} | ||
|
||
for IsMaxItemsOne(tfs, ps) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fantastic to get quick fix out! IN the longer term maybe worth looking into abstracting out the traversal using path-based or some such methods, so the codebase deals with these idiosyncrasies in one place and gets it right once and for all.
d935eba
to
f8c2609
Compare
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@pulumi/cloudflare](https://pulumi.io) ([source](https://github.com/pulumi/pulumi-cloudflare)) | dependencies | minor | [`5.23.0` -> `5.24.1`](https://renovatebot.com/diffs/npm/@pulumi%2fcloudflare/5.23.0/5.24.1) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>pulumi/pulumi-cloudflare (@​pulumi/cloudflare)</summary> ### [`v5.24.1`](https://github.com/pulumi/pulumi-cloudflare/releases/tag/v5.24.1) [Compare Source](https://github.com/pulumi/pulumi-cloudflare/compare/v5.24.0...v5.24.1) #### Changelog - [`b2c32fe`](https://github.com/pulumi/pulumi-cloudflare/commit/b2c32fe7) Bump google.golang.org/protobuf in /examples/record/go - [`bcb25f7`](https://github.com/pulumi/pulumi-cloudflare/commit/bcb25f74) Combined dependencies PR ([#​691](https://github.com/pulumi/pulumi-cloudflare/issues/691)) - [`085504b`](https://github.com/pulumi/pulumi-cloudflare/commit/085504bf) Include [pulumi/pulumi-terraform-bridge#1812](https://github.com/pulumi/pulumi-terraform-bridge/issues/1812) ([#​708](https://github.com/pulumi/pulumi-cloudflare/issues/708)) - [`06772bf`](https://github.com/pulumi/pulumi-cloudflare/commit/06772bf8) Merge remote-tracking branch 'origin/dependabot/go_modules/examples/record/go/google.golang.org/protobuf-1.33.0' into combined-pr-branch - [`b3b3a65`](https://github.com/pulumi/pulumi-cloudflare/commit/b3b3a658) Upgrade pulumi-terraform-bridge to v3.79.0 ([#​702](https://github.com/pulumi/pulumi-cloudflare/issues/702)) ### [`v5.24.0`](https://github.com/pulumi/pulumi-cloudflare/releases/tag/v5.24.0) [Compare Source](https://github.com/pulumi/pulumi-cloudflare/compare/v5.23.0...v5.24.0) #### Changelog - [`5c0da33`](https://github.com/pulumi/pulumi-cloudflare/commit/5c0da335) Mark `cloudflare:Record` as `DeleteBeforeReplace: true` ([#​693](https://github.com/pulumi/pulumi-cloudflare/issues/693)) - [`19bc5a0`](https://github.com/pulumi/pulumi-cloudflare/commit/19bc5a0d) Remove unused field mappings ([#​695](https://github.com/pulumi/pulumi-cloudflare/issues/695)) - [`4748d37`](https://github.com/pulumi/pulumi-cloudflare/commit/4748d37e) Update GitHub Actions workflows. ([#​698](https://github.com/pulumi/pulumi-cloudflare/issues/698)) - [`1b5e3ce`](https://github.com/pulumi/pulumi-cloudflare/commit/1b5e3ce3) Upgrade terraform-provider-cloudflare to v4.28.0 ([#​697](https://github.com/pulumi/pulumi-cloudflare/issues/697)) - [`64ff681`](https://github.com/pulumi/pulumi-cloudflare/commit/64ff681a) falseUpdate GitHub Actions workflows. ([#​694](https://github.com/pulumi/pulumi-cloudflare/issues/694)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNzMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI3OS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
Fixes pulumi/pulumi-cloudflare#554
This corrects MaxItems: 1 handling for
extractSchemaInputs
. As part of that, I have separated the handling ofmap<string,elem>
andobject
types to their own function. This vastly simplifies the code.Tests are incoming shortly.