Skip to content
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

Send unchanged write-only properties as adds on update #1395

Merged
merged 3 commits into from
Mar 8, 2024

Conversation

danielrbradley
Copy link
Member

@danielrbradley danielrbradley commented Mar 7, 2024

Write-only properties can't even be read internally within the CloudControl service so they must be included in PATCH requests to ensure the updated model validates.

  • Refactor where we unmarshal inputs to avoid duplicate work.

Fixes #906

Might also fix #1243 but there's no code to reproduce the issue.

Write-only properties can't even be read internally within the CloudControl service so they must be included in PATCH requests to ensure the updated model validates.
- Refactor where we unmarshal inputs to avoid duplicate work.
@danielrbradley danielrbradley self-assigned this Mar 7, 2024
@danielrbradley danielrbradley added the impact/no-changelog-required This issue doesn't require a CHANGELOG update label Mar 7, 2024
Copy link
Contributor

github-actions bot commented Mar 7, 2024

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 35.71429% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 23.39%. Comparing base (b46b6fb) to head (c8bf924).

Files Patch % Lines
provider/pkg/provider/provider.go 35.71% 17 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1395      +/-   ##
==========================================
- Coverage   23.40%   23.39%   -0.01%     
==========================================
  Files          25       25              
  Lines        4230     4236       +6     
==========================================
+ Hits          990      991       +1     
- Misses       3077     3082       +5     
  Partials      163      163              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danielrbradley danielrbradley requested review from thomas11, mjeffryes and a team March 7, 2024 16:43
newInputs, err := plugin.UnmarshalProperties(req.GetNews(), plugin.MarshalOptions{
Label: fmt.Sprintf("%s.properties", label),
KeepUnknowns: true,
RejectAssets: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never use assets for lambda code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not currently - Asset support is still a WIP PR which will change these settings everywhere.

},
})

integration.ProgramTest(t, &test)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need some more asserts? Or it used to panic or some such before the change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update was a hard failure before this change.

@t0yv0
Copy link
Member

t0yv0 commented Mar 7, 2024

A bit too much indirection and lack of familiarity for me to review this properly but I tried and added a few comments.

@danielrbradley danielrbradley merged commit 7eefe7d into master Mar 8, 2024
17 checks passed
@danielrbradley danielrbradley deleted the fix-updates-with-write-only-sames branch March 8, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/no-changelog-required This issue doesn't require a CHANGELOG update
Projects
None yet
3 participants