Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a7f3b21
Add scripts to prepare distributions
jsoriano May 16, 2025
6e0af0f
Merge remote-tracking branch 'origin/main' into cmd-distribution-scripts
jsoriano Jul 5, 2025
e70a21c
Run actions in parallel
jsoriano Jul 5, 2025
10118ea
Select lite packages per version
jsoriano Jul 5, 2025
b31b25e
Add 8.19 and 9.1
jsoriano Jul 5, 2025
0b47e15
linting
jsoriano Jul 7, 2025
d93fdf9
Merge remote-tracking branch 'origin/main' into cmd-distribution-scripts
jsoriano Aug 5, 2025
10b90f5
Merge remote-tracking branch 'origin/main' into cmd-distribution-scripts
jsoriano Nov 14, 2025
9cc14d4
Support pinned package versions
jsoriano Nov 14, 2025
a967daa
Reuse existing packages
jsoriano Nov 15, 2025
8aa3e5b
Add Dockerfile
jsoriano Nov 15, 2025
1148a75
Add sample for pinned versions
jsoriano Nov 16, 2025
3ac5e33
Use ProtonMail fork of opengpg
jsoriano Nov 17, 2025
e6ca112
Use github.com/Masterminds/semver/v3
jsoriano Nov 17, 2025
973d306
Merge remote-tracking branch 'origin/main' into cmd-distribution-scripts
jsoriano Jan 20, 2026
ce4573e
Merge remote-tracking branch 'origin/main' into cmd-distribution-scripts
jsoriano Jan 23, 2026
468598f
Remove unused dockerfile
jsoriano Feb 9, 2026
ff94b0d
Merge remote-tracking branch 'origin/main' into cmd-distribution-scripts
jsoriano Feb 9, 2026
5ecac86
Apply comments from review
jsoriano Feb 10, 2026
dcc6d5e
Add tests, fix race condition
jsoriano Feb 10, 2026
a4bc751
Fix tests
jsoriano Feb 10, 2026
35463c9
Move cmd/distribution to its own module
jsoriano Feb 10, 2026
135ac07
Merge remote-tracking branch 'origin/main' into cmd-distribution-scripts
jsoriano Feb 10, 2026
edcd868
Update AGENTS.md with recommendations about the use of require and as…
jsoriano Feb 10, 2026
e9ee6c9
Update magefile
jsoriano Feb 10, 2026
002720e
Remove too specific readme section
jsoriano Feb 10, 2026
27ae7af
Address some small issues
jsoriano Feb 10, 2026
e628e53
Fix test names
jsoriano Feb 10, 2026
787984d
Apply suggestions from review
jsoriano Feb 10, 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
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ updates:
elastic-apm:
patterns:
- "go.elastic.co/apm/*"
- package-ecosystem: "gomod"
directory: "/cmd/distribution"
schedule:
interval: "daily"
labels:
- automation
open-pull-requests-limit: 10
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
package-registry
cmd/distribution/distribution

.idea
*.iml
Expand Down
19 changes: 19 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,25 @@ Test packages are stored in `testdata/package/` with various scenarios (e.g., `d
- **Import grouping**: Elastic packages (`github.com/elastic`) grouped after third-party
- Run `mage check` before committing to ensure formatting and licensing

### Testing Assertions

When using testify for test assertions:
- Use **`require`** only for blocking assertions that would cause panics if they fail (e.g., nil checks before dereferencing)
- Use **`assert`** for all other assertions so multiple checks can run in the same test
- This approach provides better test failure visibility by showing all failing assertions at once

Example:
```go
// Use require for blocking checks
require.NotNil(t, result) // Must pass or dereferencing will panic
require.NoError(t, err) // Must pass or result may be invalid

// Use assert for validation checks
assert.Equal(t, "expected", result.Name)
assert.True(t, result.IsValid)
assert.Len(t, result.Items, 3)
```

### Package Structure

Packages follow the [package-spec](https://github.com/elastic/package-spec) specification. Changes to package structure should be proposed to package-spec first.
Expand Down
31 changes: 31 additions & 0 deletions cmd/distribution/GPG-KEY-elasticsearch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQENBFI3HsoBCADXDtbNJ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Dxl3gpS6nHZ9Gsnfr/kcH9/11
Ca73HBtmGVIkOI1mZKMbANO8cewY/i7fPxShu7B0Rb3jxVNGUuiRcfRiao0gWx0U
ZGpvuHplt7loFX2cbsHFAp9WsjYEbSohb/Y0K4NkyFhL82MfbcsEwsXPhRTFgJWw
s4vpuFg/kFFlnw0NNPVP1jNJLNCsMBMEpP1A7k6MRpylNnUAEQEAAYkBNgQYAQgA
IAIbDBYhBEYJWsyFSFgsGiaZqdJ9ZmzYjkK0BQJk9vsHAAoJENJ9ZmzYjkK0hWsH
/ArKtn12HM3+41zYo9qO4rTri7+IYTjSB/JDTOusZgZLd/HCp1xQo4SI2Eur3Rtx
USMWK1LEeBzsjwDT9yVceYekrBEqUVyRMSVYj+UeZK2s4LbXm9b4jxXVtaivmkMA
jtznndrD7kmm8ak+UsZplf6p6uZS9TZ9hjwoMmw5oMaS6TZkLT4KYGWeyzHJSUBX
YikY6vssDQu4SJ07m1f4Hz81J39QOcHln5I5HTK8Rh/VUFcxNnGg9360g55wWpiF
eUTeMyoXpOtffiUhiOtbRYsmSYC0D4Fd5yJnO3n1pwnVVVsM7RAC22rc5j/Dw8dR
GIHikRcYWeXTYW7veewK5Ss=
=ftS0
-----END PGP PUBLIC KEY BLOCK-----
1 change: 1 addition & 0 deletions cmd/distribution/Makefile
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need a copy of Makefile from root here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To have the same release targets, though I could remove it as this is not used by now...

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../Makefile
69 changes: 69 additions & 0 deletions cmd/distribution/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Distribution Tool

A utility for downloading packages from Elastic Package Registry (EPR).

## Overview

The distribution tool allows you to collect and download integration packages from an EPR instance based on configurable search queries. It supports filtering by package type, Kibana version, spec version, and other parameters.

## Building

```bash
cd cmd/distribution
go build
```

Or install directly:

```bash
go install github.com/elastic/package-registry/cmd/distribution@latest
```

## Usage

```bash
./distribution <config.yaml>
```

The tool requires a YAML configuration file that defines:
- **address**: EPR endpoint to query (defaults to `https://epr.elastic.co`)
- **queries**: Search parameters to filter packages
- **matrix**: Parameter combinations to expand queries
- **packages**: Specific packages to include by name and version
- **actions**: Operations to perform (print, download, validate)

See `minimal.yaml` and `lite-all.yaml` for example configurations.

## Configuration Examples

### Minimal Configuration
```yaml
address: https://epr.elastic.co
queries:
- package: nginx
actions:
- print: {}
```

### Download with Validation
```yaml
address: https://epr.elastic.co
queries:
- type: integration
kibana.version: 8.0.0
actions:
- download:
destination: ./packages
validate: true
```

## Actions

- **print**: Output package names and versions to console
- **download**: Download package ZIP files and signatures
- `destination`: Target directory for downloads
- `validate`: Verify package signatures using GPG

## Dependencies

Managed via Go modules. Run `go mod tidy` to update dependencies.
Loading