Part of #3277.
Summary
Implement local resolution for required input packages so a composable integration and its input packages can be developed in the same repository without publishing to EPR first.
This is the follow-up tracked from PR #3459 review
Spec alignment
Package spec defines package_requirement as a oneOf:
package + version → exact version from the registry, or
source → relative path to the source of the required package, which overrides downloading that package from EPR for tests.
Reference: config.spec.yml — package_requirement.
For elastic-package, we want the same override idea for the build/install path: when source is present for a required input, resolve that path (relative to the integration package root) and use it instead of DownloadPackage from the registry.
Current behavior
RequiredInputsResolver.mapRequiredInputPackagesPaths in internal/requiredinputs/requiredinputs.go only downloads via the EPR client.
openPackageFS already supports directory and zip once a filesystem path is available.
Scope / acceptance criteria (proposal)
-
Model: Extend requires.input dependency representation (e.g. internal/packages.PackageDependency) so each entry can be either { package, version } or { source }, consistent with package-spec’s package_requirement oneOf (mutually exclusive; validate errors if both or neither where inappropriate).
-
Resolve source: Interpret source as a path relative to the composable package root (same spirit as spec: relative path to required package source). Resolve to an absolute path, then either use it as a built package directory/zip or build the input package from source into a temp output if the path is source (team decision: require pre-built vs auto-elastic-package build).
-
Wire into resolver: mapRequiredInputPackagesPaths (or equivalent) chooses EPR download vs local path per entry; downstream bundling unchanged aside from the map values.
-
Spec / publishing: Ensure published manifest.yml behavior remains sane (e.g. source only for local dev, stripped or disallowed in published artifacts if required)—coordinate with package-spec if manifest.yml schema for requires.input must be updated to include source.
-
Tests: Add coverage with a fixture under test/packages/ or test/manual_packages/ that uses source and does not hit EPR for that dependency.
Related code
internal/requiredinputs/requiredinputs.go — mapRequiredInputPackagesPaths, openPackageFS, Bundle
internal/packages/packages.go — PackageDependency, Requires.Input
cmd/build.go (and other commands that construct RequiredInputsResolver) — may need profile/registry only when source is absent
cc @jsoriano (original review)
Part of #3277.
Summary
Implement local resolution for required input packages so a composable integration and its input packages can be developed in the same repository without publishing to EPR first.
This is the follow-up tracked from PR #3459 review
Spec alignment
Package spec defines
package_requirementas a oneOf:package+version→ exact version from the registry, orsource→ relative path to the source of the required package, which overrides downloading that package from EPR for tests.Reference:
config.spec.yml—package_requirement.For elastic-package, we want the same override idea for the build/install path: when
sourceis present for a required input, resolve that path (relative to the integration package root) and use it instead ofDownloadPackagefrom the registry.Current behavior
RequiredInputsResolver.mapRequiredInputPackagesPathsininternal/requiredinputs/requiredinputs.goonly downloads via the EPR client.openPackageFSalready supports directory and zip once a filesystem path is available.Scope / acceptance criteria (proposal)
Model: Extend
requires.inputdependency representation (e.g.internal/packages.PackageDependency) so each entry can be either{ package, version }or{ source }, consistent with package-spec’spackage_requirementoneOf (mutually exclusive; validate errors if both or neither where inappropriate).Resolve
source: Interpretsourceas a path relative to the composable package root (same spirit as spec: relative path to required package source). Resolve to an absolute path, then either use it as a built package directory/zip or build the input package from source into a temp output if the path is source (team decision: require pre-built vs auto-elastic-package build).Wire into resolver:
mapRequiredInputPackagesPaths(or equivalent) chooses EPR download vs local path per entry; downstream bundling unchanged aside from the map values.Spec / publishing: Ensure published
manifest.ymlbehavior remains sane (e.g.sourceonly for local dev, stripped or disallowed in published artifacts if required)—coordinate with package-spec ifmanifest.ymlschema forrequires.inputmust be updated to includesource.Tests: Add coverage with a fixture under
test/packages/ortest/manual_packages/that usessourceand does not hit EPR for that dependency.Related code
internal/requiredinputs/requiredinputs.go—mapRequiredInputPackagesPaths,openPackageFS,Bundleinternal/packages/packages.go—PackageDependency,Requires.Inputcmd/build.go(and other commands that constructRequiredInputsResolver) — may need profile/registry only whensourceis absentcc @jsoriano (original review)