elastic / elastic/package-spec
Input and integration packages allow any file at the root of the package
- Dominant language
- Go
- Stars
- 20
- Forks
- 93
- Avg merge
- 15h 10m
- Merged PRs (30d)
- 12
Description
Currently, input and integration packages allow to define any file or folder at the root of the working copy.
- integration:
https://github.com/elastic/package-spec/blob/18af7f05ce7186b13672b335b072c7e621ffb5fa/spec/integration/spec.yml#L7
- input:
https://github.com/elastic/package-spec/blob/18af7f05ce7186b13672b335b072c7e621ffb5fa/spec/input/spec.yml#L7
Content packages are the only ones that disallow that.
https://github.com/elastic/package-spec/blob/18af7f05ce7186b13672b335b072c7e621ffb5fa/spec/content/spec.yml#L7
Testing to disallow those extra files cause that current packages fail the validation with files or folders not allowed. Some examples found (not a full list):
```
1. item [img] is not allowed in folder [/home/user/Coding/work/integrations/packages/zscaler_zpa]
1. item [img] is not allowed in folder [/home/user/Coding/work/integrations/packages/ded]
1. item [img] is not allowed in folder [/home/user/Coding/work/integrations/packages/modsecurity]
2. item [kibana] is not allowed in folder [/home/user/Coding/work/integrations/packages/http_endpoint]
1. item [lifecycle.yml] is not allowed in folder [/home/user/Coding/work/integrations/packages/extrahop]
1. item [fields] is not allowed in folder [/home/user/Coding/work/integrations/packages/dga]
2. item [img] is not allowed in folder [/home/user/Coding/work/integrations/packages/dga]
1. item [kibana] is not allowed in folder [/home/user/Coding/work/integrations/packages/tcp]
2. item [system-test-note.md] is not allowed in folder [/home/user/Coding/work/integrations/packages/redisenterprise]
1. item [DEVELOPMENT.md] is not allowed in folder [/home/user/Coding/work/integrations/packages/tychon]
1. item [fields] is not allowed in folder [/home/user/Coding/work/integrations/packages/problemchild]
2. item [system-test-note.md] is not allowed in folder [/home/user/Coding/work/integrations/packages/iis]
...
```
A summary of the errors found:
- `img` folder defined in integration packages using spec version lower than 3.2.2
- Related to #777 and #793
- Most of the errors are related to this folder being present in integrations packages with spec < 3.2.2
- `kibana` folder defined in input packages
- input packages should not contain any kibana folder
- how does Fleet behave if this folder is defined?
- `fields` folder defined in integration packages.
- in integration packages, fields should be under data stream folders.
- extra markdown files: `DEVELOPMENT.md`, `system-test-note-md`
- should they be under `docs/`? should they be allowed ?
- extra yaml files: `lifecycle.yml`
- maybe just a leftover from some PR ?
Tested via https://github.com/elastic/package-spec/pull/992
Packages from integrations repository tested in https://github.com/elastic/integrations/pull/15500 (more than 250 packages failing in this test).
One option is to apply this change starting at a specific spec version.
In any case, it is needed to assess how to proceed with all these packages with extra files or folders if this change is applied.
Contributor guide
Assessment
This issue has not been assessed yet.