-
Notifications
You must be signed in to change notification settings - Fork 312
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
playground: implement mode
option for painter algorithm populating options
#1365
Conversation
@tisonkun: GitHub didn't allow me to request PR reviews from the following users: iosmanthus. Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Codecov Report
@@ Coverage Diff @@
## master #1365 +/- ##
==========================================
+ Coverage 25.38% 26.26% +0.88%
==========================================
Files 265 275 +10
Lines 20464 20907 +443
==========================================
+ Hits 5194 5491 +297
- Misses 14473 14618 +145
- Partials 797 798 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use pflag.Flag.Visit()
to determine if an argument is set by user, here's an example in tiup mirror
sub command
Line 294 in dd6b818
cmd.Flags().Visit(func(f *pflag.Flag) { |
Signed-off-by: tison <wander4096@gmail.com>
I've updated the implementation as @AstroProfundis suggested, using |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: ef65ee7
|
Does this PR need to cherry-pick? |
I have no idea but it just works for me using a nightly version. |
I think it is better to release it. |
@andylokandy Will be released in v1.5.0 |
ok, i see. The release is spilt from master. |
What problem does this PR solve?
This PR closes #1269
It introduces a
mode
option to switch default config set amongtidb
ortikv-slim
and allow user populate more options based on the default set.What is changed and how it works?
Now, we directly communicate with
FlagSet
and useChanged
to see if user explicit sets a config flag.And I implement the painter algorithm that
version
configmode
optioneach layer overwrite options set in early layer.
Check List
Tests
I run
tiup playground
tiup playground --mode tidb
tiup playground --mode tikv-slim
tiup playground --mode unknown
tiup playground --db 0 --tiflash 0
tiup playground --mode tikv-slim --db 1 --tiflash 1
and all run as expected.
I'm willing to add some automatic test but help wanted. Also I think we can add tests after this pr merged instead of be too mean to a fruitful pull request.
Side effects
with increasing flexibility.
Related changes
Yes, we need to update the documentation. But where?