-
Notifications
You must be signed in to change notification settings - Fork 2.8k
cli(metadata): add diff command and dry-run flag #3157
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
Conversation
|
Beep boop! 🤖 Hey @jeffsieu, thanks for your PR! One of my human friends will review this PR and get back to you as soon as possible. Stay awesome! 😎 |
|
Deploy preview for hasura-docs ready! Built with commit dbcd60e |
…o metadata-diff
|
@shahidhk I'm not too sure why the CI for |
|
Review app for commit 8f89f9b deployed to Heroku: https://hge-ci-pull-3157.herokuapp.com |
|
Oh, it was because I accidentally updated the Gopkg files to download dependencies of different versions... |
|
Thanks @jeffsieu! I'll get back on the review today. |
|
Review app for commit a980da7 deployed to Heroku: https://hge-ci-pull-3157.herokuapp.com |
|
Review app for commit e073c53 deployed to Heroku: https://hge-ci-pull-3157.herokuapp.com |
|
@shahidhk Any updates? Or things I need to change for this PR? |
|
All good @jeffsieu, I am just making some modifications from my end :) Thanks |
|
@shahidhk Alright, cheers! |
|
Review app for commit 118bee3 deployed to Heroku: https://hge-ci-pull-3157.herokuapp.com |
|
Review app for commit dbcd60e deployed to Heroku: https://hge-ci-pull-3157.herokuapp.com |
|
Beep boop! 🤖 Awesome work @jeffsieu! All of us at Hasura ❤️ what you did. Thanks again 🤗 |
|
Review app https://hge-ci-pull-3157.herokuapp.com is deleted |
### Description Adds a `metadata diff` command to show comparisons between two different sets of Hasura metadata. ``` # Show changes between server metadata and the exported metadata file: hasura metadata diff # Show changes between server metadata and that in local_metadata.yaml: hasura metadata diff local_metadata.yaml # Show changes between metadata from metadata.yaml and metadata_old.yaml: hasura metadata diff metadata.yaml metadata_old.yaml ``` Also adds a `--dry-run` flag to `metadata apply` command which will print the diff and exit rather than actually applying the metadata. ### Affected components - CLI - Docs ### Related Issues Close hasura#3126, Close hasura#3127 ### Solution and Design - Added `metadata_diff.go` and `metadata_diff_test.go` ### Steps to test and verify ``` hasura metadata export # Make changes to migrations/metadata.yaml hasura metadata diff ``` ### Limitations, known bugs & workarounds This is just a general-purpose diff. A more contextual diff with the understanding of metadata can be added once hasura#3072 is merged.
Description
Adds a
metadata diffcommand to show comparisons between two different sets of Hasura metadata.Also adds a
--dry-runflag tometadata applycommand which will print the diff and exit rather than actually applying the metadata.Affected components
Related Issues
#3126
Solution and Design
metadata_diff.goandmetadata_diff_test.goSteps to test and verify
Limitations, known bugs & workarounds
This is just a general-purpose diff.
A more contextual diff with the understanding of metadata can be added once #3072 is merged.