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

[Resolve #1443] Add parameter type checking #1442

Merged
merged 11 commits into from
Feb 27, 2024

Conversation

alex-harvey-z3q
Copy link
Contributor

@alex-harvey-z3q alex-harvey-z3q commented Feb 17, 2024

For historical reasons, Sceptre has never validated Stack config parameters that are passed in to CloudFormation stack parameters. Blocks that contain bools, ints etc give rise to confusing failures. For example:

parameters:
  someBool: true

Would lead to an error appearing like:

"Parameter validation failed:\nInvalid type for parameter Parameters[0].ParameterValue, value: 1, type: <class 'bool'>, valid types: <class 'str'>"  

In more complicated examples it is often quite unclear what Parameter[0] means.

A feature here is added at the time of Stack instantiation to perform validation of the input stack parameters in a similar manner to how the ignore and obsolete settings were already being checked.

PR Checklist

  • Wrote a good commit message & description [see guide below].
  • Commit message starts with [Resolve #issue-number].
  • Added/Updated unit tests.
  • Added/Updated integration tests (if applicable).
  • All unit tests (poetry run tox) are passing.
  • Used the same coding conventions as the rest of the project.
  • The new code passes pre-commit validations (poetry run pre-commit run --all-files).
  • The PR relates to only one subject with a clear title.
    and description in grammatically correct, complete sentences.

Approver/Reviewer Checklist

  • Before merge squash related commits.

Other Information

Guide to writing a good commit

@alex-harvey-z3q alex-harvey-z3q changed the title Add a proof of concept for type checking [Resolve #1443] Add parameter type checking Feb 17, 2024
tests/test_stack.py Outdated Show resolved Hide resolved
tests/test_stack.py Outdated Show resolved Hide resolved
@zaro0508 zaro0508 merged commit f3b7e51 into Sceptre:master Feb 27, 2024
12 checks passed
alex-harvey-z3q added a commit to alex-harvey-z3q/sceptre that referenced this pull request Jun 2, 2024
alex-harvey-z3q added a commit to alex-harvey-z3q/sceptre that referenced this pull request Jun 2, 2024
@alex-harvey-z3q alex-harvey-z3q deleted the ah/ensure-params-poc branch August 28, 2024 18: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.

2 participants