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 pf/internal/convert module #1779

Merged
merged 3 commits into from
Mar 22, 2024
Merged

Conversation

t0yv0
Copy link
Member

@t0yv0 t0yv0 commented Mar 21, 2024

Improve pf/internal/convert module

  • add NewObjectEncoder and NewObjectDecoder to make it easier to use without a full-blown Encoding
  • add InferObjectType to help with testing by computing plausible tftypes.Object instances
  • unexport LocalPropertyNames, TerraformPropertyName etc
  • add test coverage
  • rename propertyValue.go to property_value.go for consistency
  • remove unused code

On top of t0yv0/simplify-diff

The slight simplification of the code relaxes some dependencies on the convert module which in turn unlocks simplifying
that module.
- add InferObjectType to help with testing by computing plausible tftypes.Object instances
- add test coverage
- rename packagespec.go to package_spec.go
@t0yv0 t0yv0 marked this pull request as ready for review March 21, 2024 21:51
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

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

Project coverage is 60.03%. Comparing base (c5f6262) to head (04d9db2).
Report is 1 commits behind head on master.

Files Patch % Lines
pf/internal/convert/convert.go 58.62% 8 Missing and 4 partials ⚠️
pf/internal/convert/infer_object.go 80.64% 12 Missing ⚠️
pf/tfbridge/provider_diff.go 56.52% 10 Missing ⚠️
pf/internal/convert/encoding.go 94.87% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1779      +/-   ##
==========================================
+ Coverage   59.98%   60.03%   +0.05%     
==========================================
  Files         302      309       +7     
  Lines       42180    42591     +411     
==========================================
+ Hits        25300    25571     +271     
- Misses      15452    15549      +97     
- Partials     1428     1471      +43     

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

Base automatically changed from t0yv0/simplify-diff to master March 22, 2024 11:37
@t0yv0 t0yv0 merged commit e95ed2d into master Mar 22, 2024
9 checks passed
@t0yv0 t0yv0 deleted the t0yv0/improve-convert-module branch March 22, 2024 11:37
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.

None yet

2 participants