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

[DataView] Keep only customLabel for data view minimal spec #178983

Merged
merged 8 commits into from
Mar 27, 2024

Conversation

jughosta
Copy link
Contributor

Summary

We should probably exclude customDescriptions from the data view minimal spec as they tend to be long.

Checklist

@jughosta jughosta added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) labels Mar 19, 2024
@jughosta jughosta self-assigned this Mar 19, 2024
@jughosta
Copy link
Contributor Author

/ci

@jughosta jughosta marked this pull request as ready for review March 19, 2024 18:16
@jughosta jughosta requested a review from a team as a code owner March 19, 2024 18:16
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

Copy link
Member

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

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

So I was playing around with this and I just wanted to make sure this is intentional behavior:

  1. Create an ad-hoc data view
  2. Add a field with a custom description
  3. Save the saved search
  4. Log out
  5. Log back in and open the saved search

The custom descriptions are not there, since they weren't persisted (b/c they're not part of the "minimal spec").

@@ -181,7 +181,7 @@ export class DataView extends AbstractDataView implements DataViewBase {
if (dataViewSpec.fieldAttrs) {
// removes `count` props (popularity scores) from `fieldAttrs`
Copy link
Member

Choose a reason for hiding this comment

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

Nit: can we update this comment to reflect that we're removing customDescription as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

@jughosta jughosta requested a review from a team as a code owner March 21, 2024 10:52
@jughosta
Copy link
Contributor Author

Changed the implementation to exclude custom description only for alert links.

@jughosta jughosta requested a review from a team March 21, 2024 10:53
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #66 / GET /internal/cloud_security_posture/benchmarks Get Benchmark API Verify cspm benchmark score is updated when muting rules

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
data 2597 2601 +4
dataViews 288 294 +6
total +10

Page load bundle

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

id before after diff
dataViews 49.8KB 49.9KB +96.0B
Unknown metric groups

API count

id before after diff
data 3257 3261 +4
dataViews 970 976 +6
total +10

History

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

cc @jughosta

@@ -248,5 +248,5 @@ export function updateFilterReferences(
export function getSmallerDataViewSpec(
dataView: DataView
): DiscoverAppLocatorParams['dataViewSpec'] {
return dataView.toMinimalSpec();
return dataView.toMinimalSpec({ keepFieldAttrs: ['customLabel'] });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Excluding customDescription for alert links. customLabel is what we allowed to include previously too.

Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

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

Code LGTM

@jughosta jughosta merged commit 9a29ee5 into elastic:main Mar 27, 2024
19 checks passed
@jughosta jughosta deleted the only-custom-label-in-minimal-spec branch March 27, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants