Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4f25ab8
chore: update package-spec to pre-release version
teresaromero Mar 3, 2026
adf728b
feat: extend manifest types for required input packages
teresaromero Mar 3, 2026
3ecf9d6
feat: implement input package template bundling
teresaromero Mar 3, 2026
eba23df
feat: wire registry client and requires overrides into build and test…
teresaromero Mar 3, 2026
b43bf5b
docs: document composable integrations and local registry usage
teresaromero Mar 4, 2026
5da820b
chore: update with latests package-spec. this commit should be revert…
teresaromero Mar 4, 2026
09fdab8
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero Mar 4, 2026
7468026
use profile epr url on install command. update readme
teresaromero Mar 10, 2026
50c3b2b
Revert "update readme"
teresaromero Mar 10, 2026
a690ef0
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero Mar 10, 2026
d76ffad
Update dependency management documentation to clarify package depende…
teresaromero Mar 11, 2026
ad98db8
Add TLS support to registry client
teresaromero Mar 11, 2026
5d69e4b
Add bundle policy templates input package handling and tests
teresaromero Mar 12, 2026
1d8e4dd
Add bundle data stream templates handling and tests
teresaromero Mar 12, 2026
11fe9df
Add YAML utility functions for mapping and formatting
teresaromero Mar 12, 2026
22047e8
Add function to read and unpack data stream manifest bytes
teresaromero Mar 12, 2026
2cd96e7
refactor bundle templates for builder
teresaromero Mar 12, 2026
9f6ade8
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero Mar 12, 2026
e490bb3
remove overrides implementation
teresaromero Mar 12, 2026
c91a537
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero Mar 12, 2026
d9a438d
Update manifest.yml to replace sql_input with test_input_pkg and adju…
teresaromero Mar 13, 2026
39c787c
refactor and fixing injection into installer and builder. naming refa…
teresaromero Mar 13, 2026
6d40f8e
remove default empty template option
teresaromero Mar 13, 2026
85990e2
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero Mar 13, 2026
0ba7f63
Remove FindPackageInRepo function from packages.go
teresaromero Mar 13, 2026
dbe671b
rename PackageRef
teresaromero Mar 13, 2026
8337f12
Refactor YAML utility functions to use slices.IndexFunc for improved …
teresaromero Mar 13, 2026
9c3301f
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero Mar 18, 2026
cabe0a3
feat: gate data stream template bundling on explicit data_streams ass…
teresaromero Mar 18, 2026
3dc281d
chore: update package-spec dependency to v3.5.8 in go.mod and go.sum
teresaromero Mar 19, 2026
df6a557
revert: remove data_streams gating for template bundling
teresaromero Mar 19, 2026
42ad433
docs: update howto guide
teresaromero Mar 19, 2026
1366c46
fix: prevent nil panic and Windows path failures in required inputs r…
teresaromero Mar 19, 2026
f4d026b
test: ensure proper resource cleanup in policy templates and streams …
teresaromero Mar 19, 2026
86557d8
tests: update test script to include test package into stack registry
teresaromero Mar 19, 2026
0f962e7
Move required_inputs fixtures to test/manual_packages
teresaromero Mar 23, 2026
32c11ae
Revert "tests: update test script to include test package into stack …
teresaromero Mar 23, 2026
32a2ff5
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero Mar 23, 2026
6cf85da
requiredinputs: open directory packages with os.Root for fs.FS
teresaromero Mar 25, 2026
3e850ca
Improve requiredinputs error messages with consistent wording
teresaromero Mar 25, 2026
4c381ed
docs: fix standalone package registry Docker image in HOWTO
teresaromero Mar 25, 2026
f0eebb2
Align docs with package-registry and elastic-package
teresaromero Mar 26, 2026
7ce8e8f
Export requiredinputs.Resolver and remove duplicate interfaces
teresaromero Mar 26, 2026
95c83df
Merge branch 'main' of github.com:elastic/elastic-package into 3278-b…
teresaromero Mar 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ Built packages are served up by the Elastic Package Registry running locally (se

Built packages can also be published to the global package registry service.

When the package declares required input packages ("requires.input" in manifest.yml), the build downloads those input packages from the configured package registry (see "package_registry.base_url" in ~/.elastic-package/config.yml). For details on using a local or custom registry during development, see the [HOWTO guide](./docs/howto/local_package_registry.md).

For details on how to enable dependency management, see the [HOWTO guide](https://github.com/elastic/elastic-package/blob/main/docs/howto/dependency_management.md).

### `elastic-package changelog`
Expand Down
28 changes: 28 additions & 0 deletions cmd/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import (
"github.com/elastic/elastic-package/internal/install"
"github.com/elastic/elastic-package/internal/logger"
"github.com/elastic/elastic-package/internal/packages"
"github.com/elastic/elastic-package/internal/registry"
"github.com/elastic/elastic-package/internal/requiredinputs"
"github.com/elastic/elastic-package/internal/signal"
"github.com/elastic/elastic-package/internal/stack"
"github.com/elastic/elastic-package/internal/testrunner"
Expand Down Expand Up @@ -331,6 +333,18 @@ func rallyCommandAction(cmd *cobra.Command, args []string) error {
return fmt.Errorf("can't create Kibana client: %w", err)
}

appConfig, err := install.Configuration()
if err != nil {
return fmt.Errorf("can't load configuration: %w", err)
}

baseURL := appConfig.PackageRegistryBaseURL()
eprClient := registry.NewClient(baseURL, stack.RegistryClientOptions(baseURL, profile)...)
requiredInputsResolver, err := requiredinputs.NewRequiredInputsResolver(eprClient)
if err != nil {
return fmt.Errorf("creating required inputs resolver failed: %w", err)
}

withOpts := []rally.OptionFunc{
rally.WithVariant(variant),
rally.WithBenchmarkName(benchName),
Expand All @@ -344,6 +358,7 @@ func rallyCommandAction(cmd *cobra.Command, args []string) error {
rally.WithRallyPackageFromRegistry(packageName, packageVersion),
rally.WithRallyCorpusAtPath(corpusAtPath),
rally.WithRepositoryRoot(repositoryRoot),
rally.WithRequiredInputsResolver(requiredInputsResolver),
}

esMetricsClient, err := initializeESMetricsClient(ctx)
Expand Down Expand Up @@ -506,6 +521,18 @@ func streamCommandAction(cmd *cobra.Command, args []string) error {
return fmt.Errorf("can't create Kibana client: %w", err)
}

appConfig, err := install.Configuration()
if err != nil {
return fmt.Errorf("can't load configuration: %w", err)
}

baseURL := appConfig.PackageRegistryBaseURL()
eprClient := registry.NewClient(baseURL, stack.RegistryClientOptions(baseURL, profile)...)
requiredInputsResolver, err := requiredinputs.NewRequiredInputsResolver(eprClient)
if err != nil {
return fmt.Errorf("creating required inputs resolver failed: %w", err)
}

withOpts := []stream.OptionFunc{
stream.WithVariant(variant),
stream.WithBenchmarkName(benchName),
Expand All @@ -519,6 +546,7 @@ func streamCommandAction(cmd *cobra.Command, args []string) error {
stream.WithKibanaClient(kc),
stream.WithProfile(profile),
stream.WithRepositoryRoot(repositoryRoot),
stream.WithRequiredInputsResolver(requiredInputsResolver),
}

runner := stream.NewStreamBenchmark(stream.NewOptions(withOpts...))
Expand Down
35 changes: 27 additions & 8 deletions cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import (
"github.com/elastic/elastic-package/internal/install"
"github.com/elastic/elastic-package/internal/logger"
"github.com/elastic/elastic-package/internal/packages"
"github.com/elastic/elastic-package/internal/profile"
"github.com/elastic/elastic-package/internal/registry"
"github.com/elastic/elastic-package/internal/requiredinputs"
"github.com/elastic/elastic-package/internal/stack"
)

const buildLongDescription = `Use this command to build a package.
Expand All @@ -26,6 +30,8 @@ Built packages are served up by the Elastic Package Registry running locally (se

Built packages can also be published to the global package registry service.

When the package declares required input packages ("requires.input" in manifest.yml), the build downloads those input packages from the configured package registry (see "package_registry.base_url" in ~/.elastic-package/config.yml). For details on using a local or custom registry during development, see the [HOWTO guide](./docs/howto/local_package_registry.md).

For details on how to enable dependency management, see the [HOWTO guide](https://github.com/elastic/elastic-package/blob/main/docs/howto/dependency_management.md).`

func setupBuildCommand() *cobraext.Command {
Expand Down Expand Up @@ -84,15 +90,28 @@ func buildCommandAction(cmd *cobra.Command, args []string) error {
return fmt.Errorf("can't load configuration: %w", err)
}

baseURL := appConfig.PackageRegistryBaseURL()
prof, err := profile.LoadProfile(appConfig.CurrentProfile())
if err != nil {
return fmt.Errorf("could not load profile: %w", err)
}
eprClient := registry.NewClient(baseURL, stack.RegistryClientOptions(baseURL, prof)...)

requiredInputsResolver, err := requiredinputs.NewRequiredInputsResolver(eprClient)
if err != nil {
return fmt.Errorf("creating required inputs resolver failed: %w", err)
}

target, err := builder.BuildPackage(builder.BuildOptions{
PackageRoot: packageRoot,
BuildDir: buildDir,
CreateZip: createZip,
SignPackage: signPackage,
SkipValidation: skipValidation,
RepositoryRoot: repositoryRoot,
UpdateReadmes: true,
SchemaURLs: appConfig.SchemaURLs(),
PackageRoot: packageRoot,
BuildDir: buildDir,
CreateZip: createZip,
SignPackage: signPackage,
SkipValidation: skipValidation,
RepositoryRoot: repositoryRoot,
UpdateReadmes: true,
SchemaURLs: appConfig.SchemaURLs(),
RequiredInputsResolver: requiredInputsResolver,
})
if err != nil {
return fmt.Errorf("building package failed: %w", err)
Expand Down
23 changes: 17 additions & 6 deletions cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
"github.com/elastic/elastic-package/internal/kibana"
"github.com/elastic/elastic-package/internal/packages"
"github.com/elastic/elastic-package/internal/packages/installer"
"github.com/elastic/elastic-package/internal/registry"
"github.com/elastic/elastic-package/internal/requiredinputs"
"github.com/elastic/elastic-package/internal/stack"
)

Expand Down Expand Up @@ -92,13 +94,22 @@ func installCommandAction(cmd *cobra.Command, _ []string) error {
return fmt.Errorf("can't load configuration: %w", err)
}

baseURL := stack.PackageRegistryBaseURL(profile, appConfig)
eprClient := registry.NewClient(baseURL, stack.RegistryClientOptions(baseURL, profile)...)

requiredInputsResolver, err := requiredinputs.NewRequiredInputsResolver(eprClient)
if err != nil {
return fmt.Errorf("creating required inputs resolver failed: %w", err)
}

installer, err := installer.NewForPackage(installer.Options{
Kibana: kibanaClient,
PackageRoot: packageRoot,
SkipValidation: skipValidation,
ZipPath: zipPathFile,
RepositoryRoot: repositoryRoot,
SchemaURLs: appConfig.SchemaURLs(),
Kibana: kibanaClient,
PackageRoot: packageRoot,
SkipValidation: skipValidation,
ZipPath: zipPathFile,
RepositoryRoot: repositoryRoot,
SchemaURLs: appConfig.SchemaURLs(),
RequiredInputsResolver: requiredInputsResolver,
})
if err != nil {
return fmt.Errorf("package installation failed: %w", err)
Expand Down
30 changes: 20 additions & 10 deletions cmd/testrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
"github.com/elastic/elastic-package/internal/install"
"github.com/elastic/elastic-package/internal/logger"
"github.com/elastic/elastic-package/internal/packages"
"github.com/elastic/elastic-package/internal/registry"
"github.com/elastic/elastic-package/internal/requiredinputs"
"github.com/elastic/elastic-package/internal/signal"
"github.com/elastic/elastic-package/internal/stack"
"github.com/elastic/elastic-package/internal/testrunner"
Expand Down Expand Up @@ -870,19 +872,27 @@ func testRunnerPolicyCommandAction(cmd *cobra.Command, args []string) error {
return fmt.Errorf("can't load configuration: %w", err)
}

baseURL := appConfig.PackageRegistryBaseURL()
eprClient := registry.NewClient(baseURL, stack.RegistryClientOptions(baseURL, profile)...)
requiredInputsResolver, err := requiredinputs.NewRequiredInputsResolver(eprClient)
if err != nil {
return fmt.Errorf("creating required inputs resolver failed: %w", err)
}

logger.Info(version.Version())
logger.Infof("elastic-stack: %s", stackVersion.Version())
runner := policy.NewPolicyTestRunner(policy.PolicyTestRunnerOptions{
PackageRoot: packageRoot,
KibanaClient: kibanaClient,
DataStreams: dataStreams,
FailOnMissingTests: failOnMissing,
GenerateTestResult: generateTestResult,
GlobalTestConfig: globalTestConfig.Policy,
WithCoverage: testCoverage,
CoverageType: testCoverageFormat,
RepositoryRoot: repositoryRoot,
SchemaURLs: appConfig.SchemaURLs(),
PackageRoot: packageRoot,
KibanaClient: kibanaClient,
DataStreams: dataStreams,
FailOnMissingTests: failOnMissing,
GenerateTestResult: generateTestResult,
GlobalTestConfig: globalTestConfig.Policy,
WithCoverage: testCoverage,
CoverageType: testCoverageFormat,
RepositoryRoot: repositoryRoot,
SchemaURLs: appConfig.SchemaURLs(),
RequiredInputsResolver: requiredInputsResolver,
})

results, err := testrunner.RunSuite(ctx, runner)
Expand Down
45 changes: 42 additions & 3 deletions docs/howto/dependency_management.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,22 @@ which field definition was correct, maintenance and typo correction process was
The described situation brought us to a point in time when a simple dependency management was a requirement to maintain
all used fields, especially ones imported from external sources.

Elastic Packages support two kinds of build-time dependency:

- **Field dependencies** — import field definitions from external schemas (e.g. ECS) using
`_dev/build/build.yml`. Resolved from Git references and cached locally.
- **Package dependencies** — composable (integration) packages can depend on input and content packages
declared under `requires` in `manifest.yml`. **Input package** dependencies are resolved
at build time by downloading from the package registry. **Content package** dependencies are
resolved at runtime by Fleet.

Both are described in the sections below.

## Principles of operation

Currently Elastic Packages support build-time dependencies that can be used as external field sources. They use a flat
dependency model represented with an additional build manifest, stored in an optional YAML file - `_dev/build/build.yml`:
Currently Elastic Packages support build-time field dependencies that can be used as external
field sources. They use a flat dependency model represented with an additional build manifest,
stored in an optional YAML file - `_dev/build/build.yml`:

```yaml
dependencies:
Expand Down Expand Up @@ -83,4 +95,31 @@ and use a following field definition:
```yaml
- name: event.category
external: ecs
```
```

## Composable packages and the package registry

Composable (integration) packages can also depend on input or content packages by declaring them under
`requires` in `manifest.yml`. Depending on the package type, dependencies are resolved
differently: **input package** dependencies are fetched at build time; **content package**
dependencies are resolved at runtime by Fleet.

```yaml
requires:
input:
- package: sql_input
version: "0.2.0"
```

This type of dependency is resolved at **build time** by downloading the required input package
from the **package registry**. During `elastic-package build`, agent templates from the
required input packages are fetched and bundled into the built integration so that Fleet can
merge them at policy creation time.

Unlike field-level dependencies (which are resolved from Git references and cached locally),
package dependencies are fetched from the configured package registry URL
(`package_registry.base_url` in `~/.elastic-package/config.yml`, defaulting to
`https://epr.elastic.co`).

For details on using a local or custom registry when the required input packages are still
under development, see [HOWTO: Use a local or custom package registry](./local_package_registry.md).
Loading