elastic / elastic/package-spec

Expose a package "loader" functionality

Open
#322 2 comments 0 reactions 0 assignees View on GitHub
Team:Ecosystem
Dominant language
Go
Stars
20
Forks
93
Avg merge
15h 10m
Merged PRs (30d)
12

Description

Package spec currently exposes validation functionality through the `validator` package. Create another package, `loader`, with package loading functionality, to read the contents of packages in a best-effort basis, without requiring strict validation.

Ideally this loader could be mostly auto-generated from the package spec itself. It could access content in a lazy way, so parsing is only done for what is needed for each application. It should be tolerant to failures, so content can be accessed even if the package is partially invalid or incomplete. This loader would abstract handling of different format versions or package types.

Partial package loading functionality is required in several places, each of them is currently maintaining their specific implementation:
* Indexers read packages. Package registry reads packages to index them. Package storage v2 indexer will also need to read packages to generate indexes.
* Kibana reads packages. Exposing information from packages was requested as [feedback for the wasm poc](https://github.com/elastic/package-spec/pull/285#issuecomment-1075363107).
* `elastic-package` reads packages manifests and fields files.
* Documentation exporters read the manifest and documentation files.

This loader wouldn't mean that we discourage third-party implementations of package consumers, the specification would still be there the same way as it is now. In that sense this loader could be seen as a sample implementation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.