Skip to content

Standard output format for query ledger-peer-snapshot command #1172

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

newhoggy
Copy link
Contributor

@newhoggy newhoggy commented May 6, 2025

Changelog

- description: |
    Standard output format for `query ledger-peer-snapshot` command
    Supports `--output-json`, `--output-json-pretty` and `--output-yaml`
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

Follows ADR-012

How to trust this PR

Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@newhoggy newhoggy force-pushed the newhoggy/standard-output-format-for-query-ledger-peer-snapshot-command branch from c1d7502 to 18a9fba Compare May 6, 2025 10:53
@newhoggy newhoggy force-pushed the newhoggy/standard-output-format-for-query-ledger-peer-snapshot-command branch from 18a9fba to fb2871d Compare May 6, 2025 13:42
@coot coot requested a review from crocodile-dentist May 7, 2025 11:52
@crocodile-dentist
Copy link
Contributor

Perhaps json pretty format should be the default when outputting to a file, and otherwise plain json to the terminal.

Copy link
Contributor

@carbolymer carbolymer left a comment

Choose a reason for hiding this comment

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

Why do we need output-json-pretty?

What do you think about defaulting to pretty JSON everywhere? If the produced data is large, let's add CBOR output format as well, in case a faster and more efficient format is needed.

@newhoggy newhoggy force-pushed the newhoggy/standard-output-format-for-query-ledger-peer-snapshot-command branch from fb2871d to 3affc83 Compare May 8, 2025 11:10
@newhoggy newhoggy enabled auto-merge May 8, 2025 12:01
@newhoggy newhoggy added this pull request to the merge queue May 8, 2025
@@ -114,6 +118,10 @@ cborToTextByteString bs = do
text <- cborToText bs
pure $ LB.fromStrict $ Text.encodeUtf8 text

cborToTextLazyByteString :: LB.ByteString -> ExceptT HelpersError IO LBS.ByteString
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I must have backed out the change that used it.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 8, 2025
@newhoggy newhoggy added this pull request to the merge queue May 8, 2025
Merged via the queue into master with commit 5d779ea May 8, 2025
27 of 28 checks passed
@newhoggy newhoggy deleted the newhoggy/standard-output-format-for-query-ledger-peer-snapshot-command branch May 8, 2025 22:15
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.

4 participants