-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Re-apply Portal Dashboard: Treat Part's Metadata as untyped JSON #3566
Conversation
Does the PR have any schema changes?Found 10 breaking changes: Types
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3566 +/- ##
==========================================
+ Coverage 57.77% 58.39% +0.62%
==========================================
Files 66 67 +1
Lines 8294 8418 +124
==========================================
+ Hits 4792 4916 +124
+ Misses 3055 3054 -1
- Partials 447 448 +1 ☔ View full report in Codecov by Sentry. |
3161932
to
0e45e16
Compare
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.
To discuss further:
- How do we make this less fragile if upstream changes again in the future?
- How do we know if the dashboard is actually usable and not just deployable (as these seem to be different)?
- Is this in scope to fully manage the implementation of the types as custom code or should we just ensure any value can be passed in.
a6b42c6
to
e1f6efd
Compare
e1f6efd
to
7843308
Compare
I think our long-term answer to the questions above is in #3571 Therefore, I removed the extra checks from this PR and brought it back to as pure revert as possible to minimize the probability of breaking something and the diff versus #3571 @mjeffryes @thomas11 please take a look |
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.
Given the commit history, I found it difficult to verify this as a simple revert + rename, but approving the merge on that basis to get back to a non-broken state for the customer.
Comments are notes of things to make sure we improve with #3571 or whatever PR we land for a long term solution.
// SchemaTypeOverrides returns the map of custom resource schema overrides per resource token. | ||
func SchemaTypeOverrides() map[string]schema.ComplexTypeSpec { |
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.
Why is it SchemaTypeOverrides
here, but TypeOverrides
on the struct?
@@ -550,12 +550,24 @@ func genMixins(pkg *pschema.PackageSpec, metadata *resources.AzureAPIMetadata) e | |||
} | |||
pkg.Types[tok] = t | |||
} | |||
for tok, t := range customresources.SchemaTypeOverrides() { |
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.
This should probably be checking that the type being overridden exists?
} | ||
metadata.Types[tok] = r | ||
} | ||
for tok, r := range customresources.MetaTypeOverrides() { |
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.
This should probably be checking that the type being overridden exists?
@@ -38,6 +38,11 @@ type CustomResource struct { | |||
// Resource metadata. Defines the parameters and properties that are used for diff calculation and validation. | |||
// Optional, by default the metadata is assumed to be derived from Azure Open API specs. | |||
Meta *AzureAPIResource | |||
// MetaTypes are net-new auxiliary metadata types defined for this resource. Optional. |
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.
AZ-Native n00b question probably, but what are "auxiliary metadata types"?
} | ||
for tok, r := range customresources.MetaTypeOverrides() { | ||
metadata.Types[tok] = r | ||
} |
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.
Nit. It's strange to me that these overrides and mixins are splatted into the package here with so little context. Why are do we do overrides after mixins? Why are are the functions above and the workspaceSqlAadAdmin description added in a totally different way?
types := map[string]schema.ComplexTypeSpec{} | ||
for _, r := range featureLookup { | ||
for n, v := range r.TypeOverrides { | ||
types[n] = v |
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.
no check for collisions between CustomResource
instances?
This PR has been shipped in release v2.62.0. |
Re-applies #3123 after it's been reverted in #3500
The only functional change compared to the original PR is a rename of
DashboardPartsResponsePosition
toDashboardPartsPositionResponse
. Upstream have probably shuffled type definitions in some way that makes us choose a different name.As discussed after the initial review, I've also added two things to help avoid confusion in the future:
Fix #3562
Fix #1412
Fix #747
Fix https://github.com/pulumi/customer-support/issues/1737 (I imported the created dashboard and received the settings of dashboard parts. No automated test for that.)