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

Update DiffCmd to take in states to diff. #112

Merged
merged 5 commits into from
Apr 9, 2023

Conversation

azriel91
Copy link
Owner

@azriel91 azriel91 commented Apr 9, 2023

Closes #101.

However, the output for diff-ing states from different profiles is not necessarily semantically meaningful.

Diff Output For Two Environments

Both not deployed

❯ ./envman diff demo_1 demo_2                                                                                                                                                                                                                 
# State Diffs

1. `app_download`    : resource does not exist on server, and `azriel91/web_app/0.1.1/web_app.tar` does not exist locally
2. `app_extract`     : files extracted and up to date
3. `iam_policy`      : does not exist as intended.
4. `iam_role`        : does not exist as intended.
5. `instance_profile`: does not exist as intended.
6. `s3_bucket`       : does not exist as intended.
7. `s3_object`       : does not exist as intended.

First not deployed, Second deployed

❯ ./envman diff demo_1 demo_2                                                                                                                                                                                                                 
# State Diffs

1. `app_download`    : `azriel91/web_app/0.1.1/web_app.tar` will change from 0 bytes to 6492160 bytes
2. `app_extract`     : extraction out of sync: 2 files added, 0 modified, 0 removed
3. `iam_policy`      : will be created.
4. `iam_role`        : will be created.
5. `instance_profile`: will be created.
6. `s3_bucket`       : will be created.
7. `s3_object`       : will be created.

First deployed, Second not deployed

❯ ./envman diff demo_2 demo_1                                                                                                                                                                                                                 
# State Diffs

1. `app_download`    : resource does not exist on server; locally `azriel91/web_app/0.1.1/web_app.tar` exists, but ensure will not delete it
2. `app_extract`     : extraction out of sync: 0 files added, 0 modified, 2 removed
3. `iam_policy`      : will be removed.
4. `iam_role`        : will be removed.
5. `instance_profile`: will be removed.
6. `s3_bucket`       : will be removed.
7. `s3_object`       : will be removed.

Both deployed

❯ ./envman diff demo_1 demo_2                                                                                                                                                                                                                 
# State Diffs

1. `app_download`    : `azriel91/web_app/0.1.1/web_app.tar` in sync with server
2. `app_extract`     : files extracted and up to date
3. `iam_policy`      : name changed from demo_1 to demo_2
4. `iam_role`        : name modified from demo_1 to demo_2. ⚠️ This modification requires deletion and recreation.
5. `instance_profile`: name changed from demo_1 to demo_2
6. `s3_bucket`       : name has changed from azriel-peace-envman-demo-1 to azriel-peace-envman-demo-2
7. `s3_object`       : bucket name has changed from azriel-peace-envman-demo-1 to azriel-peace-envman-demo-2

@codecov
Copy link

codecov bot commented Apr 9, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03 🎉

Comparison is base (bc10df0) 92.24% compared to head (90c2f1d) 92.27%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
+ Coverage   92.24%   92.27%   +0.03%     
==========================================
  Files         277      277              
  Lines       20663    20668       +5     
==========================================
+ Hits        19060    19071      +11     
+ Misses       1603     1597       -6     
Impacted Files Coverage Δ
crate/rt/src/cmds/diff_cmd.rs 100.00% <100.00%> (ø)
crate/rt_model/src/item_spec_wrapper.rs 84.72% <100.00%> (+2.04%) ⬆️
workspace_tests/src/item_specs/sh_cmd_item_spec.rs 96.27% <100.00%> (+0.04%) ⬆️
workspace_tests/src/item_specs/tar_x_item_spec.rs 99.50% <100.00%> (+0.01%) ⬆️
workspace_tests/src/rt/cmds/diff_cmd.rs 99.05% <100.00%> (+0.02%) ⬆️
workspace_tests/src/rt_model/item_spec_wrapper.rs 96.51% <100.00%> (ø)

... and 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@azriel91 azriel91 merged commit fa0b862 into main Apr 9, 2023
@azriel91 azriel91 deleted the feature/101/diff-cmd-takes-in-states-to-diff branch April 9, 2023 03:27
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.

DiffCmd should take in states to diff.
1 participant