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

Create @elastic/analytics package #128407

Merged
merged 39 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e0b7cf3
Create `@elastic/analytics` package
afharo Mar 23, 2022
867b983
Export mocks from the client
afharo Mar 23, 2022
1d6b58a
[CI] Auto-commit changed files from 'node scripts/generate packages_b…
kibanamachine Mar 23, 2022
b88de5f
Add CODEOWNERS
afharo Mar 24, 2022
f9342ef
Add eslint-disable for max-classes-per-file limit
afharo Mar 24, 2022
47519a7
Merge branch 'ebt/create-elastic-analytics-package' of github.com:afh…
afharo Mar 24, 2022
58289cd
Merge branch 'main' of github.com:elastic/kibana into ebt/create-elas…
afharo Mar 24, 2022
8fbd699
Add `server/core.analytics` service
afharo Mar 24, 2022
dcd11c5
Add `server` FTRs
afharo Mar 24, 2022
1009b16
Merge branch 'main' of github.com:elastic/kibana into ebt/create-elas…
afharo Mar 24, 2022
1bca34b
AcceptDocChanges
afharo Mar 24, 2022
8372429
Add `public/core.analytics`
afharo Mar 25, 2022
125a3f6
Fix core_system tests
afharo Mar 28, 2022
2c35ab0
Merge branch 'main' of github.com:elastic/kibana into ebt/create-elas…
afharo Mar 28, 2022
0a35695
[FTR] Create new "analytics" suite
afharo Mar 28, 2022
34fc3ce
Fix test types
afharo Mar 28, 2022
0451fcb
Fix `public` core mocks
afharo Mar 28, 2022
3dc1352
Fix paths after move
afharo Mar 28, 2022
1844bcf
Add `public` FTR tests
afharo Mar 28, 2022
9c32555
Fix Fleet's Storybook context
afharo Mar 28, 2022
485c2d8
Build analytics test bundle
afharo Mar 28, 2022
d32a246
Merge branch 'main' of github.com:elastic/kibana into ebt/create-elas…
afharo Mar 28, 2022
267cdd7
Build analytics test bundle
afharo Mar 28, 2022
037bde7
Add FTR helpers
afharo Mar 28, 2022
b6d1562
Add readme to the FTR tests
afharo Mar 28, 2022
1421989
Merge branch 'main' of github.com:elastic/kibana into ebt/create-elas…
afharo Mar 28, 2022
d0f3568
Remove commented code
afharo Mar 28, 2022
89fbc41
Move `this.telemetryCounter$` declaration to the top
afharo Mar 30, 2022
bd9bbf8
Feedback on the README
afharo Mar 30, 2022
44b7f13
PR feedback about mocks and setup vs. start contracts
afharo Mar 30, 2022
37778cb
Remove duplicated types from the usage_collection plugin
afharo Mar 30, 2022
fdbb58a
Export TelemetryCountersType as enum
afharo Mar 30, 2022
ca6f5f7
Missing type nit
afharo Mar 30, 2022
2556812
FTRs import `TelemetryCounterType from the package
afharo Mar 30, 2022
e012c07
Simplify AnalyticsClient by moving the OptInConfig logic to a service
afharo Mar 30, 2022
5cba9a8
Context Provider has a name and is not removed after completion
afharo Mar 30, 2022
2095bc3
Merge branch 'main' into ebt/create-elastic-analytics-package
kibanamachine Mar 30, 2022
e87b474
OptInConfig APIs: return early when possible
afharo Mar 31, 2022
2da3b7c
Merge branch 'main' of github.com:elastic/kibana into ebt/create-elas…
afharo Apr 5, 2022
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
1 change: 1 addition & 0 deletions .buildkite/scripts/build_kibana_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -euo pipefail

echo "--- Build Platform Plugins"
node scripts/build_kibana_platform_plugins \
--scan-dir "$KIBANA_DIR/test/analytics/__fixtures__/plugins" \
--scan-dir "$KIBANA_DIR/test/plugin_functional/plugins" \
--scan-dir "$KIBANA_DIR/test/interpreter_functional/plugins" \
--scan-dir "$KIBANA_DIR/test/common/fixtures/plugins" \
Expand Down
8 changes: 8 additions & 0 deletions .buildkite/scripts/steps/functional/oss_misc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,11 @@ checks-reporter-with-killswitch "Status Integration Tests" \
--config test/server_integration/http/platform/config.status.ts \
--bail \
--debug

# Tests that must be run against source in order to build test plugins
echo --- Analytics Integration Tests
checks-reporter-with-killswitch "Analytics Integration Tests" \
node scripts/functional_tests \
--config test/analytics/config.ts \
--bail \
--debug
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@
/x-pack/plugins/saved_objects_tagging/ @elastic/kibana-core
/x-pack/test/saved_objects_field_count/ @elastic/kibana-core
/x-pack/test/saved_object_tagging/ @elastic/kibana-core
/packages/elastic-analytics/ @elastic/kibana-core
/packages/kbn-config-schema/ @elastic/kibana-core
/packages/kbn-std/ @elastic/kibana-core
/packages/kbn-config/ @elastic/kibana-core
Expand Down
19 changes: 16 additions & 3 deletions api_docs/alerting.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2792,7 +2792,7 @@
">; getExecutionLogForRule: ({ id, dateStart, dateEnd, filter, page, perPage, sort, }: ",
"GetExecutionLogByIdParams",
") => Promise<",
"IExecutionLogResult",
"IExecutionLogWithErrorsResult",
">; updateApiKey: ({ id }: { id: string; }) => Promise<void>; snooze: ({ id, snoozeEndTime, }: { id: string; snoozeEndTime: string | -1; }) => Promise<void>; unsnooze: ({ id }: { id: string; }) => Promise<void>; unmuteAll: ({ id }: { id: string; }) => Promise<void>; muteInstance: ({ alertId, alertInstanceId }: ",
"MuteOptions",
") => Promise<void>; unmuteInstance: ({ alertId, alertInstanceId }: ",
Expand Down Expand Up @@ -3732,6 +3732,19 @@
"path": "x-pack/plugins/alerting/common/alert.ts",
"deprecated": false
},
{
"parentPluginId": "alerting",
"id": "def-common.AlertExecutionStatus.numberOfScheduledActions",
"type": "number",
"tags": [],
"label": "numberOfScheduledActions",
"description": [],
"signature": [
"number | undefined"
],
"path": "x-pack/plugins/alerting/common/alert.ts",
"deprecated": false
},
{
"parentPluginId": "alerting",
"id": "def-common.AlertExecutionStatus.metrics",
Expand Down Expand Up @@ -4393,7 +4406,7 @@
"label": "state",
"description": [],
"signature": [
"{ alertTypeState?: { [x: string]: unknown; } | undefined; alertInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; } | undefined; }; } | undefined; previousStartedAt?: Date | null | undefined; } & { metrics: { numSearches?: number | undefined; totalSearchDurationMs?: number | undefined; esSearchDurationMs?: number | undefined; }; alertExecutionStore: { numberOfTriggeredActions?: number | undefined; triggeredActionsStatus?: string | undefined; }; }"
"{ alertTypeState?: { [x: string]: unknown; } | undefined; alertInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; } | undefined; }; } | undefined; previousStartedAt?: Date | null | undefined; } & { metrics: { numSearches?: number | undefined; totalSearchDurationMs?: number | undefined; esSearchDurationMs?: number | undefined; }; alertExecutionStore: { numberOfTriggeredActions?: number | undefined; numberOfScheduledActions?: number | undefined; triggeredActionsStatus?: string | undefined; }; }"
],
"path": "x-pack/plugins/alerting/common/rule_task_instance.ts",
"deprecated": false
Expand Down Expand Up @@ -5184,7 +5197,7 @@
"label": "RuleExecutionState",
"description": [],
"signature": [
"{ alertTypeState?: { [x: string]: unknown; } | undefined; alertInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; } | undefined; }; } | undefined; previousStartedAt?: Date | null | undefined; } & { metrics: { numSearches?: number | undefined; totalSearchDurationMs?: number | undefined; esSearchDurationMs?: number | undefined; }; alertExecutionStore: { numberOfTriggeredActions?: number | undefined; triggeredActionsStatus?: string | undefined; }; }"
"{ alertTypeState?: { [x: string]: unknown; } | undefined; alertInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; } | undefined; }; } | undefined; previousStartedAt?: Date | null | undefined; } & { metrics: { numSearches?: number | undefined; totalSearchDurationMs?: number | undefined; esSearchDurationMs?: number | undefined; }; alertExecutionStore: { numberOfTriggeredActions?: number | undefined; numberOfScheduledActions?: number | undefined; triggeredActionsStatus?: string | undefined; }; }"
],
"path": "x-pack/plugins/alerting/common/rule_task_instance.ts",
"deprecated": false,
Expand Down
2 changes: 1 addition & 1 deletion api_docs/alerting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for q

| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 301 | 0 | 293 | 21 |
| 302 | 0 | 294 | 21 |

## Client

Expand Down
82 changes: 31 additions & 51 deletions api_docs/apm.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@
"section": "def-common.PackagePolicy",
"text": "PackagePolicy"
},
" | undefined; has_apm_integrations: boolean; }, ",
" | undefined; has_apm_integrations: boolean; latest_apm_package_version: string; }, ",
"APMRouteCreateOptions",
">; \"GET /internal/apm/fleet/apm_server_schema/unsupported\": ",
"ServerRoute",
Expand Down Expand Up @@ -2435,11 +2435,9 @@
"Type",
"<number, string, unknown>; }>, ",
"PartialC",
"<{ comparisonStart: ",
"Type",
"<number, string, unknown>; comparisonEnd: ",
"Type",
"<number, string, unknown>; }>]>]>; }>, ",
"<{ offset: ",
"StringC",
"; }>]>]>; }>, ",
{
"pluginId": "apm",
"scope": "server",
Expand Down Expand Up @@ -2497,11 +2495,9 @@
"Type",
"<number, string, unknown>; }>, ",
"PartialC",
"<{ comparisonStart: ",
"Type",
"<number, string, unknown>; comparisonEnd: ",
"Type",
"<number, string, unknown>; }>]>]>; }>, ",
"<{ offset: ",
"StringC",
"; }>]>]>; }>, ",
{
"pluginId": "apm",
"scope": "server",
Expand Down Expand Up @@ -2563,11 +2559,9 @@
"Type",
"<number, string, unknown>; }>, ",
"PartialC",
"<{ comparisonStart: ",
"Type",
"<number, string, unknown>; comparisonEnd: ",
"Type",
"<number, string, unknown>; }>]>]>; }>, ",
"<{ offset: ",
"StringC",
"; }>]>]>; }>, ",
{
"pluginId": "apm",
"scope": "server",
Expand Down Expand Up @@ -2755,11 +2749,9 @@
"Type",
"<number, string, unknown>; }>, ",
"PartialC",
"<{ comparisonStart: ",
"Type",
"<number, string, unknown>; comparisonEnd: ",
"Type",
"<number, string, unknown>; }>]>]>; }>, ",
"<{ offset: ",
"StringC",
"; }>]>]>; }>, ",
{
"pluginId": "apm",
"scope": "server",
Expand Down Expand Up @@ -2809,11 +2801,9 @@
"Type",
"<number, string, unknown>; }>, ",
"PartialC",
"<{ comparisonStart: ",
"Type",
"<number, string, unknown>; comparisonEnd: ",
"Type",
"<number, string, unknown>; }>, ",
"<{ offset: ",
"StringC",
"; }>, ",
"TypeC",
"<{ transactionNames: ",
"Type",
Expand Down Expand Up @@ -3589,11 +3579,9 @@
"Type",
"<number, string, unknown>; }>, ",
"PartialC",
"<{ comparisonStart: ",
"Type",
"<number, string, unknown>; comparisonEnd: ",
"Type",
"<number, string, unknown>; }>]>; }>, ",
"<{ offset: ",
"StringC",
"; }>]>; }>, ",
{
"pluginId": "apm",
"scope": "server",
Expand Down Expand Up @@ -3653,11 +3641,9 @@
"StringC",
"; }>, ",
"PartialC",
"<{ comparisonStart: ",
"Type",
"<number, string, unknown>; comparisonEnd: ",
"Type",
"<number, string, unknown>; }>, ",
"<{ offset: ",
"StringC",
"; }>, ",
"TypeC",
"<{ environment: ",
"UnionC",
Expand Down Expand Up @@ -3737,11 +3723,9 @@
"Type",
"<number, string, unknown>; }>, ",
"PartialC",
"<{ comparisonStart: ",
"Type",
"<number, string, unknown>; comparisonEnd: ",
"Type",
"<number, string, unknown>; }>]>]>; }>, ",
"<{ offset: ",
"StringC",
"; }>]>]>; }>, ",
{
"pluginId": "apm",
"scope": "server",
Expand Down Expand Up @@ -4881,11 +4865,9 @@
"Type",
"<number, string, unknown>; }>, ",
"PartialC",
"<{ comparisonStart: ",
"Type",
"<number, string, unknown>; comparisonEnd: ",
"Type",
"<number, string, unknown>; }>]>; }>, ",
"<{ offset: ",
"StringC",
"; }>]>; }>, ",
{
"pluginId": "apm",
"scope": "server",
Expand Down Expand Up @@ -4983,11 +4965,9 @@
"Type",
"<number, string, unknown>; }>, ",
"PartialC",
"<{ comparisonStart: ",
"Type",
"<number, string, unknown>; comparisonEnd: ",
"Type",
"<number, string, unknown>; }>, ",
"<{ offset: ",
"StringC",
"; }>, ",
"TypeC",
"<{ numBuckets: ",
"Type",
Expand Down
19 changes: 16 additions & 3 deletions api_docs/charts.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@
"label": "EmptyPlaceholder",
"description": [],
"signature": [
"({ icon, iconColor, message, dataTestSubj, }: { icon: ",
"({ icon, iconColor, message, dataTestSubj, className, }: { icon: ",
"IconType",
"; iconColor?: string | undefined; message?: JSX.Element | undefined; dataTestSubj?: string | undefined; }) => JSX.Element"
"; iconColor?: string | undefined; message?: JSX.Element | undefined; dataTestSubj?: string | undefined; className?: string | undefined; }) => JSX.Element"
],
"path": "src/plugins/charts/public/static/components/empty_placeholder.tsx",
"deprecated": false,
Expand All @@ -120,7 +120,7 @@
"id": "def-public.EmptyPlaceholder.$1",
"type": "Object",
"tags": [],
"label": "{\n icon,\n iconColor = 'subdued',\n message = <FormattedMessage id=\"charts.noDataLabel\" defaultMessage=\"No results found\" />,\n dataTestSubj = 'emptyPlaceholder',\n}",
"label": "{\n icon,\n iconColor = 'subdued',\n message = <FormattedMessage id=\"charts.noDataLabel\" defaultMessage=\"No results found\" />,\n dataTestSubj = 'emptyPlaceholder',\n className,\n}",
"description": [],
"path": "src/plugins/charts/public/static/components/empty_placeholder.tsx",
"deprecated": false,
Expand Down Expand Up @@ -176,6 +176,19 @@
],
"path": "src/plugins/charts/public/static/components/empty_placeholder.tsx",
"deprecated": false
},
{
"parentPluginId": "charts",
"id": "def-public.EmptyPlaceholder.$1.className",
"type": "string",
"tags": [],
"label": "className",
"description": [],
"signature": [
"string | undefined"
],
"path": "src/plugins/charts/public/static/components/empty_placeholder.tsx",
"deprecated": false
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion api_docs/charts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors)

| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 321 | 2 | 288 | 4 |
| 322 | 2 | 289 | 4 |

## Client

Expand Down
Loading