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

feat(diff): Better diff of random objects #1488

Merged
merged 4 commits into from
Jan 7, 2019

Conversation

RomainMuller
Copy link
Contributor

@RomainMuller RomainMuller commented Jan 7, 2019

Use a unified diff format to render differences in arbitrary values,
making it easier to understand what is changing in possibly large JSON
structures, for example.

The number of context lines used when rendering the JSON differences
can be customized using the --context-lines option of cdk diff,
which has a default value of 3.


Pull Request Checklist

  • Testing
    • Unit test added
    • CLI change?: manually run integration tests and paste output as a PR comment
    • cdk-init template change?: coordinated update of integration tests with team
  • Docs
    • jsdocs: All public APIs documented
    • README: README and/or documentation topic updated
  • Title and Description
    • Change type: title prefixed with fix, feat will appear in changelog
    • Title: use lower-case and doesn't end with a period
    • Breaking?: last paragraph: "BREAKING CHANGE: <describe what changed + link for details>"
    • Issues: Indicate issues fixed via: "Fixes #xxx" or "Closes #xxx"
  • Sensitive Modules (requires 2 PR approvers)
    • IAM Policy Document (in @aws-cdk/aws-iam)
    • EC2 Security Groups and ACLs (in @aws-cdk/aws-ec2)
    • Grant APIs (only if not based on official documentation with a reference)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.

@RomainMuller RomainMuller requested a review from a team as a code owner January 7, 2019 13:43
Use a unified diff format to render differences in arbitrary values,
making it easier to understand what is changing in possibly large JSON
structures, for example.
@eladb
Copy link
Contributor

eladb commented Jan 7, 2019

Can you upload a screen shot?

@RomainMuller
Copy link
Contributor Author

RomainMuller commented Jan 7, 2019

Screenshot using the default context of 5 lines (can be customized all the way down to zero!)

capture d ecran 2019-01-07 a 14 46 35

Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

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

Please make sure to run toolkit integ tests

packages/@aws-cdk/cloudformation-diff/lib/format.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/cloudformation-diff/lib/format.ts Outdated Show resolved Hide resolved
packages/aws-cdk/bin/cdk.ts Outdated Show resolved Hide resolved
@RomainMuller
Copy link
Contributor Author

Integration tests were successful!

@rix0rrr
Copy link
Contributor

rix0rrr commented Jan 7, 2019

Can we reduce the default context some? I'd prefer something like 3. The diff takes up a lot of vertical space this way.

@RomainMuller
Copy link
Contributor Author

@rix0rrr - yeah that'll match the defaults of most diff command implementations, so I'm cool with that.

@RomainMuller RomainMuller merged commit 607f997 into master Jan 7, 2019
@RomainMuller RomainMuller deleted the rmuller/diff-render-patch branch January 7, 2019 14:34
@NGL321 NGL321 added the contribution/core This is a PR that came from AWS. label Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants