Merged
Conversation
* switch to yarn * cleanup misc references to npm * [yarn] loosen dependency ranges so yarn will merge more deps * fix linting error now that moment uses ESM * [licenses] font-awesome changed the format of its license id * Use local yarn * Misc fixes * eslintignore built yarn file * Remove mkdir which doesn't do what it should do * Check build without upgrading lots of versions * Fix license check * too many moments * Better description * Review fixes * Lock to angular@1.6.5 * More specific version locks * Revert "More specific version locks" This reverts commit 11ef811. * Revert "Lock to angular@1.6.5" This reverts commit 3ade68c. * rm yarn.lock; yarn * Forcing a specific version of React, Angular, Moment * Using vendored version of yarn in ci * Use --frozen-lockfile * fixes
b465cab to
3a6e977
Compare
abhishekbhatia1710
added a commit
that referenced
this pull request
Mar 31, 2026
…t, and async generation (#257046) ## Summary - **LeadDataClient abstraction** : Extracted all Elasticsearch CRUD operations (create, find, get-by-id, dismiss, bulk-update, status, delete) into a dedicated `LeadDataClient` with snake_case ↔ camelCase transform layer between index mappings and API types - **Async generate endpoint** — Refactored `POST /generate` to return an `executionUuid` immediately and run the pipeline (entity retrieval -> observation modules -> scoring -> synthesis -> persistence) in the background - **Six new API routes** : Added `GET /{id}`, `GET /status`, `POST /{id}/_dismiss`, `POST /bulk_update`, `POST /enable`, and `POST /disable` with Zod-validated schemas, versioned routing, and proper authorization - **Shared Zod schemas** : Moved all request/response schemas to common types (generateLeadsRequestSchema, findLeadsRequestSchema, getLeadByIdRequestSchema, dismissLeadRequestSchema, bulkUpdateLeadsRequestSchema, generateLeadsResponseSchema) - **Refactored GET /leads** : Now delegates to `LeadDataClient.findLeads` with page/perPage/sortField/sortOrder/status query params - **Unit tests** : Added tests for LeadDataClient (createLeads, findLeads, getLeadById, dismissLead, bulkUpdateLeads, getStatus, deleteAllLeads) and all route handlers (get_leads, get_lead_by_id, get_lead_generation_status, dismiss_lead, bulk_update_leads, enable, disable) Enable and disable routes are placeholder stubs pending Task Manager wiring (#15955). Relates to: elastic/security-team#15953 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Flaky Test Runner was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the guidelines - [ ] Review the backport guidelines and apply applicable `backport:*` labels. ## Testing Steps **Manual verification** Start Kibana locally and test the API endpoints below. ## API Examples ### Generate leads (async) ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/generate" \ -H "kbn-xsrf: true" \ -H "Content-Type: application/json" \ -H "elastic-api-version: 1" \ -u <....> \ -d '{"connectorId": "optional-connector-id"}' ``` Returns: `{ "executionUuid": "abc-123-..." }` ### Find leads ```bash curl -X GET "http://localhost:5601/internal/entity_analytics/leads?page=1&perPage=10&sortField=priority&sortOrder=desc" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "leads": [...], "total": 42, "page": 1, "perPage": 10 }` ### Get lead by ID ```bash curl -X GET "http://localhost:5601/internal/entity_analytics/leads/{id}" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: full `leadSchema` object ### Get status ```bash curl -X GET "http://localhost:5601/internal/entity_analytics/leads/status" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "isEnabled": false, "indexExists": true, "totalLeads": 42, "lastRun": "..." }` ### Dismiss a lead ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/{id}/_dismiss" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "success": true }` ### Bulk update ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/bulk_update" \ -H "kbn-xsrf: true" \ -H "Content-Type: application/json" \ -H "elastic-api-version: 1" \ -u <....> \ -d '{"ids": ["id-1", "id-2"], "status": "dismissed"}' ``` Returns: `{ "updated": 2 }` ### Enable scheduled generation ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/enable" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "success": true }` ### Disable scheduled generation ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/disable" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "success": true }` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Jared Burgett <147995946+jaredburgettelastic@users.noreply.github.com> Co-authored-by: jaredburgettelastic <jared.burgett@elastic.co>
jeramysoucy
pushed a commit
to jeramysoucy/kibana
that referenced
this pull request
Apr 1, 2026
…t, and async generation (elastic#257046) ## Summary - **LeadDataClient abstraction** : Extracted all Elasticsearch CRUD operations (create, find, get-by-id, dismiss, bulk-update, status, delete) into a dedicated `LeadDataClient` with snake_case ↔ camelCase transform layer between index mappings and API types - **Async generate endpoint** — Refactored `POST /generate` to return an `executionUuid` immediately and run the pipeline (entity retrieval -> observation modules -> scoring -> synthesis -> persistence) in the background - **Six new API routes** : Added `GET /{id}`, `GET /status`, `POST /{id}/_dismiss`, `POST /bulk_update`, `POST /enable`, and `POST /disable` with Zod-validated schemas, versioned routing, and proper authorization - **Shared Zod schemas** : Moved all request/response schemas to common types (generateLeadsRequestSchema, findLeadsRequestSchema, getLeadByIdRequestSchema, dismissLeadRequestSchema, bulkUpdateLeadsRequestSchema, generateLeadsResponseSchema) - **Refactored GET /leads** : Now delegates to `LeadDataClient.findLeads` with page/perPage/sortField/sortOrder/status query params - **Unit tests** : Added tests for LeadDataClient (createLeads, findLeads, getLeadById, dismissLead, bulkUpdateLeads, getStatus, deleteAllLeads) and all route handlers (get_leads, get_lead_by_id, get_lead_generation_status, dismiss_lead, bulk_update_leads, enable, disable) Enable and disable routes are placeholder stubs pending Task Manager wiring (elastic#15955). Relates to: elastic/security-team#15953 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Flaky Test Runner was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the guidelines - [ ] Review the backport guidelines and apply applicable `backport:*` labels. ## Testing Steps **Manual verification** Start Kibana locally and test the API endpoints below. ## API Examples ### Generate leads (async) ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/generate" \ -H "kbn-xsrf: true" \ -H "Content-Type: application/json" \ -H "elastic-api-version: 1" \ -u <....> \ -d '{"connectorId": "optional-connector-id"}' ``` Returns: `{ "executionUuid": "abc-123-..." }` ### Find leads ```bash curl -X GET "http://localhost:5601/internal/entity_analytics/leads?page=1&perPage=10&sortField=priority&sortOrder=desc" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "leads": [...], "total": 42, "page": 1, "perPage": 10 }` ### Get lead by ID ```bash curl -X GET "http://localhost:5601/internal/entity_analytics/leads/{id}" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: full `leadSchema` object ### Get status ```bash curl -X GET "http://localhost:5601/internal/entity_analytics/leads/status" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "isEnabled": false, "indexExists": true, "totalLeads": 42, "lastRun": "..." }` ### Dismiss a lead ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/{id}/_dismiss" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "success": true }` ### Bulk update ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/bulk_update" \ -H "kbn-xsrf: true" \ -H "Content-Type: application/json" \ -H "elastic-api-version: 1" \ -u <....> \ -d '{"ids": ["id-1", "id-2"], "status": "dismissed"}' ``` Returns: `{ "updated": 2 }` ### Enable scheduled generation ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/enable" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "success": true }` ### Disable scheduled generation ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/disable" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "success": true }` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Jared Burgett <147995946+jaredburgettelastic@users.noreply.github.com> Co-authored-by: jaredburgettelastic <jared.burgett@elastic.co>
paulinashakirova
pushed a commit
to paulinashakirova/kibana
that referenced
this pull request
Apr 2, 2026
…t, and async generation (elastic#257046) ## Summary - **LeadDataClient abstraction** : Extracted all Elasticsearch CRUD operations (create, find, get-by-id, dismiss, bulk-update, status, delete) into a dedicated `LeadDataClient` with snake_case ↔ camelCase transform layer between index mappings and API types - **Async generate endpoint** — Refactored `POST /generate` to return an `executionUuid` immediately and run the pipeline (entity retrieval -> observation modules -> scoring -> synthesis -> persistence) in the background - **Six new API routes** : Added `GET /{id}`, `GET /status`, `POST /{id}/_dismiss`, `POST /bulk_update`, `POST /enable`, and `POST /disable` with Zod-validated schemas, versioned routing, and proper authorization - **Shared Zod schemas** : Moved all request/response schemas to common types (generateLeadsRequestSchema, findLeadsRequestSchema, getLeadByIdRequestSchema, dismissLeadRequestSchema, bulkUpdateLeadsRequestSchema, generateLeadsResponseSchema) - **Refactored GET /leads** : Now delegates to `LeadDataClient.findLeads` with page/perPage/sortField/sortOrder/status query params - **Unit tests** : Added tests for LeadDataClient (createLeads, findLeads, getLeadById, dismissLead, bulkUpdateLeads, getStatus, deleteAllLeads) and all route handlers (get_leads, get_lead_by_id, get_lead_generation_status, dismiss_lead, bulk_update_leads, enable, disable) Enable and disable routes are placeholder stubs pending Task Manager wiring (elastic#15955). Relates to: elastic/security-team#15953 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Flaky Test Runner was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the guidelines - [ ] Review the backport guidelines and apply applicable `backport:*` labels. ## Testing Steps **Manual verification** Start Kibana locally and test the API endpoints below. ## API Examples ### Generate leads (async) ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/generate" \ -H "kbn-xsrf: true" \ -H "Content-Type: application/json" \ -H "elastic-api-version: 1" \ -u <....> \ -d '{"connectorId": "optional-connector-id"}' ``` Returns: `{ "executionUuid": "abc-123-..." }` ### Find leads ```bash curl -X GET "http://localhost:5601/internal/entity_analytics/leads?page=1&perPage=10&sortField=priority&sortOrder=desc" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "leads": [...], "total": 42, "page": 1, "perPage": 10 }` ### Get lead by ID ```bash curl -X GET "http://localhost:5601/internal/entity_analytics/leads/{id}" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: full `leadSchema` object ### Get status ```bash curl -X GET "http://localhost:5601/internal/entity_analytics/leads/status" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "isEnabled": false, "indexExists": true, "totalLeads": 42, "lastRun": "..." }` ### Dismiss a lead ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/{id}/_dismiss" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "success": true }` ### Bulk update ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/bulk_update" \ -H "kbn-xsrf: true" \ -H "Content-Type: application/json" \ -H "elastic-api-version: 1" \ -u <....> \ -d '{"ids": ["id-1", "id-2"], "status": "dismissed"}' ``` Returns: `{ "updated": 2 }` ### Enable scheduled generation ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/enable" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "success": true }` ### Disable scheduled generation ```bash curl -X POST "http://localhost:5601/internal/entity_analytics/leads/disable" \ -H "kbn-xsrf: true" \ -H "elastic-api-version: 1" \ -u <....> ``` Returns: `{ "success": true }` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Jared Burgett <147995946+jaredburgettelastic@users.noreply.github.com> Co-authored-by: jaredburgettelastic <jared.burgett@elastic.co>
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.
Backports the following commits to 6.x: