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

[Usage Collection] [schema] Explicit "array" definition #78141

Merged

Conversation

afharo
Copy link
Member

@afharo afharo commented Sep 22, 2020

Summary

We want the usage collection schema to be declarative of the format that is reported by each registered usage collector. That's why we are adding a specific way to declare array properties.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@afharo afharo force-pushed the usage_collection/schema/explicit_array_definition branch from 0327ccc to 39a8515 Compare September 22, 2020 12:34
@afharo afharo marked this pull request as ready for review September 22, 2020 14:52
@afharo afharo requested a review from a team as a code owner September 22, 2020 14:52
@afharo afharo requested a review from a team September 22, 2020 14:52
@afharo afharo requested review from a team as code owners September 22, 2020 14:52
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-telemetry (Team:KibanaTelemetry)

Copy link
Contributor

@jportner jportner left a comment

Choose a reason for hiding this comment

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

Code review only -- Security plugin changes LGTM!

@botelastic botelastic bot added Team:Fleet Team label for Observability Data Collection Fleet team Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability labels Sep 22, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

Copy link
Contributor

@skh skh left a comment

Choose a reason for hiding this comment

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

Ingest Management changes look good, thank you! 👍

Copy link
Contributor

@michaelolo24 michaelolo24 left a comment

Choose a reason for hiding this comment

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

Security Solution, changes look 💯. Thank you!

Copy link
Contributor

@TinaHeiligers TinaHeiligers left a comment

Choose a reason for hiding this comment

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

Thank you for adding the array type! It will make it much easier to interpret what share the data is in.
LGTM

@afharo afharo added the review label Sep 24, 2020
@@ -44,7 +47,10 @@
"type": "keyword"
},
"uninstalled": {
"type": "keyword"
"type": "array",
"items": {
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about renaming items to properties?

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to follow similarities to the JSON-schema specification (even though we are not fully using that).

I think items or an array make more sense to me. They are not properties or the array.

But happy to change it if you think properties is the right way to go.

@@ -28,7 +28,7 @@ export type AllowedSchemaTypes =
| 'date'
| 'float';

export function compatibleSchemaTypes(type: AllowedSchemaTypes) {
export function compatibleSchemaTypes(type: AllowedSchemaTypes | 'array') {
Copy link
Member

Choose a reason for hiding this comment

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

Why didnt we add array to the AllowedSchemaTypes type here instead of using union?

Copy link
Member Author

@afharo afharo Sep 24, 2020

Choose a reason for hiding this comment

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

Because I think TS would allow { type: 'array' } for non-array fields and we'll only catch it when running the check.

@afharo
Copy link
Member Author

afharo commented Sep 24, 2020

@elasticmachine merge upstream

@afharo
Copy link
Member Author

afharo commented Sep 28, 2020

@elasticmachine merge upstream

@afharo afharo requested a review from a team September 28, 2020 09:58
@afharo afharo force-pushed the usage_collection/schema/explicit_array_definition branch from fd9d9bf to 6c6e4b3 Compare September 28, 2020 10:24
Copy link
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

LGTM Uptime changes !!

@afharo
Copy link
Member Author

afharo commented Sep 28, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@chrisronline chrisronline left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@afharo afharo merged commit db78d70 into elastic:master Sep 28, 2020
@afharo afharo deleted the usage_collection/schema/explicit_array_definition branch September 28, 2020 15:13
afharo added a commit that referenced this pull request Sep 28, 2020
#78618)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 28, 2020
* master:
  Fix APM lodash imports (elastic#78438)
  Add deprecated message to tile_map and region_map visualizations. (elastic#77683)
  Fix Lens smokescreen flaky tests (elastic#78566)
  updated discover with alt text (elastic#77660)
  Fix types (elastic#78619)
  Update tutorial-visualizing.asciidoc (elastic#76977)
  Update tutorial-discovering.asciidoc (elastic#76976)
  [Search] Error notification alignment (elastic#77788)
  Update tutorial-define-index.asciidoc (elastic#76975)
  [Lens] Fieldless operations (elastic#78080)
  [Usage Collection] [schema] Explicit "array" definition (elastic#78141)
  Update tutorial-define-index.asciidoc (elastic#76973)
  Fix --no-basepath references in doc (elastic#78570)
  Move StubIndexPattern to data plugin and convert to TS. (elastic#78518)
  Index pattern class - remove unused methods (elastic#78538)
  [Security Solution] [ALL] Eliminates all console.error and console.warn from Jest output (elastic#78523)
  [Actions] avoids setting a default dedupKey on PagerDuty (elastic#77773)
  First stab at developer-focussed saved objects docs (elastic#71430)
  remove unnecessary config validations (elastic#78527)
@lukeelmers lukeelmers added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Oct 1, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Telemetry release_note:skip Skip the PR/issue when compiling release notes review Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Fleet Team label for Observability Data Collection Fleet team Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.