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

Add updated_by to saved objects #182687

Merged
merged 13 commits into from
May 29, 2024
Merged

Conversation

Dosant
Copy link
Contributor

@Dosant Dosant commented May 6, 2024

Summary

close https://github.com/elastic/kibana-team/issues/899

  • Adds updated_by to saved object, similar to recently added created_by Add created_by to saved objects #179344
  • Fixes created_by / created_at should be set during upsert
  • Improves functional tests coverage

@Dosant
Copy link
Contributor Author

Dosant commented May 6, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented May 6, 2024

/ci

@Dosant Dosant changed the title wip updated_by Add updated_by to saved objects May 24, 2024
@Dosant
Copy link
Contributor Author

Dosant commented May 24, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented May 24, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented May 24, 2024

@elasticmachine merge upstream

@Dosant
Copy link
Contributor Author

Dosant commented May 24, 2024

/ci

@Dosant Dosant self-assigned this May 27, 2024
@Dosant Dosant added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) labels May 27, 2024
@Dosant Dosant marked this pull request as ready for review May 27, 2024 07:58
@Dosant Dosant requested review from a team as code owners May 27, 2024 07:58
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@Dosant Dosant requested a review from pgayvallet May 27, 2024 07:58
Copy link
Contributor

@vadimkibana vadimkibana left a comment

Choose a reason for hiding this comment

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

Discover code changes LGTM.

@Dosant
Copy link
Contributor Author

Dosant commented May 28, 2024

@elasticmachine merge upstream

Copy link
Member

@azasypkin azasypkin left a comment

Choose a reason for hiding this comment

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

Changes in x-pack/test/saved_object_api_integration LGTM, just left one suggestion.

Comment on lines 34 to 35
expect(typeof so.created_by).to.be('string');
expect(typeof so.updated_by).to.be('string');
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: I'm wondering if in loginAsInteractiveUser you could also retrieve user profile ID like this

const { body: userWithProfileId } = await supertestWithoutAuth
.get('/internal/security/me')
.set('Cookie', sessionCookie.cookieString())
.expect(200);
// Profile UID is supposed to be stable.
expectSnapshot(profileWithoutData).toMatchInline(`
Object {
"data": Object {},
"enabled": true,
"labels": Object {},
"uid": "u_K1WXIRQbRoHiuJylXp842IEhAO_OdqT7SDHrJSzUIjU_0",
so that here you could really be sure that Kibana populated created_by and updated_by with user profile ID and not with some random string? It'd especially be useful in update tests where objects are updated by different users.

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, would be a nice improvement, I'll take a look

Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

ftr_configs.yml

Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

LGTM

@Dosant Dosant enabled auto-merge (squash) May 29, 2024 15:00
@Dosant Dosant merged commit 88757a3 into elastic:main May 29, 2024
17 checks passed
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

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
@kbn/content-management-utils 127 128 +1
@kbn/core-saved-objects-server 132 133 +1
total +2

Page load bundle

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

id before after diff
core 410.6KB 410.7KB +59.0B

Saved Objects .kibana field count

Every field in each saved object type adds overhead to Elasticsearch. Kibana needs to keep the total field count below Elasticsearch's default limit of 1000 fields. Only specify field mappings for the fields you wish to search on or query. See https://www.elastic.co/guide/en/kibana/master/saved-objects-service.html#_mappings

id before after diff
updated_by - 1 +1
Unknown metric groups

API count

id before after diff
@kbn/content-management-utils 194 195 +1
@kbn/core-saved-objects-api-browser 112 113 +1
@kbn/core-saved-objects-api-server 356 357 +1
@kbn/core-saved-objects-server 559 561 +2
data 3183 3185 +2
dataViews 1158 1159 +1
total +8

ESLint disabled line counts

id before after diff
@kbn/core-saved-objects-api-server-internal 7 8 +1

References to deprecated APIs

id before after diff
@kbn/core-saved-objects-api-browser 26 27 +1
@kbn/core-saved-objects-browser-internal 174 175 +1
total +2

Total ESLint disabled count

id before after diff
@kbn/core-saved-objects-api-server-internal 18 19 +1

History

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

cc @Dosant

@kibanamachine kibanamachine added v8.15.0 backport:skip This commit does not require backporting labels May 29, 2024
rshen91 pushed a commit to rshen91/kibana that referenced this pull request May 30, 2024
## Summary

close elastic/kibana-team#899

- Adds `updated_by` to saved object, similar to recently added
`created_by` elastic#179344
- Fixes `created_by` / `created_at` should be set during upsert
- Improves functional tests coverage
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:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants