Skip to content

Rollout --output-json and --output-yaml part 1 #1175

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

Merged
merged 2 commits into from
May 9, 2025

Conversation

newhoggy
Copy link
Contributor

@newhoggy newhoggy commented May 7, 2025

Changelog

- description: |
    Rollout `--output-json` and `--output-yaml` to various commands:
    * `compatible conway governance action view`
    * `compatible conway governance vote view`
    * `conway governance action view`
    * `conway governance vote view`
    * `conway query leadership-schedule`
    * `debug transaction view`
    * `latest governance action view`
    * `latest governance vote view`
    * `latest query leadership-schedule`
    * `query leadership-schedule`
    Ensure we encode json the same way in each command.
# 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

This helps keep output options of commands consistent.

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/rollout-json-pretty-and-yaml-output-1 branch from 68edfb6 to ddedf9a Compare May 7, 2025 12:00
@newhoggy newhoggy marked this pull request as draft May 7, 2025 13:05
@newhoggy newhoggy force-pushed the newhoggy/rollout-json-pretty-and-yaml-output-1 branch 2 times, most recently from 875af0e to d7b6065 Compare May 8, 2025 12:19
@newhoggy newhoggy marked this pull request as ready for review May 8, 2025 12:24
@newhoggy newhoggy changed the title Rollout --output-json-pretty and --output-yaml part 1 Rollout --output-json and --output-yaml part 1 May 8, 2025
@@ -1964,10 +1975,10 @@ writeOutput
-> b
-> ExceptT QueryCmdError IO ()
writeOutput mOutFile content = case mOutFile of
Nothing -> liftIO . LBS.putStrLn . encodePretty $ content
Nothing -> liftIO . LBS.putStrLn . Aeson.encodePretty $ content
Copy link
Contributor

Choose a reason for hiding this comment

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

Why aeson and not Json.encodeJson?

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 was going to do it, but postponing to a future PR to avoid changing too much in the one PR so if something breaks it's easier to pinpoint the problem.

@newhoggy newhoggy enabled auto-merge May 8, 2025 13:49
@newhoggy newhoggy force-pushed the newhoggy/rollout-json-pretty-and-yaml-output-1 branch 2 times, most recently from fc772b9 to 6cf0724 Compare May 8, 2025 21:58
@newhoggy newhoggy added this pull request to the merge queue May 8, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch May 8, 2025
newhoggy added 2 commits May 10, 2025 01:53
    * `compatible conway governance action view`
    * `compatible conway governance vote view`
    * `conway governance action view`
    * `conway governance vote view`
    * `conway query leadership-schedule`
    * `debug transaction view`
    * `latest governance action view`
    * `latest governance vote view`
    * `latest query leadership-schedule`
    * `query leadership-schedule`
@newhoggy newhoggy force-pushed the newhoggy/rollout-json-pretty-and-yaml-output-1 branch from 6cf0724 to 0b38c67 Compare May 9, 2025 15:55
@newhoggy newhoggy enabled auto-merge May 9, 2025 15:58
@newhoggy newhoggy added this pull request to the merge queue May 9, 2025
Merged via the queue into master with commit 2b93eba May 9, 2025
28 of 29 checks passed
@newhoggy newhoggy deleted the newhoggy/rollout-json-pretty-and-yaml-output-1 branch May 9, 2025 16:55
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.

2 participants