Skip to content

[Infrastructure UI] Add strict payload validation to inventory_views endpoint#160852

Merged
crespocarlos merged 21 commits intoelastic:mainfrom
crespocarlos:157505-inventory-view-strict-input-validation
Jul 5, 2023
Merged

[Infrastructure UI] Add strict payload validation to inventory_views endpoint#160852
crespocarlos merged 21 commits intoelastic:mainfrom
crespocarlos:157505-inventory-view-strict-input-validation

Conversation

@crespocarlos
Copy link
Copy Markdown
Contributor

@crespocarlos crespocarlos commented Jun 29, 2023

closes #157505
fixes #157740

Summary

This PR adds strict payload validation to inventory_views endpoint. I tried to make the types consistent between sever and frontend code and because of that more changes had to be made. I also refactored the toolbar_control component, decoupling them from Inventory View and Metrics Explorer View types

How to test

  • Call the endpoint below trying to use invalid values. see here.
[POST|PUT] kbn:/api/infra/inventory_views
{
  "attributes": {
    "metric": {
        "type": [TYPE]
    },
    "sort": {
        "by": "name"
        "direction": "desc"
    },
    "groupBy": [],
    "nodeType": "host",
    "view": "map",
    "customOptions": [],
    "customMetrics": [],
    "boundsOverride": {
        "max": 1,
        "min": 0
    },
    "autoBounds": true,
    "accountId": "",
    "region": "",
    "autoReload": false,
    "filterQuery": {
        "expression": "",
        "kind": "kuery"
    },
    "legend": {
        "palette": "cool",
        "steps": 10,
        "reverseColors": false
    },
    "timelineOpen": false,
    "name": "test-uptime"
  }
}
  • Set up a local Kibana instance
  • Navigate to Infrastructure
  • In the UI, use the Saved View feature and try different field combinations

@ghost
Copy link
Copy Markdown

ghost commented Jun 29, 2023

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@crespocarlos crespocarlos changed the title [Infrastructure UI] Add strict payload validation to invntory_views endpoint [Infrastructure UI] Add strict payload validation to inventory_views endpoint Jun 29, 2023
@crespocarlos crespocarlos added chore Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Feature:ObsHosts Hosts feature within Observability v8.10.0 labels Jun 29, 2023
@crespocarlos crespocarlos force-pushed the 157505-inventory-view-strict-input-validation branch from 467885d to 58b71bb Compare June 30, 2023 09:14
@crespocarlos
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream


return (
<SavedViewsToolbarControls<MetricExplorerViewState>
<SavedViewsToolbarControls<any, MetricExplorerViewState>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This will be fixed in this PR #160982

@crespocarlos crespocarlos marked this pull request as ready for review June 30, 2023 11:48
@crespocarlos crespocarlos requested a review from a team as a code owner June 30, 2023 11:48
@crespocarlos crespocarlos requested a review from a team June 30, 2023 11:48
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

rt.type({
id: rt.string,
attributes: inventoryViewSavedObjectAttributesRT,
attributes: inventoryViewAttributesRT,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

note: I think coupling the attributes to the type defined and used also for the API responses revert the changes made for the migrations to versioned APIs, where is states the persistence schema shouldn't be directly exposed. In terms of SO attributes definition, I think we should approach it as done for the logView SO on this PR. Wdyt?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch! thanks

Comment on lines +17 to +24
export const inventoryColorPaletteRT = rt.union([
rt.literal('status'),
rt.literal('temperature'),
rt.literal('cool'),
rt.literal('warm'),
rt.literal('positive'),
rt.literal('negative'),
]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: we could use the rt.keyof function here too

import { nonEmptyStringRt } from '@kbn/io-ts-utils';
import * as rt from 'io-ts';

export const findInventoryViewAttributesResponseRT = rt.strict({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: I remembered this was a strict type to strip out the non-essential properties for this endpoint when the response is encoded in the server, I think doing so it will now leak all SO attributes on this response for every saved view, could you verify that please?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I didn't see any weird attributes. I'll check it again.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed it. thanks!

import React from 'react';
import { euiStyled } from '@kbn/kibana-react-plugin/common';
import { InventoryColorPalette } from '../../../../../lib/lib';
import type { InventoryColorPalette } from '../../../../../lib/lib';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: just cause I noticed it in some other files and I see here the change is pretty specific, the import type syntax is useful to tell the bundler that if an import has runtime code but we just want to use it for typing (e.g. an enum or class have runtime code), we can use that syntax then to exclude from the bundling.
In this case InventoryColorPalette is a simple type with no runtime code, so the import can be the normal one as import type won't bring any benefit in this case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It doesn't hurt to keep anyway, it's non-blocking at all :)

Copy link
Copy Markdown
Contributor

@tonyghiani tonyghiani 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 for the changes 👏

@crespocarlos
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

rt.type({
id: rt.string,
attributes: inventoryViewSavedObjectAttributesRT,
attributes: inventoryViewsSavedObjectAttributesRT,
Copy link
Copy Markdown
Contributor

@neptunian neptunian Jun 30, 2023

Choose a reason for hiding this comment

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

perhaps we should keep this as not plural, inventoryViewSavedObjectAttributesRT instead of inventoryViewsSavedObjectAttributesRT for consistency's sake with InventoryViewSavedObject below.

@crespocarlos
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@crespocarlos
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@crespocarlos
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
infra 2.0MB 2.0MB -1.0KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
infra 119.7KB 120.4KB +770.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 14 16 +2
securitySolution 410 414 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 15 17 +2
securitySolution 489 493 +4
total +6

History

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

@crespocarlos crespocarlos merged commit d79e69a into elastic:main Jul 5, 2023
@crespocarlos crespocarlos deleted the 157505-inventory-view-strict-input-validation branch July 5, 2023 06:52
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jul 5, 2023
* main: (354 commits)
  [Synthetics] Overview page fix last refresh value display (elastic#161086)
  [Synthetics] Remove TLS alert option for ICMP monitor (elastic#161173)
  fixing the path of manifets for hints autodiscover (elastic#161075)
  [Fleet] Fix permissions in integrations Assets page (elastic#161233)
  Update publicBaseUrl warning id (elastic#161204)
  [ML] Fix Anomaly Explorer URL for alerting context with non-default space  (elastic#160899)
  [Enterprise Search]Add 404 error handling for mappings and documents endpoints (elastic#161203)
  [Logs Shared] Move LogStream and LogView into new shared plugin (elastic#161151)
  [Security Solutions] Fix  CellActions component should hide ShowTopN action for nested fields (elastic#159645)
  [SecuritySolutions] Remove filter actions from Cases alerts table and fix show_top_n action (elastic#161150)
  [Infrastructure UI] Add strict payload validation to inventory_views endpoint (elastic#160852)
  [api-docs] 2023-07-05 Daily api_docs build (elastic#161225)
  Fix errors in custom metric payload in SLO dev docs (elastic#161141)
  [data views] Fix overwrite param for create (elastic#160953)
  [Synthetics] Perform params API HTTP migration (elastic#160575)
  [Cloud Security][FTR]Refactor API FTR to use .to.eql instead of .to.be  (elastic#160694)
  Have SLO routes return a 403 instead of a 400 when user has an insufficient license (elastic#161193)
  [Discover] Fix shared links flaky test (elastic#161172)
  [ftr] Improve FTR error handling for NoSuchSessionError (elastic#161025)
  skip flaky suite (elastic#151981)
  ...
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jul 5, 2023
* main: (354 commits)
  [Synthetics] Overview page fix last refresh value display (elastic#161086)
  [Synthetics] Remove TLS alert option for ICMP monitor (elastic#161173)
  fixing the path of manifets for hints autodiscover (elastic#161075)
  [Fleet] Fix permissions in integrations Assets page (elastic#161233)
  Update publicBaseUrl warning id (elastic#161204)
  [ML] Fix Anomaly Explorer URL for alerting context with non-default space  (elastic#160899)
  [Enterprise Search]Add 404 error handling for mappings and documents endpoints (elastic#161203)
  [Logs Shared] Move LogStream and LogView into new shared plugin (elastic#161151)
  [Security Solutions] Fix  CellActions component should hide ShowTopN action for nested fields (elastic#159645)
  [SecuritySolutions] Remove filter actions from Cases alerts table and fix show_top_n action (elastic#161150)
  [Infrastructure UI] Add strict payload validation to inventory_views endpoint (elastic#160852)
  [api-docs] 2023-07-05 Daily api_docs build (elastic#161225)
  Fix errors in custom metric payload in SLO dev docs (elastic#161141)
  [data views] Fix overwrite param for create (elastic#160953)
  [Synthetics] Perform params API HTTP migration (elastic#160575)
  [Cloud Security][FTR]Refactor API FTR to use .to.eql instead of .to.be  (elastic#160694)
  Have SLO routes return a 403 instead of a 400 when user has an insufficient license (elastic#161193)
  [Discover] Fix shared links flaky test (elastic#161172)
  [ftr] Improve FTR error handling for NoSuchSessionError (elastic#161025)
  skip flaky suite (elastic#151981)
  ...
crespocarlos added a commit that referenced this pull request Jul 14, 2023
…_views endpoint (#160982)

closes [#157520](#157520)
## Summary

This PR adds strict payload validation to `metrics_explorer_views`
endpoint. This PR depends on this to be merged
#160852


### How to test

- Call the endpoint below trying to use invalid values. see
[here](https://github.com/elastic/kibana/pull/160982/files#diff-4573683b3b62cdf5f6426ec345b7ad6c7d6e6328237b213ca7519f686d8fa951R125-R131).

```bash
[POST|PUT] kbn:/api/infra/metrics_explorer_views
{
  "attributes": {
    "name": "Ad-hoc",
    "options": {
      "aggregation": "avg",
      "metrics": [
        {
          "aggregation": "avg",
          "field": "system.cpu.total.norm.pct",
          "color": "color0"
        },
      ],
      "source": "default",
      "groupBy": [
        "host.name"
      ]
    },
    "chartOptions": {
      "type": "line",
      "yAxisMode": "fromZero",
      "stack": false
    },
    "currentTimerange": {
      "from": "now-1h",
      "to": "now",
      "interval": ">=10s"
    }
  }
}
```

- Set up a local Kibana instance
- Navigate to `Infrastructure > Metrics Explorer`
- In the UI, use the Saved View feature and try different field
combinations

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
bryce-b added a commit that referenced this pull request Jan 27, 2025
## Summary

Fixes #187254  
Strict checks on the attribute `legend.steps` was added to the inventory
view API in v8.10 (#160852), but they were not defined in the
saved object type for that data, resulting in older versions migrating
bad data, and being unable to use the API. This PR adds versioning to
the Inventory view saved object type that constrains legend.steps to
between 2 and 18, per the strict typing added in #160852

#### Open questions
Should we add notes to all versions of kibana between v8.10 and oldest
version available for backport describing this bug?

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
bryce-b added a commit to bryce-b/kibana that referenced this pull request Feb 18, 2025
## Summary

Fixes elastic#187254
Strict checks on the attribute `legend.steps` was added to the inventory
view API in v8.10 (elastic#160852), but they were not defined in the
saved object type for that data, resulting in older versions migrating
bad data, and being unable to use the API. This PR adds versioning to
the Inventory view saved object type that constrains legend.steps to
between 2 and 18, per the strict typing added in elastic#160852

#### Open questions
Should we add notes to all versions of kibana between v8.10 and oldest
version available for backport describing this bug?

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit a108c63)

# Conflicts:
#	x-pack/solutions/observability/plugins/infra/tsconfig.json
bryce-b added a commit to bryce-b/kibana that referenced this pull request Feb 18, 2025
## Summary

Fixes elastic#187254
Strict checks on the attribute `legend.steps` was added to the inventory
view API in v8.10 (elastic#160852), but they were not defined in the
saved object type for that data, resulting in older versions migrating
bad data, and being unable to use the API. This PR adds versioning to
the Inventory view saved object type that constrains legend.steps to
between 2 and 18, per the strict typing added in elastic#160852

#### Open questions
Should we add notes to all versions of kibana between v8.10 and oldest
version available for backport describing this bug?

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit a108c63)

# Conflicts:
#	x-pack/plugins/observability_solution/infra/server/saved_objects/inventory_view/inventory_view_saved_object.test.ts
#	x-pack/plugins/observability_solution/infra/tsconfig.json
bryce-b added a commit that referenced this pull request Feb 21, 2025
)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Added versioning to inventory_view_saved_object
(#207007)](#207007)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Bryce
Buchanan","email":"75274611+bryce-b@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-01-27T18:09:32Z","message":"Added
versioning to inventory_view_saved_object (#207007)\n\n##
Summary\r\n\r\nFixes #187254 \r\nStrict checks on the attribute
`legend.steps` was added to the inventory\r\nview API in v8.10
(#160852), but they were not defined in the\r\nsaved object type for
that data, resulting in older versions migrating\r\nbad data, and being
unable to use the API. This PR adds versioning to\r\nthe Inventory view
saved object type that constrains legend.steps to\r\nbetween 2 and 18,
per the strict typing added in #160852\r\n\r\n#### Open
questions\r\nShould we add notes to all versions of kibana between v8.10
and oldest\r\nversion available for backport describing this
bug?\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a108c632a459240f9c27262395e2584f92d43779","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:fix","backport
missing","v9.0.0","Team:obs-ux-infra_services"],"title":"Added
versioning to
inventory_view_saved_object","number":207007,"url":"https://github.com/elastic/kibana/pull/207007","mergeCommit":{"message":"Added
versioning to inventory_view_saved_object (#207007)\n\n##
Summary\r\n\r\nFixes #187254 \r\nStrict checks on the attribute
`legend.steps` was added to the inventory\r\nview API in v8.10
(#160852), but they were not defined in the\r\nsaved object type for
that data, resulting in older versions migrating\r\nbad data, and being
unable to use the API. This PR adds versioning to\r\nthe Inventory view
saved object type that constrains legend.steps to\r\nbetween 2 and 18,
per the strict typing added in #160852\r\n\r\n#### Open
questions\r\nShould we add notes to all versions of kibana between v8.10
and oldest\r\nversion available for backport describing this
bug?\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a108c632a459240f9c27262395e2584f92d43779"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207007","number":207007,"mergeCommit":{"message":"Added
versioning to inventory_view_saved_object (#207007)\n\n##
Summary\r\n\r\nFixes #187254 \r\nStrict checks on the attribute
`legend.steps` was added to the inventory\r\nview API in v8.10
(#160852), but they were not defined in the\r\nsaved object type for
that data, resulting in older versions migrating\r\nbad data, and being
unable to use the API. This PR adds versioning to\r\nthe Inventory view
saved object type that constrains legend.steps to\r\nbetween 2 and 18,
per the strict typing added in #160852\r\n\r\n#### Open
questions\r\nShould we add notes to all versions of kibana between v8.10
and oldest\r\nversion available for backport describing this
bug?\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a108c632a459240f9c27262395e2584f92d43779"}}]}]
BACKPORT-->
bryce-b added a commit that referenced this pull request Feb 21, 2025
…1632)

# Backport

This will backport the following commits from `main` to `8.18`:
- [Added versioning to inventory_view_saved_object
(#207007)](#207007)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Bryce
Buchanan","email":"75274611+bryce-b@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-01-27T18:09:32Z","message":"Added
versioning to inventory_view_saved_object (#207007)\n\n##
Summary\r\n\r\nFixes #187254 \r\nStrict checks on the attribute
`legend.steps` was added to the inventory\r\nview API in v8.10
(#160852), but they were not defined in the\r\nsaved object type for
that data, resulting in older versions migrating\r\nbad data, and being
unable to use the API. This PR adds versioning to\r\nthe Inventory view
saved object type that constrains legend.steps to\r\nbetween 2 and 18,
per the strict typing added in #160852\r\n\r\n#### Open
questions\r\nShould we add notes to all versions of kibana between v8.10
and oldest\r\nversion available for backport describing this
bug?\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a108c632a459240f9c27262395e2584f92d43779","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:fix","backport
missing","v9.0.0","Team:obs-ux-infra_services"],"title":"Added
versioning to
inventory_view_saved_object","number":207007,"url":"https://github.com/elastic/kibana/pull/207007","mergeCommit":{"message":"Added
versioning to inventory_view_saved_object (#207007)\n\n##
Summary\r\n\r\nFixes #187254 \r\nStrict checks on the attribute
`legend.steps` was added to the inventory\r\nview API in v8.10
(#160852), but they were not defined in the\r\nsaved object type for
that data, resulting in older versions migrating\r\nbad data, and being
unable to use the API. This PR adds versioning to\r\nthe Inventory view
saved object type that constrains legend.steps to\r\nbetween 2 and 18,
per the strict typing added in #160852\r\n\r\n#### Open
questions\r\nShould we add notes to all versions of kibana between v8.10
and oldest\r\nversion available for backport describing this
bug?\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a108c632a459240f9c27262395e2584f92d43779"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207007","number":207007,"mergeCommit":{"message":"Added
versioning to inventory_view_saved_object (#207007)\n\n##
Summary\r\n\r\nFixes #187254 \r\nStrict checks on the attribute
`legend.steps` was added to the inventory\r\nview API in v8.10
(#160852), but they were not defined in the\r\nsaved object type for
that data, resulting in older versions migrating\r\nbad data, and being
unable to use the API. This PR adds versioning to\r\nthe Inventory view
saved object type that constrains legend.steps to\r\nbetween 2 and 18,
per the strict typing added in #160852\r\n\r\n#### Open
questions\r\nShould we add notes to all versions of kibana between v8.10
and oldest\r\nversion available for backport describing this
bug?\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a108c632a459240f9c27262395e2584f92d43779"}}]}]
BACKPORT-->
bryce-b added a commit that referenced this pull request Feb 21, 2025
…1634)

# Backport

This will backport the following commits from `main` to `8.17`:
- [Added versioning to inventory_view_saved_object
(#207007)](#207007)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Bryce
Buchanan","email":"75274611+bryce-b@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-01-27T18:09:32Z","message":"Added
versioning to inventory_view_saved_object (#207007)\n\n##
Summary\r\n\r\nFixes #187254 \r\nStrict checks on the attribute
`legend.steps` was added to the inventory\r\nview API in v8.10
(#160852), but they were not defined in the\r\nsaved object type for
that data, resulting in older versions migrating\r\nbad data, and being
unable to use the API. This PR adds versioning to\r\nthe Inventory view
saved object type that constrains legend.steps to\r\nbetween 2 and 18,
per the strict typing added in #160852\r\n\r\n#### Open
questions\r\nShould we add notes to all versions of kibana between v8.10
and oldest\r\nversion available for backport describing this
bug?\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a108c632a459240f9c27262395e2584f92d43779","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:fix","backport
missing","v9.0.0","Team:obs-ux-infra_services"],"title":"Added
versioning to
inventory_view_saved_object","number":207007,"url":"https://github.com/elastic/kibana/pull/207007","mergeCommit":{"message":"Added
versioning to inventory_view_saved_object (#207007)\n\n##
Summary\r\n\r\nFixes #187254 \r\nStrict checks on the attribute
`legend.steps` was added to the inventory\r\nview API in v8.10
(#160852), but they were not defined in the\r\nsaved object type for
that data, resulting in older versions migrating\r\nbad data, and being
unable to use the API. This PR adds versioning to\r\nthe Inventory view
saved object type that constrains legend.steps to\r\nbetween 2 and 18,
per the strict typing added in #160852\r\n\r\n#### Open
questions\r\nShould we add notes to all versions of kibana between v8.10
and oldest\r\nversion available for backport describing this
bug?\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a108c632a459240f9c27262395e2584f92d43779"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207007","number":207007,"mergeCommit":{"message":"Added
versioning to inventory_view_saved_object (#207007)\n\n##
Summary\r\n\r\nFixes #187254 \r\nStrict checks on the attribute
`legend.steps` was added to the inventory\r\nview API in v8.10
(#160852), but they were not defined in the\r\nsaved object type for
that data, resulting in older versions migrating\r\nbad data, and being
unable to use the API. This PR adds versioning to\r\nthe Inventory view
saved object type that constrains legend.steps to\r\nbetween 2 and 18,
per the strict typing added in #160852\r\n\r\n#### Open
questions\r\nShould we add notes to all versions of kibana between v8.10
and oldest\r\nversion available for backport describing this
bug?\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"a108c632a459240f9c27262395e2584f92d43779"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting chore Feature:Metrics UI Metrics UI feature Feature:ObsHosts Hosts feature within Observability release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.10.0

Projects

None yet

7 participants