[8.19] [Obs AI Assistant] Backport all LockManager commits#219812
Merged
sorenlouv merged 8 commits intoelastic:8.19from May 1, 2025
Merged
Conversation
Tests added in elastic#216397 are failing on MKI. Skipping temporarily in the affected environment ### Error ``` └- ✖ fail: Serverless Observability - Deployment-agnostic API integration tests observability AI Assistant LockManager Basic lock operations acquires the lock when not held │ ResponseError: security_exception │ Root causes: │ security_exception: action [indices:admin/create] is unauthorized for user [testing-internal] with effective roles [superuser] on restricted indices [.kibana_locks-000001], this action is granted by the index privileges [create_index,manage,all] ``` ### Root cause ```ts const es = getService('es'); es.deleteByQuery({ index: '.kibana_locks-000001', query: { match_all: {} }}); ``` (cherry picked from commit 8bcce2e)
Closes: elastic#218944 The index template for the Lock Manager was not created, causing index mappings and settings to be incorrect. Root cause: the function responsible for creating the index template (`ensureTemplatesAndIndexCreated`) was never invoked - only during automated testing 🤦 The mappings for the lock manager index (`.kibana_locks-000001`) should match this: ```ts { mappings: { dynamic: false, properties: { token: { type: 'keyword' }, metadata: { enabled: false }, createdAt: { type: 'date' }, expiresAt: { type: 'date' }, }, }, } ``` In this test we make sure that the LockManager library can recover and fix the mappings if the existing index has invalid mappings ``` DELETE .kibana_locks-000001 DELETE _index_template/.kibana_locks-index-template DELETE _component_template/.kibana_locks-component ``` correct mappings ``` PUT .kibana_locks-000001 ``` (Restart Kibana) ``` GET .kibana_locks-000001/_mapping ``` In this test we make sure that out of the box, the LockManager library creates an index with the correct mappings ``` DELETE .kibana_locks-000001 DELETE _index_template/.kibana_locks-index-template DELETE _component_template/.kibana_locks-component ``` (Restart Kibana) ``` GET .kibana_locks-000001/_mapping ``` Related: elastic#216916 elastic#216397 --------- Co-authored-by: Viduni Wickramarachchi <viduni.ushanka@gmail.com> (cherry picked from commit f684ea4)
Closes: elastic#218944 The index template for the Lock Manager was not created, causing index mappings and settings to be incorrect. Root cause: the function responsible for creating the index template (`ensureTemplatesAndIndexCreated`) was never invoked - only during automated testing 🤦 The mappings for the lock manager index (`.kibana_locks-000001`) should match this: ```ts { mappings: { dynamic: false, properties: { token: { type: 'keyword' }, metadata: { enabled: false }, createdAt: { type: 'date' }, expiresAt: { type: 'date' }, }, }, } ``` In this test we make sure that the LockManager library can recover and fix the mappings if the existing index has invalid mappings ``` DELETE .kibana_locks-000001 DELETE _index_template/.kibana_locks-index-template DELETE _component_template/.kibana_locks-component ``` correct mappings ``` PUT .kibana_locks-000001 ``` (Restart Kibana) ``` GET .kibana_locks-000001/_mapping ``` In this test we make sure that out of the box, the LockManager library creates an index with the correct mappings ``` DELETE .kibana_locks-000001 DELETE _index_template/.kibana_locks-index-template DELETE _component_template/.kibana_locks-component ``` (Restart Kibana) ``` GET .kibana_locks-000001/_mapping ``` Related: elastic#216916 elastic#216397 --------- Co-authored-by: Viduni Wickramarachchi <viduni.ushanka@gmail.com> (cherry picked from commit f684ea4)
Expose LockManager as package to make it easier to consume from other plugins cc @nchaulet --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Viduni Wickramarachchi <viduni.ushanka@gmail.com> (cherry picked from commit 8b8d569)
This was referenced Apr 30, 2025
Contributor
|
Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant) |
Collaborator
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
dgieselaar
approved these changes
May 1, 2025
Contributor
💛 Build succeeded, but was flaky
Failed CI Steps
Metrics [docs]Public APIs missing comments
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.19:Questions ?
Please refer to the Backport tool documentation