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

[Observability] Overview page API responses for UX do not correspond to expected interface #81081

Closed
justinkambic opened this issue Oct 19, 2020 · 1 comment · Fixed by #80873
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Team:Observability Team label for Observability Team (for things that are handled across all of observability) Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.10.0

Comments

@justinkambic
Copy link
Contributor

Kibana version:

master

Elasticsearch version:

master

Server OS version:

macOS

Browser version:

Recent chrome

Browser OS version:

macOS

Original install method (e.g. download page, yum, from source, etc.):

from source

Describe the bug:

The Observability overview sections use types that annotate the expected shape of API responses. The UX dashboard has an extra hasData key wrapping its data flag, and this is causing TS errors.

Steps to reproduce:

  1. Run node scripts/type_check.ts

Expected behavior:

The API should respond with a objects matching the expected interface.

Screenshots (if relevant):
N/A

Errors in browser console (if relevant):
N/A

Provide logs and/or server output (if relevant):

ERROR x-pack/test failed
      x-pack/plugins/observability/public/pages/overview/data_sections.tsx:67:23 - error TS2339: Property 'hasData' does not exist on type 'HasDataResponse'.
        Property 'hasData' does not exist on type 'false'.

      67         {hasData?.ux?.hasData && (
                               ~~~~~~~

      x-pack/plugins/observability/public/pages/overview/index.tsx:92:28 - error TS2339: Property 'hasData' does not exist on type 'HasDataResponse'.
        Property 'hasData' does not exist on type 'false'.

      92       return !hasData[id]?.hasData;
                                    ~~~~~~~


      Found 2 errors.


ERROR x-pack failed
      x-pack/plugins/apm/e2e/tmp/apm-integration-testing/scripts/kibana/validate-ts-interfaces-against-apm-server-sample-docs/scripts/download-sample-docs.ts:1:22 - error TS7016: Could not find a declaration file for module 'prettier'. '/Users/jk/git/justinkambic/kibana/node_modules/prettier/index.js' implicitly has an 'any' type.
        Try `npm install @types/prettier` if it exists or add a new declaration (.d.ts) file containing `declare module 'prettier';`

      1 import prettier from 'prettier';
                             ~~~~~~~~~~

      x-pack/plugins/observability/public/pages/overview/data_sections.tsx:67:23 - error TS2339: Property 'hasData' does not exist on type 'HasDataResponse'.
        Property 'hasData' does not exist on type 'false'.

      67         {hasData?.ux?.hasData && (
                               ~~~~~~~

      x-pack/plugins/observability/public/pages/overview/index.tsx:92:28 - error TS2339: Property 'hasData' does not exist on type 'HasDataResponse'.
        Property 'hasData' does not exist on type 'false'.

      92       return !hasData[id]?.hasData;
                                    ~~~~~~~


      Found 3 errors.

Any additional context:
I do not want to modify the API after feature freeze for the 7.10.0 release. I am planning to suppress the errors for an unrelated bug fix; we should modify the API to return the correct values for the 7.11.0 release.

@justinkambic justinkambic added bug Fixes for quality problems that affect the customer experience Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability Team:Observability Team label for Observability Team (for things that are handled across all of observability) labels Oct 19, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Observability Team label for Observability Team (for things that are handled across all of observability) Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.10.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants