-
Notifications
You must be signed in to change notification settings - Fork 127
Conditional subobjects based on package version #2911
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
base: main
Are you sure you want to change the base?
Conversation
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.
Looks good 🎉 Added a couple of suggestions.
@@ -183,14 +193,14 @@ func createDataStreamCommandAction(cmd *cobra.Command, args []string) error { | |||
return nil | |||
} | |||
|
|||
func createDataStreamDescriptorFromAnswers(answers newDataStreamAnswers, packageRoot string) archetype.DataStreamDescriptor { | |||
func createDataStreamDescriptorFromAnswers(answers newDataStreamAnswers, packageRoot string, specVersion *semver.Version) archetype.DataStreamDescriptor { |
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.
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.
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 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
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.
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>
💔 Build Failed
Failed CI StepsHistory
|
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