Adding initial spec files#1
Adding initial spec files#1ycombinator merged 45 commits intoelastic:masterfrom ycombinator:init-spec
Conversation
| type: string | ||
| enum: | ||
| - custom | ||
| default_field: |
There was a problem hiding this comment.
@jonathan-buttner I saw this default_field field used here https://github.com/elastic/package-registry/blob/98d7184cfe5b1d271e1bef848a5720073959888e/testdata/package/ecs_style_dataset/0.0.1/dataset/foo/fields/fields.yml#L16. Could you tell me what it is meant for so I could appropriately describe it in this schema here? Thanks!
There was a problem hiding this comment.
@ycombinator I think we got rid of default_field and it was replaced by show_user and some others. So this is only here because it was not cleaned up. Found it also in other places.
There was a problem hiding this comment.
Sorry, ignore my comment above, just realised this is fields.yml.
There was a problem hiding this comment.
We can ignore this one too I think:
It is outputted by the ECS beats tooling:
https://github.com/elastic/ecs/blob/master/scripts/generators/beats_default_fields_whitelist.yml
https://github.com/elastic/ecs/blob/master/generated/beats/fields.ecs.yml#L77
I'm not even really sure what it is used for 🤷
There was a problem hiding this comment.
No idea at all, I think you can safely ignore/remove this field from spec.
There was a problem hiding this comment.
Okay, I will remove it from the spec, similar to the level and group fields which were removed in dd76b6d.
masci
left a comment
There was a problem hiding this comment.
Versioning looks very good to me, thanks for working on it!
|
@ycombinator The registry running under All of this should not hold back this PR from merging. |
Co-authored-by: Massimiliano Pippi <mpippi@gmail.com>
|
Thanks for the explanation, @ruflin. I agree that the breaking changes should not hold back this PR. However, it means that we can't use the I looked through the comments in this PR and there are a few that are awaiting your responses. I've gathered them below for your convenience. If you could take a few minutes to respond to them, it would help move along this PR. Thanks! |
| description: Base fields definitions | ||
| type: file | ||
| name: "base-fields.yml" | ||
| required: true |
There was a problem hiding this comment.
Hmm can we make this required: false the endpoint package doesn't include this file. We include the fields directly in fields.yml. Should we allow the package developer to call the file whatever they want? Would it be easy to just validate that the directory isn't empty and that the file conforms to the fields.spec.yml?
There was a problem hiding this comment.
Yeah, I'm happy to change this to whatever matches the actual usage/parsing of these files. I don't know what that is, though! Are the files merged together somehow? If so, is there some ordering/precedence taken into account while merging?
There was a problem hiding this comment.
The file can have any name and merging order should not matter, at least so far.
|
@jonathan-buttner One I couldn't answer in line (not sure why) was around integrations vs solution. We introduced solutions as in the beginning we expected to never show the endpoint package to users but this changed. So having it as @ycombinator I have not been very good in following up on all comments, but please do not block on me to get this in. There will be breaking changes in this spec for the upcoming Ship it. |
|
Many thanks to @jonathan-buttner, @mtojek, @masci, and @ruflin for reviewing this PR so thoroughly! I believe all your concerns have been addressed at this point. The initial spec in this PR may not be 100% accurate yet but I think it's in decent enough shape to get us started. I fully expect us to iterate on this in the coming weeks, especially once we start validating packages against it! To indicate that this initial spec is not quite ready for general consumption, I have done two things:
With that, I'm planning to merge this PR and then make this repository public later today. If anyone has any last-minute concerns please bring them up within the next few hours. Thank you! |
versions/1/dataset/manifest.spec.yml
Outdated
| - title | ||
| - description | ||
| - input | ||
| # https://github.com/elastic/package-registry/blob/v0.8.0/util/dataset.go#L48 |
There was a problem hiding this comment.
I believe it would be safer to refer through a commit id.
There was a problem hiding this comment.
I'm actually considering removing these comments. I had put them in there for my own benefit to make sure I had accounted for most of the struct fields in the spec.
This PR adds specification files for the initial package specification (
format_version= 1.0.0, which is what all packages today are using). The specification files describe:For 1. above, a schema very similar to JSON Schema is used (but written as YAML for readability), with two notable differences:
typefield can be eitherfolderorfile, andcontentsis introduced to (recursively) describe the contents of folders (i.e. whentype==folder).For 2. above, JSON Schema is used (but, again, written as YAML for readability).
Additionally, this PR adds a
README.mdfile explaining the specification format.Resolves #2.
Author's TODO