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

cluster: implement pure JSON output mode (experimental) #1617

Merged
merged 7 commits into from
Nov 12, 2021

Conversation

AstroProfundis
Copy link
Contributor

What problem does this PR solve?

Partially implement #1208

This is an experimental feature and may due to changes and refactors in the future.

Also add an optional TIUP_AUDIT_ID environment variable that will be appended to timestamp based audit id string.

What is changed and how it works?

  • Add a global argument --format to define output format and replaces --json.
  • Make task outputs and loggers support JSON format

The output will be multiple JSON lines, and the last line is a {"exit_code": 0} (or other codes) printed to stderr.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Code changes

  • Has exported function/method change
  • Has exported variable/fields change

Side effects

  • Increased code complexity

Release notes:

NONE

@AstroProfundis AstroProfundis added type/new-feature Categorizes pr as related to a new feature. component/cluster Issues about the tiup-cluster component component/dm Issues about the tiup-dm component labels Nov 11, 2021
@AstroProfundis AstroProfundis added this to the v1.7.0 milestone Nov 11, 2021
@AstroProfundis AstroProfundis self-assigned this Nov 11, 2021
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 11, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • nexustar

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 11, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2021

Codecov Report

Merging #1617 (fb66220) into master (d19721b) will increase coverage by 20.00%.
The diff coverage is 45.34%.

❗ Current head fb66220 differs from pull request most recent head e6328c8. Consider uploading reports for the commit e6328c8 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1617       +/-   ##
===========================================
+ Coverage   15.63%   35.64%   +20.00%     
===========================================
  Files         150      230       +80     
  Lines       15169    21533     +6364     
===========================================
+ Hits         2372     7675     +5303     
- Misses      12280    12747      +467     
- Partials      517     1111      +594     
Flag Coverage Δ
cluster 35.64% <45.34%> (?)
integrate 35.64% <45.34%> (+20.00%) ⬆️
tiup ?
unittest ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/cluster/command/display.go 32.46% <ø> (ø)
pkg/cluster/ansible/config.go 0.00% <0.00%> (ø)
pkg/cluster/manager/check.go 0.00% <0.00%> (ø)
pkg/cluster/manager/display.go 39.79% <0.00%> (ø)
pkg/cluster/manager/patch.go 0.00% <0.00%> (ø)
pkg/cluster/manager/scale_out.go 42.72% <ø> (ø)
pkg/cluster/manager/transfer.go 14.77% <0.00%> (ø)
pkg/cluster/manager/upgrade.go 0.00% <0.00%> (ø)
pkg/cluster/operation/operation.go 39.28% <ø> (ø)
pkg/tui/progress/display_props.go 0.00% <0.00%> (ø)
... and 232 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d19721b...e6328c8. Read the comment docs.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 12, 2021
@AstroProfundis
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: e6328c8

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 12, 2021
@ti-chi-bot ti-chi-bot merged commit c5c8a71 into pingcap:master Nov 12, 2021
@AstroProfundis AstroProfundis deleted the tiem branch November 12, 2021 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/cluster Issues about the tiup-cluster component component/dm Issues about the tiup-dm component size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. type/new-feature Categorizes pr as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants