Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define build time dependencies #181

Merged
merged 10 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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: 1 addition & 1 deletion code/go/internal/spec/statik.go

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions test/packages/good/deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build:
Copy link
Member

Choose a reason for hiding this comment

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

Is build redundant now here? What other dependencies can be in this file? If at some moment there are runtime dependencies they will need to be in the manifest, or somewhere downloaded by Kibana.

Suggested change
build:

Or perhaps this file can be called build.yml in case we need more things in the future only in build time. And this key could be called dependencies.

Suggested change
build:
dependencies:

Copy link
Contributor Author

@mtojek mtojek Jun 9, 2021

Choose a reason for hiding this comment

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

I'm ok with build.yml too, although this may suggest to introduce more side features into it :)

We have also _dev directory, maybe this one is a better fit? For example: _dev/build/deps.yml. WDYT? Currently we're using the _dev/build/docs to render README files.

Copy link
Contributor Author

@mtojek mtojek Jun 10, 2021

Choose a reason for hiding this comment

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

I adjusted the PR to use build.yml in the package root directory.

- name: ecs
version: "1.9"
reference: git@7a11f3e1f7d8f05e8f06623fd98254b8cb34c441
5 changes: 4 additions & 1 deletion versions/1/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,7 @@
link: https://github.com/elastic/package-spec/pull/176
- description: Validate if field groups don't have units and metric types defined
type: enhancement
link: https://github.com/elastic/package-spec/pull/183
link: https://github.com/elastic/package-spec/pull/183
- description: Define build-time dependencies
type: enhancement
link: https://github.com/elastic/package-spec/pull/181
32 changes: 32 additions & 0 deletions versions/1/deps.spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
##
## Describes the specification for the package's main manifest.yml file
##
spec:
# Everything under here follows JSON schema (https://json-schema.org/), written as YAML for readability
type: object
additionalProperties: false
properties:
build:
type: array
description: Build-time dependencies
items:
type: object
additionalProperties: false
properties:
name:
type: string
description: Name of the dependency
enum:
- ecs
version:
type: string
description: Version of the dependency
reference:
type: string
description: Source reference
pattern: 'git@[a-z0-9]{40}'
required:
- name
- reference
required:
- build
28 changes: 28 additions & 0 deletions versions/1/manifest.spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,34 @@ spec:
pattern: '^(([a-zA-Z0-9-]+)|([a-zA-Z0-9-]+\/[a-zA-Z0-9-]+))$'
required:
- github
build:
type: object
additionalProperties: false
properties:
dependencies:
type: array
description: Build-time dependencies
items:
type: object
additionalProperties: false
properties:
name:
type: string
description: Name of the dependency
enum:
- ecs
version:
type: string
description: Version of the dependency
reference:
type: string
description: Source reference
pattern: 'git@[a-z0-9]{40}'
required:
- name
- reference
required:
- dependencies
required:
- format_version
- name
Expand Down
5 changes: 5 additions & 0 deletions versions/1/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ spec:
name: "manifest.yml"
required: true
$ref: "./manifest.spec.yml"
- description: Package dependencies manifest
type: file
contentMediaType: "application/x-yaml"
name: "deps.yml"
$ref: "./deps.spec.yml"
- description: The package's CHANGELOG file
type: file
contentMediaType: "application/x-yaml"
Expand Down