-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Introducing options.cloud #3348
Conversation
2145363
to
4752984
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #3348 +/- ##
==========================================
+ Coverage 73.55% 73.56% +0.01%
==========================================
Files 277 277
Lines 20201 20228 +27
==========================================
+ Hits 14858 14881 +23
- Misses 4396 4399 +3
- Partials 947 948 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
c968699
to
75f526e
Compare
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.
@olegbespalov did a first cycle, thanks for the great work 🙇
} | ||
|
||
// Original comment | ||
// TODO: Important! Separate configs and fix the whole 2 configs mess! |
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.
Can you explicit this comment a bit more, please? I'm not getting what is the suggestion here
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.
The issue that I'm not getting this comment to, it's an original comment that was presented in the place around.
TBH for the case of refactoring that I did it wasn't so relevant, but on the other side I'm not comfortable removing it.
cloudapi/config.go
Outdated
@@ -158,6 +162,9 @@ type Config struct { | |||
|
|||
// Deprecated: Remove this when migration from the cloud output v1 will be completed | |||
MaxMetricSamplesPerPackage null.Int `json:"maxMetricSamplesPerPackage" envconfig:"K6_CLOUD_MAX_METRIC_SAMPLES_PER_PACKAGE"` | |||
|
|||
// WarningMessage is a string that will be shown to the user if the config has some invalid values. | |||
WarningMessage string `json:"-"` |
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.
WarningMessage string `json:"-"` | |
WarningMessage []string `json:"-"` |
Considering we are adding this mechanism, should we instead have some sort of form to support a list? Also, why not have them as a result of the Consolidation function?
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.
In my opinion, we could start small, and if we see the need to extend it, but that particular place I don't mind if you think this serve some future needs I could convert to the array
if err := json.Unmarshal(source, &tmpConfig); err != nil { | ||
return err | ||
} | ||
// Only take out the ProjectID, Name and Token from the options.cloud (or legacy loadimpact struct) map: |
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.
It seems to me reading this comment that we are taking out only part of the available fields. The question now I have is why? I guess it has a reason, can you clarify it, please? As it isn't clear to me just reading the code.
And if it has then probably it can be directly part of the comment of the function explaining what should be the expected return.
As a reference I evaluate this list still valid for the as configurable options. https://k6.io/docs/cloud/creating-and-running-a-test/cloud-scripting-extras/cloud-options/
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.
This is again the comment from the past https://github.com/grafana/k6/pull/3348/files#diff-55ae88ea92051c07942fe7b2477d0b5ee5c7889eb78825e8dd8db7fbf0f96e69L302
fac3508
to
7ed4a71
Compare
7ed4a71
to
7da005e
Compare
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.
Thanks for the effort 🙇
7da005e
to
5da752f
Compare
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.
I've extracted warnings (or referings) of the options.cloud to the #3407
Yep, I like the idea. LGTM
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.
LGTM! 👏
but I have not tried to break it extensively locally.
My main feedback is that I still am of the opinion that if options.cloud
and options.ext.loadimpact
exist - this should lead to an early error instead of one of them taking precedence.
There is IMO no reason someone will have both and at best it will be confusing to users which one they need to change.
5add9e5
to
50418f8
Compare
50418f8
to
a54097a
Compare
Co-authored-by: Ivan <2103732+codebien@users.noreply.github.com>
a54097a
to
bb6f6c5
Compare
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.
Approving with the assumption we have a green CI we have 🎉
Hello 👋 Just for understanding of this change: can a user specify both the |
hey @yorugac . Nope, mixing isn't acceptable. If the |
What?
This is an attempt to introduce the new option
cloud
, which should start the process of sunsetting theoptions.ext.loadimpact
Why?
The
options.ext.loadimpact
is the legacy option, and we should migrate from it to something more neutral likecloud
Checklist
make ci-like-lint
) and all checks pass.make tests
) and all tests pass.Related PR(s)/Issue(s)
Closes #1155