-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
2813 - Move all mapping related code to mappings package. #2822
Conversation
@albertteoh /@yurishkuro. Could not implement below points -
As I needed to pass the template builder interface for mocking in tests. |
Would look at failing integration tests. |
Codecov Report
@@ Coverage Diff @@
## master #2822 +/- ##
==========================================
+ Coverage 95.92% 95.95% +0.03%
==========================================
Files 222 223 +1
Lines 9696 9695 -1
==========================================
+ Hits 9301 9303 +2
+ Misses 325 323 -2
+ Partials 70 69 -1
Continue to review full report at Codecov.
|
Wierd, integration tests passed locally on elasticsearch v7.3.0. |
Ok, I am able reproduce locally as well. Not entirely sure whats causing this though. Will spend some time on this |
I am seeing this in my elasticsearch logs during the test runs.
|
I saw this once when I had index mapping issues; I think it means your I would suggest querying ES on both your span and service mappings to confirm this is indeed the case (type is
And check your templates to ensure
And from there, it's just a matter of pinning down the root cause from what's changed in this PR. |
Thank you @albertteoh - that helped. Index template pattern was the issue, index prefix was getting suffixed with "-" twice. Added a suffix check to avoid it. Tests passed locally. |
args args | ||
mockNewTextTemplateBuilder func() es.TemplateBuilder |
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 would just use MappingBuilder
struct directly, there's no benefit in the indirections
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.
Dint get this.
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.
rather than defining a struct for tests and copying values into it, just use MappingBuilder struct directly when defining test cases.
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.
Not part of this commit. Will work on it now.
want := "" | ||
if tt.esVersion == 7 { | ||
want, err = mb.fixMapping("/" + tt.mapping + "-7.json") | ||
require.NoError(t, err) |
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.
nit: could move this to after the else
to remove duplication
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.
@albertteoh dint get this - you want me to move require.NoError(t, err)
after else?
…yurishkuro's feedback on refactoring Signed-off-by: santosh <[email protected]>
Signed-off-by: santosh <[email protected]>
…kuro's feedback Signed-off-by: santosh <[email protected]>
Signed-off-by: santosh <[email protected]>
Signed-off-by: santosh <[email protected]>
…tes & implement feedback on tests Signed-off-by: santosh <[email protected]>
|
||
//go:embed *.json | ||
// MAPPINGS contains embeded index templates. | ||
var MAPPINGS embed.FS |
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.
does this need to be public?
var MAPPINGS embed.FS | |
var mappingsFS embed.FS |
…#2822) * 2813 - Move all mapping related code to mappings package & implement @yurishkuro's feedback on refactoring Signed-off-by: santosh <[email protected]> * 2813 - Fix name of the index templates Signed-off-by: santosh <[email protected]> * 2813 - Rename ESPrefix to IndexPrefix for clarity & Implement @yurishkuro's feedback Signed-off-by: santosh <[email protected]> * 2813 - Fix fmt issue Signed-off-by: santosh <[email protected]> * 2813 - Fix issue with adding hyphen to index prefix Signed-off-by: santosh <[email protected]> * 2813 - Used golang embed package instead of esc to embed index templates & implement feedback on tests Signed-off-by: santosh <[email protected]>
Signed-off-by: santosh [email protected]
Resolves #2813Which problem is this PR solving?
Short description of the changes