elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.72k stars 8.13k forks source link

Application Usage's key-schema validation test are missing apps. #191059

Open afharo opened 3 weeks ago

afharo commented 3 weeks ago

The tests in x-pack/test/usage_collection/test_suites/application_usage run Kibana with the default configuration and check that all registered UI apps are listed in the telemetry schema.

As highlighted in https://github.com/elastic/kibana/issues/90536#issuecomment-2302644522, there are some apps that are conditionally registered (either via license checks, internal plugin settings, or full plugin disablement). The current runtime-based test are missing many of those conditionally-enabled apps.

We might want to consider changing the strategy of the test to an AST parser, ESlint rule, or Core constant/enum.

Probably the ESlint rule is the best compromise (no need to involve core or change the API) while still validating that the app ID provided to the register API is

        core.application.register({
          id: 'my-app-id', // <-- ESLint to check the string here adheres to the known list
          mount: async (params: AppMountParameters) => {
            return renderApp();
          },
          ...
        });

Flagging as technical debt instead of bug because the telemetry schemas serve an internal documentation and tracing purpose, and it doesn't directly affect our customers (internal and external).

elasticmachine commented 3 weeks ago

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