[AlertZero] Onboarding MVP: per-space enablement, enable/disable transaction, derived-state UI - #290458
Draft
patrykkopycinski wants to merge 2 commits into
Draft
[AlertZero] Onboarding MVP: per-space enablement, enable/disable transaction, derived-state UI#290458patrykkopycinski wants to merge 2 commits into
patrykkopycinski wants to merge 2 commits into
Conversation
…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).
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
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.
Summary
Implements the AlertZero onboarding MVP end-to-end.
alertzero:enabledadvanced setting, registered viauiSettings.register(per-space). Privilege gate iscapabilities.advancedSettings.save(Agent Builder precedent).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 leavesenabledtrue.useOnboardingStatederives state from the setting + watches + run status; nothing stored, no tour framework.OnboardingGaterenders 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.useMockData: false.Test plan
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.node scripts/type_check.js --project x-pack/solutions/security/plugins/alertzero/tsconfig.json→exited with 0.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
retryOnTransientErrorto a single retry so a persistently-failing watches/proposals backend surfaces the empty state instead of an ~11s loading-prompt hang.