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: support using provided topo file besides editing it while calling edit-config, add show-config command #1637

Merged
merged 14 commits into from
Nov 25, 2021
Merged

cluster: support using provided topo file besides editing it while calling edit-config, add show-config command #1637

merged 14 commits into from
Nov 25, 2021

Conversation

haiboumich
Copy link
Contributor

@haiboumich haiboumich commented Nov 22, 2021

What problem does this PR solve?

For subcommand tiup cluster edit-config, add a flag --topology-file to allow the user to provide a new topology file to substitute the original one besides editing it.

What is changed and how it works?

  • For command edit-config, add a flag --topology-file to allow the user to provide a new topology file to substitute the original one besides editing it.
  • add show-config command

Check List

Tests

  • Manual test (add detailed scripts or steps below)
  1. Build the new tiup-cluster binary and use it as the new component in TiUP central machine.
  2. If the flag --topology-file is not specified, it will act like the old flow:
    • Write Topology to a temporary file.
    • Open file in editor.
    • Check and update Topology.
    • Save meta file.
  3. Otherwise, it will check the existence of the topology file specified by the flag --topology-file and will only 'Check and update Topology.' and 'Save meta file.'.
  4. While executing ./tiup-cluster show-config <cluster-name>, the cluster's config, which is same as the one shown by opening the topology file to edit while executing ./tiup-cluster edit-config <cluster-name>, will be printed in console.

Code changes

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

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release notes:

* Support using a new topology file to substitute the original one besides editing it while calling `tiup cluster edit-config`
* Add the feature `show-config` of component `tiup-cluster` to show cluster's configuration

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 22, 2021

[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 submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 22, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2021

Codecov Report

Merging #1637 (25196cd) into master (0ec99bb) will increase coverage by 30.16%.
The diff coverage is 38.59%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1637       +/-   ##
===========================================
+ Coverage   15.55%   45.71%   +30.16%     
===========================================
  Files         151      294      +143     
  Lines       15275    26912    +11637     
===========================================
+ Hits         2376    12303     +9927     
- Misses      12382    12711      +329     
- Partials      517     1898     +1381     
Flag Coverage Δ
cluster 37.03% <35.18%> (?)
dm 26.13% <31.70%> (?)
integrate 45.71% <38.59%> (+30.16%) ⬆️
playground 13.31% <ø> (?)
tiup 15.57% <ø> (+0.01%) ⬆️
unittest ∅ <ø> (∅)

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

Impacted Files Coverage Δ
pkg/cluster/manager/show_config.go 0.00% <0.00%> (ø)
pkg/cluster/manager/edit_config.go 32.43% <38.46%> (ø)
components/cluster/command/show_config.go 41.66% <41.66%> (ø)
components/cluster/command/edit_config.go 85.71% <100.00%> (ø)
components/cluster/command/root.go 44.35% <100.00%> (ø)
components/dm/command/edit_config.go 83.33% <100.00%> (ø)
components/playground/instance/tiflash_config.go 100.00% <0.00%> (ø)
components/dm/command/destroy.go 63.15% <0.00%> (ø)
components/cluster/command/enable.go 43.75% <0.00%> (ø)
... and 237 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 0ec99bb...25196cd. Read the comment docs.

@haiboumich haiboumich changed the title Feature/edit config new interface cluster: support using provided topo file besides editing while calling edit-config Nov 22, 2021
@haiboumich haiboumich changed the title cluster: support using provided topo file besides editing while calling edit-config cluster: support using provided topo file besides editing it while calling edit-config Nov 22, 2021
pkg/cluster/manager/edit_config.go Outdated Show resolved Hide resolved
pkg/cluster/manager/edit_config.go Outdated Show resolved Hide resolved
pkg/cluster/manager/edit_config.go Outdated Show resolved Hide resolved
@haiboumich haiboumich changed the title cluster: support using provided topo file besides editing it while calling edit-config [WIP]cluster: support using provided topo file besides editing it while calling edit-config, add show-config command Nov 23, 2021
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 23, 2021
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 23, 2021
@haiboumich haiboumich changed the title [WIP]cluster: support using provided topo file besides editing it while calling edit-config, add show-config command cluster: support using provided topo file besides editing it while calling edit-config, add show-config command Nov 23, 2021
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 23, 2021
components/cluster/command/show_config.go Outdated Show resolved Hide resolved
pkg/cluster/manager/show_config.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 24, 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: 25196cd

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 25, 2021
@ti-chi-bot ti-chi-bot merged commit 9edf64e into pingcap:master Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 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