Conditional subobjects based on package version#2911
Merged
teresaromero merged 13 commits intoelastic:mainfrom Sep 18, 2025
Merged
Conditional subobjects based on package version#2911teresaromero merged 13 commits intoelastic:mainfrom
teresaromero merged 13 commits intoelastic:mainfrom
Conversation
jsoriano
reviewed
Sep 15, 2025
Member
jsoriano
left a comment
There was a problem hiding this comment.
Looks good 🎉 Added a couple of suggestions.
| } | ||
|
|
||
| func createDataStreamDescriptorFromAnswers(answers newDataStreamAnswers, packageRoot string) archetype.DataStreamDescriptor { | ||
| func createDataStreamDescriptorFromAnswers(answers newDataStreamAnswers, packageRoot string, specVersion *semver.Version) archetype.DataStreamDescriptor { |
Member
There was a problem hiding this comment.
Perhaps we could unit test this function, checking the manifest it generates for given answers.
Further testing could be added to internal/packages/archetype/data_stream_test.go, but we wouldn't be really testing if the behaviour changes for the format version used in the package.
Contributor
Author
There was a problem hiding this comment.
I've added some unit testing as suggested, also for the survey questions i've encapsulated this logic to at least check that the question is added or not based on the version.
Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>
…jects based on spec version
mrodm
reviewed
Sep 16, 2025
Contributor
mrodm
left a comment
There was a problem hiding this comment.
Looks great!
Just added some comments in tests to avoid possible errors.
Co-authored-by: Mario Rodriguez Molins <marrodmo@gmail.com>
Co-authored-by: Mario Rodriguez Molins <marrodmo@gmail.com>
Co-authored-by: Mario Rodriguez Molins <marrodmo@gmail.com>
Co-authored-by: Mario Rodriguez Molins <marrodmo@gmail.com>
Co-authored-by: Mario Rodriguez Molins <marrodmo@gmail.com>
Co-authored-by: Mario Rodriguez Molins <marrodmo@gmail.com>
mrodm
reviewed
Sep 16, 2025
Collaborator
💚 Build Succeeded
History
|
jsoriano
approved these changes
Sep 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #2832
The way to reproduce this bug is then the package has a spec version lower than 3.2.
Subobjects support was included after 3.2 so having this spec under the data-stream manifest in a package with lower version does not recognize the property of the data-stream manifest
Solution proposed is to skip the question for subobjects when a package spec version is under 3.2. The default value (false) should not be written at the manifest of data-stream