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

Improve flattening #1631

Merged
merged 8 commits into from
Jul 8, 2021
Merged

Improve flattening #1631

merged 8 commits into from
Jul 8, 2021

Conversation

Porges
Copy link
Member

@Porges Porges commented Jul 7, 2021

  1. Flattening needed to visit arrays, maps, etc to match up inner types.
  2. Added a panic if we have missed flattening any properties marked flatten: true; improve reporting of panics during code generation process to include package/typename.
  3. If types are not modified then keep using the original type. This improves the typenames a bit (Improve generated typenames  #1591).
  4. When matching up spec/status types to augment specs with status, ignore any optionality when matching up types. This makes things work properly with the handcrafted schemas where often the required attribute has been forgotten.

@codecov-commenter
Copy link

codecov-commenter commented Jul 7, 2021

Codecov Report

Merging #1631 (6067348) into master (0338b8d) will increase coverage by 2.48%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1631      +/-   ##
==========================================
+ Coverage   62.17%   64.65%   +2.48%     
==========================================
  Files         163      203      +40     
  Lines       10739    12696    +1957     
==========================================
+ Hits         6677     8209    +1532     
- Misses       3422     3760     +338     
- Partials      640      727      +87     
Impacted Files Coverage Δ
hack/generated/controllers/generic_controller.go 70.45% <0.00%> (ø)
hack/generated/main.go 0.00% <ø> (ø)
hack/generated/pkg/armclient/raw_client.go 56.52% <ø> (-2.61%) ⬇️
hack/generated/pkg/armclient/types.go 78.02% <ø> (+4.15%) ⬆️
hack/generated/pkg/genruntime/base_types.go 96.55% <ø> (ø)
hack/generated/pkg/genruntime/errors.go 40.90% <ø> (-36.37%) ⬇️
hack/generated/pkg/genruntime/property_bag.go 80.00% <ø> (ø)
...ck/generated/pkg/genruntime/resolved_references.go 50.00% <ø> (ø)
...ack/generated/pkg/genruntime/resource_reference.go 78.57% <ø> (+28.57%) ⬆️
...ted/pkg/reconcilers/azure_deployment_reconciler.go 66.58% <ø> (+8.36%) ⬆️
... and 253 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e16e163...6067348. Read the comment docs.

@Porges Porges force-pushed the more-flattening branch from eeba3fa to fea1b47 Compare July 8, 2021 22:23
@Porges Porges merged commit 5df37e7 into master Jul 8, 2021
@Porges Porges deleted the more-flattening branch July 8, 2021 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants