-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Resolve # 683] Introducing the Diff Command (#1132)
Running `sceptre diff` generates a difference between: * The Stack config and template that is _currently deployed_ (if it is), and * The Stack config and template locally that _would_ be deployed, if deployment were triggered now. There are two different supported types of diff output: * deepdiff (which indicates only the added/removed/changed keys and values from both config and template) * difflib (which produces a more "traditional" diff output between the configs and templates)
- Loading branch information
1 parent
ca1407f
commit 9822736
Showing
22 changed files
with
2,642 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
sceptre.diffing package | ||
======================= | ||
|
||
.. automodule:: sceptre.diffing | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Submodules | ||
---------- | ||
|
||
sceptre.diffing.stack_differ module | ||
----------------------------------- | ||
|
||
.. automodule:: sceptre.diffing.stack_differ | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
sceptre.diffing.diff_writer module | ||
---------------------------------- | ||
|
||
.. automodule:: sceptre.diffing.diff_writer | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ Subpackages | |
|
||
sceptre.cli | ||
sceptre.config | ||
sceptre.diffing | ||
sceptre.hooks | ||
sceptre.plan | ||
sceptre.resolvers | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
Feature: Stack Diff | ||
Scenario Outline: Diff on stack that exists with no changes | ||
Given stack "1/A" exists in "CREATE_COMPLETE" state | ||
And the template for stack "1/A" is "valid_template.json" | ||
When the user diffs stack "1/A" with "<diff_type>" | ||
Then a diff is returned with no "template" difference | ||
And a diff is returned with no "config" difference | ||
And a diff is returned with "is_deployed" = "True" | ||
|
||
Examples: DiffTypes | ||
| diff_type | | ||
| deepdiff | | ||
| difflib | | ||
|
||
Scenario Outline: Diff on stack that doesnt exist | ||
Given stack "1/A" does not exist | ||
And the template for stack "1/A" is "valid_template.json" | ||
When the user diffs stack "1/A" with "<diff_type>" | ||
Then a diff is returned with "is_deployed" = "False" | ||
And a diff is returned with a "template" difference | ||
And a diff is returned with a "config" difference | ||
|
||
Examples: DiffTypes | ||
| diff_type | | ||
| deepdiff | | ||
| difflib | | ||
|
||
Scenario Outline: Diff on stack that exists in non-deployed state | ||
Given stack "1/A" exists in "<status>" state | ||
And the template for stack "1/A" is "valid_template.json" | ||
When the user diffs stack "1/A" with "<diff_type>" | ||
Then a diff is returned with a "template" difference | ||
And a diff is returned with a "config" difference | ||
And a diff is returned with "is_deployed" = "False" | ||
|
||
Examples: DeepDiff | ||
| diff_type | status | | ||
| deepdiff | CREATE_FAILED | | ||
| deepdiff | ROLLBACK_COMPLETE | | ||
| difflib | CREATE_FAILED | | ||
| difflib | ROLLBACK_COMPLETE | | ||
|
||
Scenario Outline: Diff on stack with only template changes | ||
Given stack "1/A" exists in "CREATE_COMPLETE" state | ||
And the template for stack "1/A" is "updated_template.json" | ||
When the user diffs stack "1/A" with "<diff_type>" | ||
Then a diff is returned with a "template" difference | ||
And a diff is returned with no "config" difference | ||
|
||
Examples: DiffTypes | ||
| diff_type | | ||
| deepdiff | | ||
| difflib | | ||
|
||
Scenario Outline: Diff on stack with only configuration changes | ||
Given stack "1/A" exists in "CREATE_COMPLETE" state | ||
And the template for stack "1/A" is "valid_template.json" | ||
And the stack config for stack "1/A" has changed | ||
When the user diffs stack "1/A" with "<diff_type>" | ||
Then a diff is returned with a "config" difference | ||
And a diff is returned with no "template" difference | ||
|
||
Examples: DiffTypes | ||
| diff_type | | ||
| deepdiff | | ||
| difflib | | ||
|
||
|
||
Scenario Outline: Diff on stack with both configuration and template changes | ||
Given stack "1/A" exists in "CREATE_COMPLETE" state | ||
And the template for stack "1/A" is "updated_template.json" | ||
And the stack config for stack "1/A" has changed | ||
When the user diffs stack "1/A" with "<diff_type>" | ||
Then a diff is returned with a "config" difference | ||
And a diff is returned with a "template" difference | ||
|
||
Examples: DiffTypes | ||
| diff_type | | ||
| deepdiff | | ||
| difflib | |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.