-
Notifications
You must be signed in to change notification settings - Fork 613
Convert conditions to SymPy #2624
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
Merged
kddejong
merged 11 commits into
aws-cloudformation:main
from
kddejong:fix/conditions/v2
Mar 22, 2023
Merged
Convert conditions to SymPy #2624
kddejong
merged 11 commits into
aws-cloudformation:main
from
kddejong:fix/conditions/v2
Mar 22, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
609a5a8
to
0af7afd
Compare
f9e895d
to
90c1ef0
Compare
ericzbeard
approved these changes
Mar 14, 2023
6ee9a20
to
6ed5991
Compare
This will cause issues for installation on Alpine |
6ed5991
to
f46ecf1
Compare
f46ecf1
to
8784739
Compare
8784739
to
4aa9d99
Compare
archlinux-github
pushed a commit
to archlinux/svntogit-community
that referenced
this pull request
Apr 21, 2023
…tream [1][2] Also switches from pytest to unittest due to test conflicts (caused by [3]). Meanwhile, switches to git as a test requires git, and unittest does not provide a convenient way to ignore a specific test. [1] aws-cloudformation/cfn-lint#2624 [2] aws-cloudformation/cfn-lint#2643 [3] aws-cloudformation/cfn-lint#2646 git-svn-id: file:///srv/repos/svn-community/svn@1448141 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github
pushed a commit
to archlinux/svntogit-community
that referenced
this pull request
Apr 21, 2023
…tream [1][2] Also switches from pytest to unittest due to test conflicts (caused by [3]). Meanwhile, switches to git as a test requires git, and unittest does not provide a convenient way to ignore a specific test. [1] aws-cloudformation/cfn-lint#2624 [2] aws-cloudformation/cfn-lint#2643 [3] aws-cloudformation/cfn-lint#2646 git-svn-id: file:///srv/repos/svn-community/svn@1448141 9fca08f4-af9d-4005-b8df-a31f2cc04f65
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Currently resolving conditions is bottom up. Meaning if we are determining the relationship of two conditions we look at equals and how they overlap. We then create a slew of scenarios based on the different equal scenarios. The more equals the more scenarios, the more unrelated equals the more scenarios. If you have 6 equals in a set of 2 conditions that are unrelated you have 2^6 = 64 scenarios. In the end from all those scenarios you really only have 4 max possibilities.
This new approach works the other way. It uses SymPy to validate if the 4 scenarios are satisfied. To relate equals that have 1 similar parameter (but not 2) we use
Not(And(...))
which will not allow each equals to beTrue
at the same time.Possible remaining issues:
True
/False
. Sometimes a person will codify!Equals ["True", "True"]
AllowedValues: ["prod", "dev"]
which means conditionIsProduction
andIsDevelopment
can never both beFalse
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.