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

Show warning when unknown stack-args properties are added #152

Merged
merged 5 commits into from
Nov 20, 2018

Conversation

jpb
Copy link
Contributor

@jpb jpb commented Nov 20, 2018

Example output:

warn Invalid property 'ServiceRoleArn' in a.yaml. Did you mean 'ServiceRoleARN'?
warn Invalid property 'foo' in a.yaml

Fixes #131

@jpb jpb requested a review from tavisrudd November 20, 2018 00:42
'Template',
'TimeoutInMinutes',
'UsePreviousTemplate',
];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any thoughts about how to ensure we keep this in sync?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The type (Array<keyof StackArgs>) should help – I wasn't able to find another instance of this list to pull it from (the StackArgs is only a type and so the keys can't be pulled off of it).

src/cfn/index.ts Outdated
'UsePreviousTemplate',
];

const stackArgsMetaProperties = ['$imports', '$defs'];
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about $merge if someone were to use that at the top level?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about that and I agree that it should be supported – I debated moving the warnings check until after transform is called, but mistyping something like AssumeRoleARN or Profile could result in fetching imports to fail and it would not be obvious that the parameter name is the culprit.

I think that even though it is less helpful, it probably makes more sense to move it until after transform.

@tavisrudd
Copy link
Collaborator

tavisrudd commented Nov 20, 2018 via email

@jpb
Copy link
Contributor Author

jpb commented Nov 20, 2018

I ended up using

const extendedCfnDocKeys = ['$imports', '$defs', '$params', '$location', '$envValues'];
which works well working on the data post transform.

@tavisrudd
Copy link
Collaborator

Looks good. Merge away. Let's rebase #150 (and its dependent PRs) after.

@tavisrudd
Copy link
Collaborator

Good to go after rebased and conflicts resolved.

@jpb jpb force-pushed the argsfile-warnings branch from d60c02b to 4618aa6 Compare November 20, 2018 21:55
@jpb jpb merged commit 19f6999 into master Nov 20, 2018
@jpb jpb deleted the argsfile-warnings branch November 20, 2018 21:59
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.

2 participants