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

Extract get audit list #1217

Merged
merged 4 commits into from
Mar 17, 2021
Merged

Extract get audit list #1217

merged 4 commits into from
Mar 17, 2021

Conversation

baurine
Copy link
Contributor

@baurine baurine commented Mar 16, 2021

What problem does this PR solve?

Similar to PR #1139 , this PR is used to support PR #1172 (tiup web UI), so we can show the audit list in the web UI without parsing the command line output.

image

What is changed and how it works?

Extract a GetAuditList() method

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

Code changes

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

Related changes

  • Need to cherry-pick to the release branch

Release notes:

NONE

Maual test:

Output by this PR:

> bin/tiup-cluster audit
ID           Time                       Command
--           ----                       -------
fzgtCbNvFgm  2021-03-16T22:32:18+08:00  bin/tiup-cluster check multi-host --cluster
fzgsZxPGbXs  2021-03-16T22:23:00+08:00  bin/tiup-cluster check multi-host --cluster
fzgsWNLWbg1  2021-03-16T22:22:12+08:00  /Users/baurine/.tiup/components/cluster/v1.3.5/tiup-cluster check multi-host --cluster
fzgsKrtgpBY  2021-03-16T22:19:10+08:00  /Users/baurine/.tiup/components/cluster/v1.3.4/tiup-cluster check multi-host --cluster
fzgsz4QJrcb  2021-03-16T22:16:43+08:00  /Users/baurine/.tiup/components/cluster/v1.3.4/tiup-cluster display multi-host
fzgsyNsvtGQ  2021-03-16T22:16:38+08:00  /Users/baurine/.tiup/components/cluster/v1.3.4/tiup-cluster list
fzg6gBm308p  2021-03-16T17:58:12+08:00  bin/tiup-cluster check multi-host --cluster
...

Output by master branch code:

> bin/tiup-cluster audit
ID           Time                       Command
--           ----                       -------
fzgvJqdqkPd  2021-03-16T22:48:47+08:00  bin/tiup-cluster audit
fzgtCbNvFgm  2021-03-16T22:32:18+08:00  bin/tiup-cluster check multi-host --cluster
fzgsZxPGbXs  2021-03-16T22:23:00+08:00  bin/tiup-cluster check multi-host --cluster
fzgsWNLWbg1  2021-03-16T22:22:12+08:00  /Users/baurine/.tiup/components/cluster/v1.3.5/tiup-cluster check multi-host --cluster
fzgsKrtgpBY  2021-03-16T22:19:10+08:00  /Users/baurine/.tiup/components/cluster/v1.3.4/tiup-cluster check multi-host --cluster
fzgsz4QJrcb  2021-03-16T22:16:43+08:00  /Users/baurine/.tiup/components/cluster/v1.3.4/tiup-cluster display multi-host
fzgsyNsvtGQ  2021-03-16T22:16:38+08:00  /Users/baurine/.tiup/components/cluster/v1.3.4/tiup-cluster list
fzg6gBm308p  2021-03-16T17:58:12+08:00  bin/tiup-cluster check multi-host --cluster
...

@ti-chi-bot ti-chi-bot requested review from july2993 and nrc March 16, 2021 14:53
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 16, 2021
@codecov-io
Copy link

codecov-io commented Mar 16, 2021

Codecov Report

Merging #1217 (9178747) into master (671b5f4) will decrease coverage by 8.26%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1217      +/-   ##
==========================================
- Coverage   49.78%   41.52%   -8.27%     
==========================================
  Files         289      254      -35     
  Lines       20589    17704    -2885     
==========================================
- Hits        10251     7352    -2899     
- Misses       8689     9098     +409     
+ Partials     1649     1254     -395     
Flag Coverage Δ
cluster 38.37% <0.00%> (+0.06%) ⬆️
dm 25.09% <83.33%> (+0.03%) ⬆️
integrate 41.52% <83.33%> (-2.20%) ⬇️
playground ?
tiup ?
unittest ?

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

Impacted Files Coverage Δ
pkg/cluster/audit/audit.go 63.41% <83.33%> (+2.30%) ⬆️
pkg/repository/store/store.go 0.00% <0.00%> (-100.00%) ⬇️
components/dm/ansible/worker.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/repository/utils/hash.go 0.00% <0.00%> (-81.82%) ⬇️
pkg/meta/err.go 0.00% <0.00%> (-81.25%) ⬇️
pkg/telemetry/meta.go 0.00% <0.00%> (-80.00%) ⬇️
pkg/telemetry/scrub.go 6.66% <0.00%> (-80.00%) ⬇️
pkg/cluster/api/error.go 0.00% <0.00%> (-80.00%) ⬇️
pkg/repository/store/local.go 0.00% <0.00%> (-76.48%) ⬇️
pkg/repository/model/publish.go 0.00% <0.00%> (-71.43%) ⬇️
... and 156 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 671b5f4...9178747. Read the comment docs.

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AstroProfundis

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 writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

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

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 1f2845b

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 17, 2021
@ti-chi-bot ti-chi-bot merged commit 43f0dea into pingcap:master Mar 17, 2021
@baurine baurine deleted the extract-get-audit-list branch March 17, 2021 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants