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

chore: better type checking error messages #1997

Merged
merged 4 commits into from
May 22, 2024

Conversation

corymhall
Copy link
Contributor

This is what the error message looks like

  aws:ecs:Service (service):
    warning: Type checking failed:
      Unexpected type at field networkConfiguration.subnets:
        expected array type, got string type
    warning: Type checking is still experimental. If you believe that a warning is incorrect,
    please let us know by creating an issue at https://github.com/pulumi/pulumi-terraform-bridge/issues.
    This will become a hard error in the future.

fixes #1986

This is what the error message looks like

```console
  aws:ecs:Service (service):
    warning: Type checking failed:
      Unexpected type at field networkConfiguration.subnets:
        expected array type, got string type
    warning: Type checking is still experimental. If you believe that a warning is incorrect,
    please let us know by creating an issue at https://github.com/pulumi/pulumi-terraform-bridge/issues.
    This will become a hard error in the future.
```

fixes #1986
@corymhall corymhall requested a review from iwahbe May 20, 2024 15:26
Copy link

codecov bot commented May 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.90%. Comparing base (81c1dfb) to head (22607e4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1997      +/-   ##
==========================================
+ Coverage   60.87%   60.90%   +0.03%     
==========================================
  Files         332      332              
  Lines       44756    44761       +5     
==========================================
+ Hits        27243    27260      +17     
+ Misses      15990    15978      -12     
  Partials     1523     1523              

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

@corymhall corymhall self-assigned this May 20, 2024
Copy link
Member

@iwahbe iwahbe left a comment

Choose a reason for hiding this comment

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

Let's make sure we have a test for this. That way we can see (in repo) what the error message looks like.

pkg/tfbridge/provider.go Outdated Show resolved Hide resolved
corymhall and others added 2 commits May 21, 2024 10:12
Co-authored-by: Ian Wahbe <ian@wahbe.com>

// run 'go test -run=TestCheckWarnings -v ./pkg/tfbridge/ -update' to update
autogold.Expect(`warning: Type checking failed:
warning: Unexpected type at field "networkConfiguration":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Each time you call logger.Warn() it prints out warning: . Personally I don't mind this.

@corymhall corymhall requested a review from iwahbe May 21, 2024 18:19
Copy link
Member

@iwahbe iwahbe left a comment

Choose a reason for hiding this comment

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

LGTM!

Thanks for getting this in.

@corymhall corymhall merged commit eeb785e into master May 22, 2024
11 checks passed
@corymhall corymhall deleted the corymhall/better-error-message branch May 22, 2024 13:22
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.

Improve type-checker errors
2 participants