From 8d63fa7b17cd8c1aed513b67f9208c74d3d7d5e6 Mon Sep 17 00:00:00 2001 From: nnamdifrankie Date: Tue, 8 Dec 2020 17:19:36 -0500 Subject: [PATCH 1/4] add hidden field to data stream --- CHANGELOG.md | 2 +- util/data_stream.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4871f258..caa7f61b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Add "traces" as legal event type. [#656](https://github.com/elastic/package-registry/pull/656) * Add input-level `template_path` field. [#655](https://github.com/elastic/package-registry/pull/655) - +* Add hidden property to data stream ### Deprecated ### Known Issue diff --git a/util/data_stream.go b/util/data_stream.go index 6bdfb143b..b7c9478f4 100644 --- a/util/data_stream.go +++ b/util/data_stream.go @@ -38,6 +38,7 @@ type DataStream struct { // Name and type of the data stream. This is linked to data_stream.dataset and data_stream.type fields. Type string `config:"type" json:"type" validate:"required"` Dataset string `config:"dataset" json:"dataset,omitempty" yaml:"dataset,omitempty"` + Hidden bool `config:"hidden" json:"hidden,omitempty" yaml:"hidden,omitempty"` Title string `config:"title" json:"title" validate:"required"` Release string `config:"release" json:"release"` From c4e40ee3b4e19f98b966f1696aa23795881f46d2 Mon Sep 17 00:00:00 2001 From: nnamdifrankie Date: Tue, 8 Dec 2020 17:23:15 -0500 Subject: [PATCH 2/4] update change log --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index caa7f61b0..81d4607fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Add "traces" as legal event type. [#656](https://github.com/elastic/package-registry/pull/656) * Add input-level `template_path` field. [#655](https://github.com/elastic/package-registry/pull/655) -* Add hidden property to data stream +* Add hidden field to data stream. [#660] (https://github.com/elastic/package-registry/pull/660) ### Deprecated ### Known Issue From 2c55072a7a4c8a693080fa62be5a968edf463d82 Mon Sep 17 00:00:00 2001 From: Kevin Logan Date: Wed, 9 Dec 2020 13:45:12 -0500 Subject: [PATCH 3/4] add test data and package --- .../generated/categories-experimental.json | 2 +- testdata/generated/categories.json | 2 +- .../generated/package/hidden/1.0.0/index.json | 42 +++++++++++++++++++ testdata/generated/search-all.json | 10 +++++ .../generated/search-category-custom.json | 10 +++++ testdata/generated/search-kibana721.json | 10 +++++ .../search-package-experimental.json | 10 +++++ .../generated/search-package-internal.json | 10 +++++ testdata/generated/search.json | 10 +++++ .../data_stream/hidden/fields/base-fields.yml | 16 +++++++ .../data_stream/hidden/fields/some_fields.yml | 15 +++++++ .../1.0.0/data_stream/hidden/manifest.yml | 6 +++ testdata/package/hidden/1.0.0/docs/README.md | 0 testdata/package/hidden/1.0.0/manifest.yml | 14 +++++++ 14 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 testdata/generated/package/hidden/1.0.0/index.json create mode 100644 testdata/package/hidden/1.0.0/data_stream/hidden/fields/base-fields.yml create mode 100644 testdata/package/hidden/1.0.0/data_stream/hidden/fields/some_fields.yml create mode 100644 testdata/package/hidden/1.0.0/data_stream/hidden/manifest.yml create mode 100644 testdata/package/hidden/1.0.0/docs/README.md create mode 100644 testdata/package/hidden/1.0.0/manifest.yml diff --git a/testdata/generated/categories-experimental.json b/testdata/generated/categories-experimental.json index 2b5e8ab44..2bd451560 100644 --- a/testdata/generated/categories-experimental.json +++ b/testdata/generated/categories-experimental.json @@ -22,7 +22,7 @@ { "id": "custom", "title": "Custom", - "count": 10 + "count": 11 }, { "id": "message_queue", diff --git a/testdata/generated/categories.json b/testdata/generated/categories.json index e634d86ee..f9f97c688 100644 --- a/testdata/generated/categories.json +++ b/testdata/generated/categories.json @@ -17,7 +17,7 @@ { "id": "custom", "title": "Custom", - "count": 10 + "count": 11 }, { "id": "message_queue", diff --git a/testdata/generated/package/hidden/1.0.0/index.json b/testdata/generated/package/hidden/1.0.0/index.json new file mode 100644 index 000000000..7ce78e11c --- /dev/null +++ b/testdata/generated/package/hidden/1.0.0/index.json @@ -0,0 +1,42 @@ +{ + "name": "hidden", + "title": "Hidden", + "version": "1.0.0", + "release": "beta", + "description": "This is the hidden integration", + "type": "solution", + "download": "/epr/hidden/hidden-1.0.0.zip", + "path": "/package/hidden/1.0.0", + "format_version": "1.0.0", + "readme": "/package/hidden/1.0.0/docs/README.md", + "license": "basic", + "categories": [ + "custom" + ], + "conditions": { + "kibana.version": "\u003e=7.0.0" + }, + "assets": [ + "/package/hidden/1.0.0/manifest.yml", + "/package/hidden/1.0.0/docs/README.md", + "/package/hidden/1.0.0/data_stream/hidden/manifest.yml", + "/package/hidden/1.0.0/data_stream/hidden/fields/base-fields.yml", + "/package/hidden/1.0.0/data_stream/hidden/fields/some_fields.yml" + ], + "data_streams": [ + { + "type": "metrics", + "dataset": "hidden.hidden", + "hidden": true, + "title": "Hidden data stream and ilm policy overrride", + "release": "experimental", + "package": "hidden", + "elasticsearch": { + "index_template.mappings": { + "dynamic": false + } + }, + "path": "hidden" + } + ] +} \ No newline at end of file diff --git a/testdata/generated/search-all.json b/testdata/generated/search-all.json index 578855ee7..9a429f60a 100644 --- a/testdata/generated/search-all.json +++ b/testdata/generated/search-all.json @@ -59,6 +59,16 @@ "download": "/epr/foo/foo-1.0.0.zip", "path": "/package/foo/1.0.0" }, + { + "name": "hidden", + "title": "Hidden", + "version": "1.0.0", + "release": "beta", + "description": "This is the hidden integration", + "type": "solution", + "download": "/epr/hidden/hidden-1.0.0.zip", + "path": "/package/hidden/1.0.0" + }, { "name": "input_level_templates", "title": "Input level templates", diff --git a/testdata/generated/search-category-custom.json b/testdata/generated/search-category-custom.json index a5bafa047..33d38f859 100644 --- a/testdata/generated/search-category-custom.json +++ b/testdata/generated/search-category-custom.json @@ -19,6 +19,16 @@ "download": "/epr/foo/foo-1.0.0.zip", "path": "/package/foo/1.0.0" }, + { + "name": "hidden", + "title": "Hidden", + "version": "1.0.0", + "release": "beta", + "description": "This is the hidden integration", + "type": "solution", + "download": "/epr/hidden/hidden-1.0.0.zip", + "path": "/package/hidden/1.0.0" + }, { "name": "input_level_templates", "title": "Input level templates", diff --git a/testdata/generated/search-kibana721.json b/testdata/generated/search-kibana721.json index c74afd01f..6d04bc8ed 100644 --- a/testdata/generated/search-kibana721.json +++ b/testdata/generated/search-kibana721.json @@ -49,6 +49,16 @@ "download": "/epr/foo/foo-1.0.0.zip", "path": "/package/foo/1.0.0" }, + { + "name": "hidden", + "title": "Hidden", + "version": "1.0.0", + "release": "beta", + "description": "This is the hidden integration", + "type": "solution", + "download": "/epr/hidden/hidden-1.0.0.zip", + "path": "/package/hidden/1.0.0" + }, { "name": "longdocs", "title": "Long Docs", diff --git a/testdata/generated/search-package-experimental.json b/testdata/generated/search-package-experimental.json index 15faf4288..3eea09de8 100644 --- a/testdata/generated/search-package-experimental.json +++ b/testdata/generated/search-package-experimental.json @@ -69,6 +69,16 @@ "download": "/epr/foo/foo-1.0.0.zip", "path": "/package/foo/1.0.0" }, + { + "name": "hidden", + "title": "Hidden", + "version": "1.0.0", + "release": "beta", + "description": "This is the hidden integration", + "type": "solution", + "download": "/epr/hidden/hidden-1.0.0.zip", + "path": "/package/hidden/1.0.0" + }, { "name": "input_level_templates", "title": "Input level templates", diff --git a/testdata/generated/search-package-internal.json b/testdata/generated/search-package-internal.json index 98024b0c3..b425b0ca1 100644 --- a/testdata/generated/search-package-internal.json +++ b/testdata/generated/search-package-internal.json @@ -49,6 +49,16 @@ "download": "/epr/foo/foo-1.0.0.zip", "path": "/package/foo/1.0.0" }, + { + "name": "hidden", + "title": "Hidden", + "version": "1.0.0", + "release": "beta", + "description": "This is the hidden integration", + "type": "solution", + "download": "/epr/hidden/hidden-1.0.0.zip", + "path": "/package/hidden/1.0.0" + }, { "name": "input_level_templates", "title": "Input level templates", diff --git a/testdata/generated/search.json b/testdata/generated/search.json index 55346e775..e9b322111 100644 --- a/testdata/generated/search.json +++ b/testdata/generated/search.json @@ -49,6 +49,16 @@ "download": "/epr/foo/foo-1.0.0.zip", "path": "/package/foo/1.0.0" }, + { + "name": "hidden", + "title": "Hidden", + "version": "1.0.0", + "release": "beta", + "description": "This is the hidden integration", + "type": "solution", + "download": "/epr/hidden/hidden-1.0.0.zip", + "path": "/package/hidden/1.0.0" + }, { "name": "input_level_templates", "title": "Input level templates", diff --git a/testdata/package/hidden/1.0.0/data_stream/hidden/fields/base-fields.yml b/testdata/package/hidden/1.0.0/data_stream/hidden/fields/base-fields.yml new file mode 100644 index 000000000..c40df14f9 --- /dev/null +++ b/testdata/package/hidden/1.0.0/data_stream/hidden/fields/base-fields.yml @@ -0,0 +1,16 @@ +- name: data_stream.type + type: constant_keyword + description: > + Data stream type. +- name: data_stream.dataset + type: constant_keyword + description: > + Data stream dataset. +- name: data_stream.namespace + type: constant_keyword + description: > + Data stream namespace. +- name: "@timestamp" + type: date + description: > + Event timestamp. diff --git a/testdata/package/hidden/1.0.0/data_stream/hidden/fields/some_fields.yml b/testdata/package/hidden/1.0.0/data_stream/hidden/fields/some_fields.yml new file mode 100644 index 000000000..5b6175f29 --- /dev/null +++ b/testdata/package/hidden/1.0.0/data_stream/hidden/fields/some_fields.yml @@ -0,0 +1,15 @@ + +- name: source + title: Source + group: 2 + type: group + fields: + - name: geo.city_name + level: core + type: keyword + description: City name. + ignore_above: 1024 +- name: foobar + type: text + description: A field with a pattern defined + pattern: '^[a-zA-Z]$' \ No newline at end of file diff --git a/testdata/package/hidden/1.0.0/data_stream/hidden/manifest.yml b/testdata/package/hidden/1.0.0/data_stream/hidden/manifest.yml new file mode 100644 index 000000000..136792c7c --- /dev/null +++ b/testdata/package/hidden/1.0.0/data_stream/hidden/manifest.yml @@ -0,0 +1,6 @@ +title: Hidden data stream and ilm policy overrride +type: metrics +hidden: true +elasticsearch: + index_template.mappings: + dynamic: false \ No newline at end of file diff --git a/testdata/package/hidden/1.0.0/docs/README.md b/testdata/package/hidden/1.0.0/docs/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/testdata/package/hidden/1.0.0/manifest.yml b/testdata/package/hidden/1.0.0/manifest.yml new file mode 100644 index 000000000..b68162bda --- /dev/null +++ b/testdata/package/hidden/1.0.0/manifest.yml @@ -0,0 +1,14 @@ +format_version: 1.0.0 + +name: hidden +description: This is the hidden integration +version: 1.0.0 +title: Hidden +categories: ["custom"] +type: solution +release: beta + +conditions: + kibana: + version: ">=7.0.0" + From c8b6f6a4165e39538571514aa9c86fb04a172f2a Mon Sep 17 00:00:00 2001 From: Kevin Logan Date: Thu, 10 Dec 2020 05:42:49 -0500 Subject: [PATCH 4/4] adjust changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81d4607fb..55fd6dd42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Add "traces" as legal event type. [#656](https://github.com/elastic/package-registry/pull/656) * Add input-level `template_path` field. [#655](https://github.com/elastic/package-registry/pull/655) -* Add hidden field to data stream. [#660] (https://github.com/elastic/package-registry/pull/660) +* Add "hidden" field to data stream. [#660] (https://github.com/elastic/package-registry/pull/660) ### Deprecated ### Known Issue