Chore(deps): bump github.com/elastic/elastic-integration-corpus-generator-tool from 0.10.0 to 0.11.0#3208
Conversation
…ator-tool Bumps [github.com/elastic/elastic-integration-corpus-generator-tool](https://github.com/elastic/elastic-integration-corpus-generator-tool) from 0.10.0 to 0.11.0. - [Release notes](https://github.com/elastic/elastic-integration-corpus-generator-tool/releases) - [Commits](elastic/elastic-integration-corpus-generator-tool@v0.10.0...v0.11.0) --- updated-dependencies: - dependency-name: github.com/elastic/elastic-integration-corpus-generator-tool dependency-version: 0.11.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
|
There was a breaking change in elastic/elastic-integration-corpus-generator-tool#169 Maybe we could add the same parameter set in tests ? WDYT @shmsr ? One example where it is used in elastic-package (benchrunners) elastic-package/internal/benchrunner/runners/stream/runner.go Lines 316 to 318 in 924268f |
Here it did come up during the review, but later we agreed that the library was still in version 0. However, yes, from now on, we will try to ensure that even in version 0.x.x, we do not break the API unless absolutely necessary. We can use a default seed like mentioned here and make the changes in elastic-package: elastic/elastic-integration-corpus-generator-tool#169 (comment)? |
Do you mean updating case "", "placeholder":
generator, err = genlib.NewGeneratorWithCustomTemplate(tpl, *config, fields, totEvents, int64(1))
case "gotext":
generator, err = genlib.NewGeneratorWithTextTemplate(tpl, *config, fields, totEvents, int64(1))
}or doing this (as I see in the tests in that PR)? case "", "placeholder":
generator, err = genlib.NewGeneratorWithCustomTemplate(tpl, *config, fields, totEvents, rand.Int63())
case "gotext":
generator, err = genlib.NewGeneratorWithTextTemplate(tpl, *config, fields, totEvents, rand.Int63())
}Any suggestion to add for this new parameter? Another options, Should it be added new functions in the library that creates the generator without adding ourselves the random seed as parameter ? Thereby, the seed could be created by the library with a safe value to use? |
|
Apologies for the lack of documentation about this change. Using diff --git internal/benchrunner/runners/rally/runner.go internal/benchrunner/runners/rally/runner.go
index 77c427ce..8c27a402 100644
--- internal/benchrunner/runners/rally/runner.go
+++ internal/benchrunner/runners/rally/runner.go
@@ -580,9 +580,9 @@ func (r *runner) initializeGenerator(ctx context.Context) (genlib.Generator, err
logger.Debugf("unknown generator template type %q, defaulting to \"placeholder\"", r.scenario.Corpora.Generator.Template.Type)
fallthrough
case "", "placeholder":
- generator, err = genlib.NewGeneratorWithCustomTemplate(tpl, *config, fields, totEvents)
+ generator, err = genlib.NewGeneratorWithCustomTemplate(tpl, *config, fields, totEvents, time.Now().UnixNano())
case "gotext":
- generator, err = genlib.NewGeneratorWithTextTemplate(tpl, *config, fields, totEvents)
+ generator, err = genlib.NewGeneratorWithTextTemplate(tpl, *config, fields, totEvents, time.Now().UnixNano())
}
if err != nil {
diff --git internal/benchrunner/runners/stream/runner.go internal/benchrunner/runners/stream/runner.go
index 7735a5c0..7bd91889 100644
--- internal/benchrunner/runners/stream/runner.go
+++ internal/benchrunner/runners/stream/runner.go
@@ -313,9 +313,9 @@ func (r *runner) initializeGenerator(tpl []byte, config genlib.Config, fields ge
logger.Debugf("unknown generator template type %q, defaulting to \"placeholder\"", scenario.Corpora.Generator.Template.Type)
fallthrough
case "", "placeholder":
- return genlib.NewGeneratorWithCustomTemplate(tpl, config, fields, totEvents)
+ return genlib.NewGeneratorWithCustomTemplate(tpl, config, fields, totEvents, time.Now().UnixNano())
case "gotext":
- return genlib.NewGeneratorWithTextTemplate(tpl, config, fields, totEvents)
+ return genlib.NewGeneratorWithTextTemplate(tpl, config, fields, totEvents, time.Now().UnixNano())
}
}
func (r *runner) collectGenerators(ctx context.Context) error {
diff --git internal/benchrunner/runners/system/runner.go internal/benchrunner/runners/system/runner.go
index a5f44ac9..4ecd8ecf 100644
--- internal/benchrunner/runners/system/runner.go
+++ internal/benchrunner/runners/system/runner.go
@@ -522,9 +522,9 @@ func (r *runner) initializeGenerator(ctx context.Context) (genlib.Generator, err
logger.Debugf("unknown generator template type %q, defaulting to \"placeholder\"", r.scenario.Corpora.Generator.Template.Type)
fallthrough
case "", "placeholder":
- generator, err = genlib.NewGeneratorWithCustomTemplate(tpl, *config, fields, totEvents)
+ generator, err = genlib.NewGeneratorWithCustomTemplate(tpl, *config, fields, totEvents, time.Now().UnixNano())
case "gotext":
- generator, err = genlib.NewGeneratorWithTextTemplate(tpl, *config, fields, totEvents)
+ generator, err = genlib.NewGeneratorWithTextTemplate(tpl, *config, fields, totEvents, time.Now().UnixNano())
}
if err != nil { |
💚 Build Succeeded
History
|
|
@elastic/ecosystem could you do also another review for this? |
I understand that this API change is not very appealing for a user that does not actually care about seeding the random generator. An option I'm proposing in elastic/elastic-integration-corpus-generator-tool#171 (comment) is to maybe switch to a more extensible way to provide optional settings. |
Merge Queue Status✅ The pull request has been merged at 062569f This pull request spent 31 minutes 41 seconds in the queue, including 31 minutes 28 seconds running CI. Required conditions to merge
|
Bumps github.com/elastic/elastic-integration-corpus-generator-tool from 0.10.0 to 0.11.0.
Release notes
Sourced from github.com/elastic/elastic-integration-corpus-generator-tool's releases.
Commits
9370e17Addbyteandshorttypes (#170)467e3fcRestore concurrency safety at generator level (#169)b564f05Bump the github-actions group across 1 directory with 2 updates (#156)04789baAdd support for counter resets (#152)2732131github-action: add dependabot for GitHub actions (#155)a33344dextend enum support (#144)1676ff9github-action: delete opentelemetry workflow (#145)22bc96cAdd CODEOWNERS file and clarify ownership in repo readme (#140)7407a15Bump golang.org/x/sync from 0.6.0 to 0.7.0 (#139)22431d2Bump github.com/stretchr/testify from 1.8.4 to 1.9.0 (#134)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)