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

Prefix all envconfig struct tags with K6 directly #1215

Merged
merged 2 commits into from
Oct 25, 2019
Merged

Prefix all envconfig struct tags with K6 directly #1215

merged 2 commits into from
Oct 25, 2019

Conversation

mstoykov
Copy link
Contributor

Works on #671 and fixing it in almost all cases.

This was done primarily by running:

rg -g "*.go"  'envconfig:"' --files-with-matches  |\
    xargs -n 1 sed -s -i 's/envconfig:"/envconfig:"K6_/g'

And than manually fixing all remaing problems by hand.
In the mean time I found out we weren't properly combing the
configuration for statsd/datadog and fixed.

Also renamed HttpDebug to HTTPDebug in the Options struct.

Unfortunately due to the way the statsd and datadog share the same
struct for a config this doesn't fix the issue as a whole for them.

Works on #671 and fixing it in almost all cases.

This was done primarily by running:
```
rg -g "*.go"  'envconfig:"' --files-with-matches  |\
    xargs -n 1 sed -s -i 's/envconfig:"/envconfig:"K6_/g'
```

And than manually fixing all remaing problems by hand.
In the mean time I found out we weren't properly combing the
configuration for statsd/datadog and fixed.

Also renamed HttpDebug to HTTPDebug in the Options struct.

Unfortunately due to the way the statsd and datadog share the same
struct for a config this doesn't fix the issue as a whole for them.
@mstoykov mstoykov requested review from imiric, na-- and cuonglm October 24, 2019 14:07
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.

I know it's extra effort, but the mixed capitalization of the envconfig tags is bugging me 😅 Can you make all envconfig tags uppercase? You should be able to do it with a regex: http://bigdatums.net/2017/09/30/how-to-uppercase-lowercase-text-with-sed/

@codecov-io
Copy link

codecov-io commented Oct 24, 2019

Codecov Report

Merging #1215 into master will increase coverage by <.01%.
The diff coverage is 68.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1215      +/-   ##
==========================================
+ Coverage   73.65%   73.66%   +<.01%     
==========================================
  Files         147      147              
  Lines       10641    10645       +4     
==========================================
+ Hits         7838     7842       +4     
  Misses       2344     2344              
  Partials      459      459
Impacted Files Coverage Δ
stats/csv/config.go 79.31% <ø> (ø) ⬆️
stats/influxdb/config.go 49.03% <ø> (ø) ⬆️
stats/kafka/config.go 69.23% <ø> (ø) ⬆️
stats/cloud/config.go 56.86% <ø> (ø) ⬆️
lib/runtime_options.go 0% <ø> (ø) ⬆️
cmd/collectors.go 0% <0%> (ø) ⬆️
cmd/run.go 9.54% <0%> (ø) ⬆️
cmd/cloud.go 9.52% <0%> (ø) ⬆️
cmd/config.go 77.7% <100%> (+0.58%) ⬆️
cmd/options.go 67.76% <100%> (ø) ⬆️
... and 2 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 5cda323...051e4da. Read the comment docs.

using:
```
rg -g "*.go"  'envconfig:"' --files-with-matches   |\
  xargs -n 1 sed -r -i -s  's/envconfig:"([^"]*)"/envconfig:"\U\1\E"/g'
```
@mstoykov mstoykov merged commit 82a59aa into master Oct 25, 2019
@mstoykov mstoykov deleted the fix671 branch October 25, 2019 07:15
@mstoykov mstoykov added this to the v0.26.0 milestone Oct 25, 2019
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.

4 participants