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(rust): Add JSON output support for vault list and vault show #6184

Conversation

solidiquis
Copy link
Contributor

@solidiquis solidiquis commented Sep 29, 2023

Current behavior

--output json is currently unsupported for vault list and vault show

Proposed changes

This PR adds support for --output json for vault list and vault show by deriving Serialize for VaultStateto produce and write JSON strings in relevant areas.

Updated implementations/rust/ockam/ockam_command/tests/bats/vault.bats as well to test for partial equivalence with JSON output since the JSON output takes precedence over the plain variant when stdout isn't a tty.

Screenshots:

Screen Shot 2023-09-29 at 11 36 40 AM Screen Shot 2023-09-29 at 11 35 25 AM Screen Shot 2023-09-29 at 11 35 53 AM

Checks

  • All commits in this Pull Request are signed and Verified by Github.
  • All commits in this Pull Request follow the Ockam commit message convention.
  • There are no Merge commits in this Pull Request. The Ockam repo maintains a linear commit history so we merge PRs by rebasing them to the develop branch. Rebasing to the latest develop branch and force pushing to your PR branch is okay.
  • I accept the Ockam Community Code of Conduct.
  • I have accepted the Ockam Contributor License Agreement by adding my Git/Github details in a row at the end of the CONTRIBUTORS.csv file in a separate pull request to the build-trust/ockam repository. The easiest way to do this is to edit the CONTRIBUTORS.csv file in the github web UI and create a PR, this will mark the commit as verified.

@solidiquis solidiquis requested a review from a team as a code owner September 29, 2023 18:55
@solidiquis
Copy link
Contributor Author

solidiquis commented Sep 29, 2023

Will address failing tests/lints shortly :)

edit: Resolved

@solidiquis solidiquis force-pushed the solidiquis/json-support-vault-list branch 3 times, most recently from ae74de8 to 0d676c0 Compare October 1, 2023 18:35
Copy link
Member

@adrianbenavides adrianbenavides left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @solidiquis for fixing these issues! I've added a couple of comments to keep the tests' checks as they were before.

@solidiquis solidiquis force-pushed the solidiquis/json-support-vault-list branch from 0d676c0 to 7c42d2f Compare October 2, 2023 15:06
@solidiquis
Copy link
Contributor Author

Thanks again @adrianbenavides for the assist! Just updated the test. Will be more diligent with that next time around.

@solidiquis solidiquis force-pushed the solidiquis/json-support-vault-list branch from 7c42d2f to cc039ec Compare October 2, 2023 19:24
@mrinalwadhwa mrinalwadhwa added the hacktoberfest Apply to issues you want contributors to help with label Oct 2, 2023
@solidiquis solidiquis force-pushed the solidiquis/json-support-vault-list branch 2 times, most recently from 813aabe to c1f3b8e Compare October 2, 2023 23:08
@adrianbenavides adrianbenavides force-pushed the solidiquis/json-support-vault-list branch from c1f3b8e to 9d347c8 Compare October 3, 2023 10:07
@adrianbenavides adrianbenavides added the HACKTOBERFEST-ACCEPTED To be used when a PR is ready to merge or after it's merged label Oct 3, 2023
@adrianbenavides adrianbenavides force-pushed the solidiquis/json-support-vault-list branch from 9d347c8 to 4a48c6b Compare October 3, 2023 11:44
@adrianbenavides adrianbenavides force-pushed the solidiquis/json-support-vault-list branch from 4a48c6b to 7962d61 Compare October 3, 2023 11:48
@adrianbenavides adrianbenavides self-requested a review October 3, 2023 11:54
Copy link
Member

@adrianbenavides adrianbenavides left a comment

Choose a reason for hiding this comment

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

Thanks @solidiquis for your contribution 🙏
It will get merged ASAP 🚀

@adrianbenavides adrianbenavides added this pull request to the merge queue Oct 3, 2023
Merged via the queue into build-trust:develop with commit a6d2f80 Oct 3, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Apply to issues you want contributors to help with HACKTOBERFEST-ACCEPTED To be used when a PR is ready to merge or after it's merged
Projects
None yet
3 participants