Skip to content

[AlertZero] Onboarding MVP: per-space enablement, enable/disable transaction, derived-state UI - #290458

Draft
patrykkopycinski wants to merge 2 commits into
elastic:mainfrom
patrykkopycinski:az-onboarding
Draft

[AlertZero] Onboarding MVP: per-space enablement, enable/disable transaction, derived-state UI#290458
patrykkopycinski wants to merge 2 commits into
elastic:mainfrom
patrykkopycinski:az-onboarding

Conversation

@patrykkopycinski

Copy link
Copy Markdown
Contributor

Summary

Implements the AlertZero onboarding MVP end-to-end.

  • Per-space enablement source of truthalertzero:enabled advanced setting, registered via uiSettings.register (per-space). Privilege gate is capabilities.advancedSettings.save (Agent Builder precedent).
  • Enable/disable transaction (POST/DELETE /internal/alertzero/onboarding/enable) — installs watch workers into the space (workflowIdSuffix=spaceId), ensures the agent for the space, and seeds Manual autonomy, with compensating rollback on failure. The setting flips last so a partial install never leaves enabled true.
  • Derived-state UI (S0–S4)useOnboardingState derives state from the setting + watches + run status; nothing stored, no tour framework. OnboardingGate renders the onboarding page (S0/S1/S2) at the app root until a run exists (state === 'active'), instead of the conversations page. Previously the S0 CTA only appeared at /onboarding.
  • Scout e2e spec against a real ES+Kibana stack with useMockData: false.

Test plan

  • Unit/integration (node scripts/jest) — 4 suites, 61/61: advanced-setting gate (use_onboarding_state.test.tsx, onboarding_page.test.tsx), enable/disable transaction + rollback (onboarding_service.test.ts), derived-state S0–S4.
  • Type-checknode scripts/type_check.js --project x-pack/solutions/security/plugins/alertzero/tsconfig.jsonexited with 0.
  • E2E (Scout)alertzero_onboarding.spec.ts: S0 CTA renders disabled; enable returns 200 and installs watch workers (workers.length > 0); post-enable empty state (S1/S2) renders.

Notes

  • Bounded retryOnTransientError to a single retry so a persistently-failing watches/proposals backend surfaces the empty state instead of an ~11s loading-prompt hang.

…ble transaction, derived-state UI, Scout e2e

- alertzero:enabled per-space advanced setting (source of truth), registered via uiSettings.register
- POST/DELETE /internal/alertzero/onboarding/enable: install watch workers into space (workflowIdSuffix=spaceId), ensure agent, compensating rollback on failure; setting flips last
- Derived onboarding states S0-S4 (disabled CTA / no watches / awaiting first run / first proposal / active) via useOnboardingState hook - no stored progress
- Scout e2e spec against real stack with useMockData:false
…etries, fix e2e spec

Add OnboardingGate so the onboarding page (S0/S1/S2) renders at the app root until a run exists (state === active), instead of the conversations page. Previously the S0 CTA only appeared at /onboarding.

Bound retryOnTransientError to one retry so a persistently-failing watches/proposals backend surfaces the empty state instead of an ~11s loading-prompt hang.

Fix the Scout e2e spec: correct fixtures (kbnClient vs scoutSpace.request), test-subject selectors, space-scoped internal API paths, JSON POST body, and make the S2 test self-contained (enable in its own space first).
@patrykkopycinski patrykkopycinski added the release_note:skip Skip the PR/issue when compiling release notes label Sep 11, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown
🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant