Skip to content

[dashboard] update dashboard CRUD APIs to accept and return tags as an array of tag saved object ids#233541

Merged
nreese merged 10 commits intoelastic:mainfrom
nreese:dashboard_tags
Sep 23, 2025
Merged

[dashboard] update dashboard CRUD APIs to accept and return tags as an array of tag saved object ids#233541
nreese merged 10 commits intoelastic:mainfrom
nreese:dashboard_tags

Conversation

@nreese
Copy link
Copy Markdown
Contributor

@nreese nreese commented Aug 29, 2025

Part of #216346

#214788 updated dashboard CRUD API read attributes.tags as an array of tag names and write attributes.tags as an array of tag names. Returning attributes.tags as an array of tag names breaks the link between the tag saved object. Instead, attributes.tags should be an array of tag ids.

#214788 updated dashboard CRUD API with a side effect where if a tag saved object did not exist for a tag name, then a tag saved object would be created for the tag name. APIs should not have side effects like this.

This PR updates dashboard CRUD API read attributes.tags as an array of tag ids and write attributes.tags as an array of tag ids to avoid breaking the link between tag saved objects. The PR also removes the ability for the dashboard CRUD APIs to create tag saved objects.

@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Aug 29, 2025

/ci

@nreese nreese changed the title [dashboard] tag ids [dashboard] update dashboard CRUD APIs to accept and return tags as an array of tag saved object ids Aug 29, 2025
@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Sep 1, 2025

@elasticmachine merge upstream

@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Sep 1, 2025

/ci

@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Sep 2, 2025

/ci

@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Sep 2, 2025

/ci

@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Sep 2, 2025

/ci

@nreese nreese marked this pull request as ready for review September 2, 2025 23:07
@nreese nreese requested a review from a team as a code owner September 2, 2025 23:07
@nreese nreese added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// backport:skip This PR does not require backporting Project:Dashboards API v9.2.0 labels Sep 2, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@nreese nreese added the release_note:skip Skip the PR/issue when compiling release notes label Sep 2, 2025
@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Sep 4, 2025

@elasticmachine merge upstream

@ThomThomson ThomThomson self-requested a review September 4, 2025 14:25
Copy link
Copy Markdown
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Great work & cleanup. It's good to keep the code clean by removing features that aren't in the main value-path. I'm especially happy with the fact that the transform can be synchronous now.

references: soReferences,
error: transformDashboardError,
} = await transformDashboardIn({
} = transformDashboardIn({
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.

Hopefully we can keep this synchronous from now on!

});

// TODO - remove once all references are provided server side
const nonTagIncomingReferences = incomingReferences.filter(
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.

Good to keep these separately!


import { transformTagsIn } from './transform_tags_in';

describe('transformTagsIn', () => {
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.

Nice simple tests!

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

@nreese nreese merged commit 09e3349 into elastic:main Sep 23, 2025
12 checks passed
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Sep 24, 2025
…n array of tag saved object ids (elastic#233541)

Part of elastic#216346

elastic#214788 updated dashboard CRUD API
read `attributes.tags` as an array of tag names and write
`attributes.tags` as an array of tag names. Returning `attributes.tags`
as an array of tag names breaks the link between the tag saved object.
Instead, `attributes.tags` should be an array of tag ids.

elastic#214788 updated dashboard CRUD API
with a side effect where if a tag saved object did not exist for a tag
name, then a tag saved object would be created for the tag name. APIs
should not have side effects like this.

This PR updates dashboard CRUD API read `attributes.tags` as an array of
tag ids and write `attributes.tags` as an array of tag ids to avoid
breaking the link between tag saved objects. The PR also removes the
ability for the dashboard CRUD APIs to create tag saved objects.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
niros1 pushed a commit that referenced this pull request Sep 30, 2025
…n array of tag saved object ids (#233541)

Part of #216346

#214788 updated dashboard CRUD API
read `attributes.tags` as an array of tag names and write
`attributes.tags` as an array of tag names. Returning `attributes.tags`
as an array of tag names breaks the link between the tag saved object.
Instead, `attributes.tags` should be an array of tag ids.

#214788 updated dashboard CRUD API
with a side effect where if a tag saved object did not exist for a tag
name, then a tag saved object would be created for the tag name. APIs
should not have side effects like this.

This PR updates dashboard CRUD API read `attributes.tags` as an array of
tag ids and write `attributes.tags` as an array of tag ids to avoid
breaking the link between tag saved objects. The PR also removes the
ability for the dashboard CRUD APIs to create tag saved objects.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
…n array of tag saved object ids (elastic#233541)

Part of elastic#216346

elastic#214788 updated dashboard CRUD API
read `attributes.tags` as an array of tag names and write
`attributes.tags` as an array of tag names. Returning `attributes.tags`
as an array of tag names breaks the link between the tag saved object.
Instead, `attributes.tags` should be an array of tag ids.

elastic#214788 updated dashboard CRUD API
with a side effect where if a tag saved object did not exist for a tag
name, then a tag saved object would be created for the tag name. APIs
should not have side effects like this.

This PR updates dashboard CRUD API read `attributes.tags` as an array of
tag ids and write `attributes.tags` as an array of tag ids to avoid
breaking the link between tag saved objects. The PR also removes the
ability for the dashboard CRUD APIs to create tag saved objects.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
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 Project:Dashboards API release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants