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 non-existent field error message by checking if the field fits into the parent object #559

Open
iwahbe opened this issue Mar 15, 2024 · 0 comments
Labels
area/expr Syntax, expressions, and functions in YAML kind/enhancement Improvements or new features

Comments

@iwahbe
Copy link
Member

iwahbe commented Mar 15, 2024

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

After responding to pulumi/pulumi-aws#3632, I thought that my response could (and should) be automated. YAML is all about nesting, and it's pretty common to accidentally mis-nest something. Our documentation doesn't always help there.

Consider this example:

  lambda_hello_world:
    type: aws:lambda:Function
    properties:
      code:
        s3Bucket: ${s3_bucket_lambda_code.bucket}
        s3Key: helloworld.zip
      code: Cannot assign '{s3Bucket: string, s3Key: string}' to 'archive'

Both s3Bucket and s3Key are valid fields in properties. We could provide a much more helpful error message here:

      code: Cannot assign '{s3Bucket: string, s3Key: string}' to 'archive'
        Consider moving 's3Bucket: ${s3_bucket_lambda_code.bucket}' up one level to 'properties'
        Consider moving 's3Key: helloworld.zip' up one level to 'properties'

Affected area/feature

This feature is restricted to Pulumi YAML's error reporting system.

@iwahbe iwahbe added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Mar 15, 2024
@Frassle Frassle added area/expr Syntax, expressions, and functions in YAML and removed needs-triage Needs attention from the triage team labels Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/expr Syntax, expressions, and functions in YAML kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

2 participants