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

Fix handling cli options default value #1092

Merged
merged 1 commit into from
Aug 9, 2019
Merged

Fix handling cli options default value #1092

merged 1 commit into from
Aug 9, 2019

Conversation

cuonglm
Copy link
Contributor

@cuonglm cuonglm commented Jul 29, 2019

CLI options have the highest priority, so the cli options which have a
default value will always override options of other mechanisms.

To fix it, we only set default value after consolidated config process.

Close #1010

@codecov-io
Copy link

codecov-io commented Jul 29, 2019

Codecov Report

Merging #1092 into master will increase coverage by 0.03%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1092      +/-   ##
==========================================
+ Coverage   72.92%   72.95%   +0.03%     
==========================================
  Files         134      134              
  Lines        9960     9966       +6     
==========================================
+ Hits         7263     7271       +8     
+ Misses       2279     2278       -1     
+ Partials      418      417       -1
Impacted Files Coverage Δ
cmd/config.go 76.82% <100%> (+0.79%) ⬆️
cmd/options.go 66.66% <71.42%> (+0.28%) ⬆️
core/engine.go 93.92% <0%> (+0.93%) ⬆️

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 f8efe4f...2b58676. Read the comment docs.

cmd/options.go Outdated Show resolved Hide resolved
CLI options have the highest priority, so the cli options which have a
default value will always override options of other mechanisms.

To fix it, we only set default value after consolidated config process.

Close #1010
@mstoykov mstoykov self-requested a review August 8, 2019 09:52
Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

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

LGTM!
We should probably create an issue, with other config options which probably need this treatment, @na--
p.s. Sorry for the long delay :(

@mstoykov mstoykov added this to the v0.26.0 milestone Aug 8, 2019
@cuonglm
Copy link
Contributor Author

cuonglm commented Aug 8, 2019

@mstoykov I did look for other flags, but sounds like only --system-tags needs this treatment.

Copy link
Member

@na-- na-- left a comment

Choose a reason for hiding this comment

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

LGTM, thanks, and sorry for the huge delay, we had to deal with some issues surrounding k6 v0.25.0 😞

Looking at the options code, I don't immediately see any other options that would have the same issue, but I haven't actually tested them one by one... So I'd say we should merge this and deal with any others in separate PRs. @mstoykov, I think we should merge this and include it in v0.25.1, right?

@mstoykov
Copy link
Contributor

mstoykov commented Aug 8, 2019

This seems like low risk commit to me so I okay with that

@mstoykov
Copy link
Contributor

mstoykov commented Aug 8, 2019

@cuonglm I haven't looked at them, so if there are no others I am fine, and @na-- yeah we would've definitely done it in different PR except if it was ... like one other option

@mstoykov mstoykov modified the milestones: v0.26.0, v0.25.1 Aug 8, 2019
@mstoykov mstoykov merged commit fb7bcf8 into grafana:master Aug 9, 2019
@cuonglm cuonglm deleted the fix/issue-1010 branch August 9, 2019 14:24
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.

systemTags is ignored when specified in the JS or JSON options
5 participants