Skip to content

[Sig Events] Per-step connector overrides for onboarding and insights discovery#261588

Merged
cesco-f merged 17 commits intoelastic:mainfrom
cesco-f:selected-streams-features-identification
Apr 8, 2026
Merged

[Sig Events] Per-step connector overrides for onboarding and insights discovery#261588
cesco-f merged 17 commits intoelastic:mainfrom
cesco-f:selected-streams-features-identification

Conversation

@cesco-f
Copy link
Copy Markdown
Contributor

@cesco-f cesco-f commented Apr 7, 2026

Summary

  • Replaces the single "Onboard Streams" button with a unified split button that supports configurable onboarding: users can select which steps to run (KI Features, KI Queries, or both) and pick different connectors for each step via a popover.
  • Adds a connector override popover to the "Discover Significant Events" button, allowing users to temporarily override the LLM connector used for insights discovery (sticky for the session, not persisted).
  • Restores the 12-hour features identification recency check (removed in [Sig Events] Unified KIs table in Stream details UI [Sig Events] Unified KIs table in Stream details UI #259553), conditionally bypassed when the user explicitly runs only the features identification step.
  • Adds per-step connector overrides end-to-end: the onboarding and insights discovery routes, task params, and task runners now accept optional connector overrides, falling back to resolveConnectorForFeature() when no override is provided.
  • Disables table row selection for streams that have an onboarding task in progress, preventing duplicate scheduling.
  • Renames "Knowledge Indicators" / "Queries" column headers to "KI Features" / "KI Queries" for consistency across all UI strings.
Screen.Recording.2026-04-08.at.14.26.20.mov

@cesco-f cesco-f added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Feature:SigEvents Significant events feature, related to streams and rules/alerts (RnA) Team:SigEvents Project team working on Significant Events labels Apr 7, 2026
@github-actions github-actions bot added the author:actionable-obs PRs authored by the actionable obs team label Apr 7, 2026
@cesco-f cesco-f force-pushed the selected-streams-features-identification branch from 1271b19 to 41ffb00 Compare April 7, 2026 15:27
@cesco-f cesco-f force-pushed the selected-streams-features-identification branch from 41ffb00 to b8dbfae Compare April 7, 2026 15:40
@cesco-f cesco-f force-pushed the selected-streams-features-identification branch from b8dbfae to d41dadb Compare April 7, 2026 15:42
@cesco-f
Copy link
Copy Markdown
Contributor Author

cesco-f commented Apr 7, 2026

@coderabbitai full review

@cesco-f
Copy link
Copy Markdown
Contributor Author

cesco-f commented Apr 7, 2026

/ci

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

✅ Actions performed

Full review triggered.

1 similar comment
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

Caution

Review failed

The head commit changed during the review from d41dadb to 486bf5d.

📝 Walkthrough

Walkthrough

Extended task definitions (significant_events_queries_generation, features_identification, onboarding) and the onboarding route to accept optional connectorId or connectors parameters. Task runners use these overrides when provided, otherwise fall back to connector resolution. Task completion and failure payloads now include connector IDs. Added a new OnboardingConfigPopover React component for managing onboarding steps and connector selection. Introduced useInferenceFeatureConnectors hook to fetch connectors by feature ID. Updated the onboarding API hook to accept optional steps and connectors in scheduling options.

Possibly related PRs

  • [SigEvents] Add model setting tab #257678 — Modifies connector handling in the same significant-events task and route files, but removes connectorId from params and replaces it with runtime resolution via modelSettingsClient instead.

Suggested labels

v9.4.0

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@x-pack/platform/plugins/shared/streams_app/public/components/sig_events/significant_events_discovery/components/streams_view/streams_view.tsx`:
- Around line 92-110: The effect currently backfills onboardingConfig.connectors
with resolved defaults (via setOnboardingConfig in the useEffect), which removes
the ability to represent "no override"; remove this automatic write so
connectors remains empty unless the user explicitly chooses one. Specifically,
stop updating onboardingConfig.connectors inside the useEffect that watches
featuresConnectors.resolvedConnector and queriesConnectors.resolvedConnector (or
change it to update a separate transient defaults object rather than calling
setOnboardingConfig), and ensure any request/serialization logic reads resolved
defaults at request time when onboardingConfig.connectors.features/queries is
undefined rather than writing those defaults into onboardingConfig; keep the
initial connectors = {} and only call setOnboardingConfig to set connectors when
a user action selects an override.

In
`@x-pack/platform/plugins/shared/streams/server/lib/tasks/task_definitions/onboarding.ts`:
- Around line 118-142: The current freshness check around areFeaturesUpToDate
allows reusing a recent features-identification task even when the current run
passed a different connectors.features override; update the logic so the reuse
is disabled whenever a connector override is present or make areFeaturesUpToDate
consider connector identity. Concretely, modify the branch around
areFeaturesUpToDate(...) to either (a) call areFeaturesUpToDate with an
additional connectorId argument (connectors?.features) and have that function
verify the stored task used the same connector, or (b) add an explicit guard
that if connectors?.features is set then skip reuse and always call
scheduleFeaturesIdentificationTask(...) and waitForSubtask(...); reference
functions: areFeaturesUpToDate, scheduleFeaturesIdentificationTask,
waitForSubtask and symbol connectors.features and featuresTaskId.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 4ef04eae-80f4-40b3-9342-2781634367e8

📥 Commits

Reviewing files that changed from the base of the PR and between aa68f24 and d41dadb.

📒 Files selected for processing (9)
  • x-pack/platform/plugins/shared/streams/server/lib/sig_events/tasks/significant_events_queries_generation.ts
  • x-pack/platform/plugins/shared/streams/server/lib/tasks/task_definitions/features_identification/index.ts
  • x-pack/platform/plugins/shared/streams/server/lib/tasks/task_definitions/onboarding.ts
  • x-pack/platform/plugins/shared/streams/server/routes/internal/streams/onboarding/route.ts
  • x-pack/platform/plugins/shared/streams_app/public/components/sig_events/significant_events_discovery/components/streams_view/onboarding_config_popover.tsx
  • x-pack/platform/plugins/shared/streams_app/public/components/sig_events/significant_events_discovery/components/streams_view/streams_view.tsx
  • x-pack/platform/plugins/shared/streams_app/public/components/sig_events/significant_events_discovery/components/streams_view/translations.ts
  • x-pack/platform/plugins/shared/streams_app/public/hooks/sig_events/use_inference_feature_connectors.ts
  • x-pack/platform/plugins/shared/streams_app/public/hooks/use_onboarding_api.ts

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

This change introduces optional per-step connector override capabilities to the streams onboarding workflow. On the server side, three task types—SignificantEventsQueriesGeneration, FeaturesIdentification, and Onboarding—now accept optional connectorId fields in their parameters. Each task resolves the connector by checking for an override first, then falling back to runtime resolution. The onboarding route endpoint now accepts optional connectors input (with features and queries identifiers), which threads through to task scheduling. On the client side, a new popover component enables users to select which onboarding steps to run and configure step-specific connectors, backed by a new hook that fetches available inference connectors. The onboarding flow also adds a 12-hour recency check to optionally reuse previously completed features identification tasks.

Possibly related PRs

  • [SigEvents] Add model setting tab #257678: Modifies the same task and route interfaces for connector handling in Significant Events tasks but takes the opposite approach—removing connectorId from parameters and resolving it at runtime via model settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@x-pack/platform/plugins/shared/streams/server/lib/tasks/task_definitions/onboarding.ts`:
- Around line 60-80: areFeaturesUpToDate currently only checks task status and
recency and must also verify the features connector matches the currently
selected connector; change the areFeaturesUpToDate signature to accept the
expected features connector (or expected connectors object), then after fetching
featuresTask read the persisted connector from
featuresTask.params?.connectors?.features (or params.connectors) and return
false if it differs before performing the age check against
FEATURES_IDENTIFICATION_RECENCY_MS; apply the same connector-matching check to
the analogous function/usage later in the file (the block around the other
features recency check).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: e54f79dc-26dd-4c80-b85d-195d0431140c

📥 Commits

Reviewing files that changed from the base of the PR and between aa68f24 and d41dadb.

📒 Files selected for processing (9)
  • x-pack/platform/plugins/shared/streams/server/lib/sig_events/tasks/significant_events_queries_generation.ts
  • x-pack/platform/plugins/shared/streams/server/lib/tasks/task_definitions/features_identification/index.ts
  • x-pack/platform/plugins/shared/streams/server/lib/tasks/task_definitions/onboarding.ts
  • x-pack/platform/plugins/shared/streams/server/routes/internal/streams/onboarding/route.ts
  • x-pack/platform/plugins/shared/streams_app/public/components/sig_events/significant_events_discovery/components/streams_view/onboarding_config_popover.tsx
  • x-pack/platform/plugins/shared/streams_app/public/components/sig_events/significant_events_discovery/components/streams_view/streams_view.tsx
  • x-pack/platform/plugins/shared/streams_app/public/components/sig_events/significant_events_discovery/components/streams_view/translations.ts
  • x-pack/platform/plugins/shared/streams_app/public/hooks/sig_events/use_inference_feature_connectors.ts
  • x-pack/platform/plugins/shared/streams_app/public/hooks/use_onboarding_api.ts

@cesco-f
Copy link
Copy Markdown
Contributor Author

cesco-f commented Apr 7, 2026

/ci

@cesco-f
Copy link
Copy Markdown
Contributor Author

cesco-f commented Apr 7, 2026

@elasticmachine merge upstream

@cesco-f
Copy link
Copy Markdown
Contributor Author

cesco-f commented Apr 7, 2026

/ci

@cesco-f
Copy link
Copy Markdown
Contributor Author

cesco-f commented Apr 7, 2026

@elasticmachine merge upstream

@cesco-f
Copy link
Copy Markdown
Contributor Author

cesco-f commented Apr 7, 2026

/ci

@achyutjhunjhunwala achyutjhunjhunwala self-requested a review April 8, 2026 09:43
@achyutjhunjhunwala
Copy link
Copy Markdown
Contributor

@cesco-f I am still reviewing the PR, but thought of sharing this earlier. The UX for the dropdown looks different from what @boriskirov has proposed in his wireframes in the linked Figma. Is this intentional ?

@cesco-f
Copy link
Copy Markdown
Contributor Author

cesco-f commented Apr 8, 2026

@cesco-f I am still reviewing the PR, but thought of sharing this earlier. The UX for the dropdown looks different from what @boriskirov has proposed in his wireframes in the linked Figma. Is this intentional ?

Hey @achyutjhunjhunwala! Yes, we decided to split the functionality from the final UX experience, @boriskirov will take care of that in a separate PR.

@boriskirov
Copy link
Copy Markdown
Contributor

@cesco-f I am still reviewing the PR, but thought of sharing this earlier. The UX for the dropdown looks different from what @boriskirov has proposed in his wireframes in the linked Figma. Is this intentional ?

Hey @achyutjhunjhunwala! Yes, we decided to split the functionality from the final UX experience, @boriskirov will take care of that in a separate PR.

Yes, I will open another one with the UX improvements, once this gets merged, as a follow up @achyutjhunjhunwala

@cesco-f cesco-f changed the title [Sig Events] Unified onboarding button with per-step connector overrides [Sig Events] Per-step connector overrides for onboarding and insights discovery Apr 8, 2026
cesco-f and others added 2 commits April 8, 2026 14:57
…ig_events/significant_events_discovery/components/streams_view/streams_view.tsx

Co-authored-by: Achyut Jhunjhunwala <achyut.jhunjhunwala@gmail.com>
@achyutjhunjhunwala
Copy link
Copy Markdown
Contributor

@cesco-f Thanks for these changes, i have added couple of short comments.

1 additional UX issue i found was, lets say user open the popover and deselects both the options (KI and Rules). Closes the pop up. Now even though they have selected streams, onboard streams is not enabled and the user has no way of identifying why. One solution to this could be, at least 1 option must be enabled

cc: @boriskirov

image

@cesco-f
Copy link
Copy Markdown
Contributor Author

cesco-f commented Apr 8, 2026

@cesco-f Thanks for these changes, i have added couple of short comments.

1 additional UX issue i found was, lets say user open the popover and deselects both the options (KI and Rules). Closes the pop up. Now even though they have selected streams, onboard streams is not enabled and the user has no way of identifying why. One solution to this could be, at least 1 option must be enabled

cc: @boriskirov

image

Thanks for the great review @achyutjhunjhunwala, I've addressed your comments!

I'll leave the UX issue to @boriskirov.

Copy link
Copy Markdown
Contributor

@achyutjhunjhunwala achyutjhunjhunwala left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

All of the files in here are actually sigevents code, not sure why they trigger code review for the onboarding team

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.

@CoenWarmer should this file be owned by the onboarding team?

@cesco-f
Copy link
Copy Markdown
Contributor Author

cesco-f commented Apr 8, 2026

All of the files in here are actually sigevents code, not sure why they trigger code review for the onboarding team

I think it's because of the moon file.

@cesco-f cesco-f enabled auto-merge (squash) April 8, 2026 16:36
@cesco-f cesco-f merged commit ea3a3b4 into elastic:main Apr 8, 2026
21 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #1 / buildEsqlFetchSubscribe changing a ES|QL query with no transformational commands should not change state when loading and finished if index pattern and columns are the same

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
streamsApp 1758 1806 +48

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
streamsApp 1.9MB 1.9MB +14.1KB

History

@cesco-f cesco-f deleted the selected-streams-features-identification branch April 8, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:actionable-obs PRs authored by the actionable obs team backport:skip This PR does not require backporting Feature:SigEvents Significant events feature, related to streams and rules/alerts (RnA) release_note:skip Skip the PR/issue when compiling release notes Team:SigEvents Project team working on Significant Events v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants