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

[cherrypick][keytool] use a table format output and add json output support #13374

Merged
merged 2 commits into from
Aug 12, 2023

Conversation

amnn
Copy link
Member

@amnn amnn commented Aug 11, 2023

Description

Original PR: #13196

Revamp the keytool CLI command to pretty print output as formatted tables and add support for json output. This is the first experimental step to gain feedback before moving to other CLI commands.

The PR also removes seven commands that should not be part of the CLI and were OK'ed by @siomari and @ammn to be removed:

  • Base64PubKeyToAddress
  • BytesToBase64
  • Base64ToBytes
  • Base64ToHex
  • BytesToHex
  • HexToBase64
  • HexToBytes

Test Plan

Executed the existing tests.


If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.

Type of Change (Check all that apply)

  • protocol change
  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

This PR modifies the CLI keytool as follows:

  • Adds support for json output. Use the --json flag when invoking any keytool command (such as keytool list --json).
  • Changes the default output to the terminal to formatted tables with headers to improve consistency across different commands. Use --json if you need to parse/pipe output data.
  • Removes the following seven commands, which you can replace by calls to the base64 and xxd utilities:
Base64PubKeyToAddress
BytesToBase64
Base64ToBytes
Base64ToHex -> input | base64 -d | xxd -p
BytesToHex
HexToBase64 -> input | xxd -r -p | base64
HexToBytes

…upport (#13196)

Revamp the keytool CLI command to pretty print output as formatted
tables and add support for json output. This is the first experimental
step to gain feedback before moving to other CLI commands.

The PR also removes seven commands that should not be part of the CLI
and were OK'ed by @siomari and @ammn to be removed:
* Base64PubKeyToAddress
* BytesToBase64
* Base64ToBytes
* Base64ToHex
* BytesToHex
* HexToBase64
* HexToBytes

Executed the existing tests.

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

- [ ] protocol change
- [x] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

This PR modifies the `CLI keytool` as follows:
* Adds support for `json` output. Use the `--json` flag when invoking
any `keytool` command (such as `keytool list --json`).
* Changes the default output to the terminal to formatted tables with
headers to improve consistency across different commands. Use `--json`
if you need to parse/pipe output data.
* Removes the following seven commands, which you can replace by calls
to the `base64` and `xxd` utilities:
```
Base64PubKeyToAddress
BytesToBase64
Base64ToBytes
Base64ToHex -> input | base64 -d | xxd -p
BytesToHex
HexToBase64 -> input | xxd -r -p | base64
HexToBytes
```
@amnn amnn self-assigned this Aug 11, 2023
@vercel
Copy link

vercel bot commented Aug 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-typescript-docs ❌ Failed (Inspect) Aug 11, 2023 10:41pm
5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Visit Preview Aug 11, 2023 10:41pm
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Aug 11, 2023 10:41pm
mysten-ui ⬜️ Ignored (Inspect) Visit Preview Aug 11, 2023 10:41pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Aug 11, 2023 10:41pm
sui-wallet-kit ⬜️ Ignored (Inspect) Visit Preview Aug 11, 2023 10:41pm

@amnn amnn merged commit 5cb196f into releases/sui-v1.6.0-release Aug 12, 2023
30 checks passed
@amnn amnn deleted the pick-13196 branch August 12, 2023 00:34
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.

3 participants