Initial support for content packages#2049
Conversation
| specVersion = *minSpecVersion | ||
| excludeChecks = append(excludeChecks, "PSR00002") |
There was a problem hiding this comment.
Currently, elastic-package create package it would create a content package with format_version: 3.2.2 (latest spec version published). Should it be set somehow here for content packages at least 3.4.0 ?
Just created a package, and when running elastic-package build, it shows these errors:
Error: building package failed: invalid content found in built zip package: found 6 validation errors:
1. package with non-stable semantic version and active beta features (enabled in [/home/user/Coding/work/elastic-package/build/packages/new_package-0.0.1.zip]) can't be released as stable version. (PSR00002)
2. item [LICENSE.txt] is not allowed in folder [/home/user/Coding/work/elastic-package/build/packages/new_package-0.0.1.zip]
3. item [changelog.yml] is not allowed in folder [/home/user/Coding/work/elastic-package/build/packages/new_package-0.0.1.zip]
4. item [docs] is not allowed in folder [/home/user/Coding/work/elastic-package/build/packages/new_package-0.0.1.zip]
5. item [img] is not allowed in folder [/home/user/Coding/work/elastic-package/build/packages/new_package-0.0.1.zip]
6. item [manifest.yml] is not allowed in folder [/home/user/Coding/work/elastic-package/build/packages/new_package-0.0.1.zip]
When updating the format_version to 3.4.0, it still reports this error:
Error: building package failed: invalid content found in built zip package: found 1 validation error:
1. package with non-stable semantic version and active beta features (enabled in [/home/mariorodriguez/Coding/work/elastic-package/build/packages/new_package-0.0.1.zip]) can't be released as stable version. (PSR00002)
There was a problem hiding this comment.
These are handled in the test case, I didn't add the exceptions to the real command to don't make it too easy to use content packages yet, and to avoid us having to remember to remove these exceptions when/if the package is released as GA.
Would you prefer that we add the exceptions in the command?
There was a problem hiding this comment.
Ah ok! Better to force to add the exceptions manually. No need to change anything then.
|
|
||
| } | ||
|
|
||
| if len(packageDescriptor.ExcludeChecks) > 0 { |
There was a problem hiding this comment.
There were no exclude checks when creating a content package. These are the files created:
$ elastic-package create package
Create a new package
? Package type: content
? Package name: new_package
? Version: 0.0.1
? License: Elastic-2.0
? Package title: New Package
? Description: This is a new package.
? Categories: custom
? Kibana version constraint: ^8.15.1
? Required Elastic subscription: basic
? Github owner: elastic/integrations
? Owner type: elastic
New package has been created: new_package
Done
$ cd new_package
$ ls -l
total 20
-rw-r--r-- 1 user user 226 sep 9 18:22 changelog.yml
drwxr-xr-x 2 user user 4096 sep 9 18:22 docs
drwxr-xr-x 2 user user 4096 sep 9 18:22 img
-rw-rw-r-- 1 user user 3860 sep 9 18:22 LICENSE.txt
-rw-r--r-- 1 user user 560 sep 9 18:26 manifest.yml
There was a problem hiding this comment.
That's correct. I added this mainly for testing by now.
💚 Build Succeeded
cc @jsoriano |
elastic-package create package.Part of #2048
Part of elastic/package-spec#351