Skip to content

Commit 639941f

Browse files
fix(ci): repair Quick Checks + Check Types after PROD-5 land
The post-cleanup CI build (b441998) on PR elastic#269019 surfaced four real breakages introduced by recent commits + the cleanup itself: 1. **TS typo** in validate_rule_tool.ts:515 — concurrencyResult exposes `inflightScenarioFingerprint`, not `inflightFingerprint`. The route file already uses the right name; only the tool path had drifted. 2. **TS typing** in run_command_tools.test.ts — the parameterized `it.each(tools)` table mixes per-family schemas with different `command` literal unions; destructuring `parameters` failed because one entry didn't have it, and `getConfirmation`'s `toolParams` intersected to `never` across the four families. Made `parameters` a uniform widened type and cast `getConfirmation` through `unknown` to a single shape — runtime contract unchanged, all 62 tests still pass. 3. **TS-projects linter** rejected validate_rule.spec.ts as a stranded file (excluded from the security_solution tsconfigs but not part of any other TS project). The canonical fix — matching every other eval suite in the repo (kbn-evals-suite-pci-compliance, etc.) — is to extract the spec + its dataset into a sibling devOnly `functional-tests` package: `@kbn/evals-suite-detection-emulation` under `x-pack/solutions/security/packages/`. This keeps the production plugin clean of the devOnly `@kbn/evals` reference and gives the spec a real owning tsconfig. CODEOWNERS updated to point at the new path. 4. **Moon project regen** — running `node scripts/regenerate_moon_projects.js --update` registered the new package in `package.json`, `tsconfig.base.json`, and `yarn.lock`. Auto-generated; included. Verification (local): - jest: 88/88 pass across run_command_tools.test.ts (62) + validate_rule_tool.test.ts (6) + concurrency_gate.test.ts (10) + validate_rule/route.test.ts (10). - eslint --fix: clean on all touched files. - type_check: clean on the new evals suite package (~70s) AND on the full security_solution plugin (~6m). No behavioural changes; this is purely a CI-repair commit.
1 parent 14560c1 commit 639941f

15 files changed

Lines changed: 107 additions & 30 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3198,7 +3198,7 @@ x-pack/platform/test/automatic_import_api_integration @elastic/integration-exper
31983198
/x-pack/solutions/security/plugins/security_solution/common/detection_emulation @elastic/security-detection-engine @elastic/security-defend-workflows
31993199
/x-pack/solutions/security/plugins/security_solution/public/detections/components/emulation @elastic/security-detection-engine @elastic/security-defend-workflows
32003200
/x-pack/solutions/security/plugins/security_solution/server/agent_builder/skills/detection_emulation @elastic/security-detection-engine @elastic/security-defend-workflows
3201-
/x-pack/solutions/security/plugins/security_solution/server/agent_builder/skills/detection_emulation/evals @elastic/security-detection-engine @elastic/security-defend-workflows
3201+
/x-pack/solutions/security/packages/kbn-evals-suite-detection-emulation @elastic/security-detection-engine @elastic/security-defend-workflows
32023202
/x-pack/solutions/security/plugins/security_solution/public/detections/components/osquery @elastic/security-defend-workflows
32033203

32043204
# Cloud Security Posture team

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,6 +1740,7 @@
17401740
"@kbn/evals-phoenix-executor": "link:x-pack/platform/packages/shared/kbn-evals-phoenix-executor",
17411741
"@kbn/evals-suite-agent-builder": "link:x-pack/platform/packages/shared/agent-builder/kbn-evals-suite-agent-builder",
17421742
"@kbn/evals-suite-attack-discovery": "link:x-pack/solutions/security/packages/kbn-evals-suite-attack-discovery",
1743+
"@kbn/evals-suite-detection-emulation": "link:x-pack/solutions/security/packages/kbn-evals-suite-detection-emulation",
17431744
"@kbn/evals-suite-endpoint": "link:x-pack/solutions/security/packages/kbn-evals-suite-endpoint",
17441745
"@kbn/evals-suite-entity-analytics": "link:x-pack/solutions/security/packages/kbn-evals-suite-entity-analytics",
17451746
"@kbn/evals-suite-llm-tasks": "link:x-pack/platform/packages/shared/ai-infra/kbn-evals-suite-llm-tasks",

tsconfig.base.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,8 @@
11981198
"@kbn/evals-suite-agent-builder/*": ["x-pack/platform/packages/shared/agent-builder/kbn-evals-suite-agent-builder/*"],
11991199
"@kbn/evals-suite-attack-discovery": ["x-pack/solutions/security/packages/kbn-evals-suite-attack-discovery"],
12001200
"@kbn/evals-suite-attack-discovery/*": ["x-pack/solutions/security/packages/kbn-evals-suite-attack-discovery/*"],
1201+
"@kbn/evals-suite-detection-emulation": ["x-pack/solutions/security/packages/kbn-evals-suite-detection-emulation"],
1202+
"@kbn/evals-suite-detection-emulation/*": ["x-pack/solutions/security/packages/kbn-evals-suite-detection-emulation/*"],
12011203
"@kbn/evals-suite-endpoint": ["x-pack/solutions/security/packages/kbn-evals-suite-endpoint"],
12021204
"@kbn/evals-suite-endpoint/*": ["x-pack/solutions/security/packages/kbn-evals-suite-endpoint/*"],
12031205
"@kbn/evals-suite-entity-analytics": ["x-pack/solutions/security/packages/kbn-evals-suite-entity-analytics"],

x-pack/solutions/security/plugins/security_solution/server/agent_builder/skills/detection_emulation/evals/validate_rule.spec.ts renamed to x-pack/solutions/security/packages/kbn-evals-suite-detection-emulation/evals/validate_rule.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
* additional cost per example.
3131
*
3232
* NOT a Jest test — run via the @kbn/evals Playwright eval runner.
33-
* Excluded from the plugin's main tsconfig; requires @kbn/evals (devOnly).
33+
* Lives in `@kbn/evals-suite-detection-emulation` (devOnly functional-tests
34+
* package) so the production `security_solution` plugin doesn't need to
35+
* pull in the devOnly `@kbn/evals` package as a kbn_reference.
3436
*/
3537

3638
import type { Client as EsClient } from '@elastic/elasticsearch';

x-pack/solutions/security/plugins/security_solution/server/agent_builder/skills/detection_emulation/evals/validate_rule_dataset.ts renamed to x-pack/solutions/security/packages/kbn-evals-suite-detection-emulation/evals/validate_rule_dataset.ts

File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "functional-tests",
3+
"id": "@kbn/evals-suite-detection-emulation",
4+
"owner": "@elastic/security-defend-workflows",
5+
"group": "security",
6+
"visibility": "private"
7+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This file is generated by the @kbn/moon package. Any manual edits will be erased!
2+
# To extend this, write your extensions/overrides to 'moon.extend.yml'
3+
# then regenerate this file with: 'node scripts/regenerate_moon_projects.js --update --filter @kbn/evals-suite-detection-emulation'
4+
5+
$schema: https://moonrepo.dev/schemas/project.json
6+
id: '@kbn/evals-suite-detection-emulation'
7+
layer: unknown
8+
owners:
9+
defaultOwner: '@elastic/security-defend-workflows'
10+
toolchains:
11+
default: node
12+
language: typescript
13+
project:
14+
title: '@kbn/evals-suite-detection-emulation'
15+
description: Moon project for @kbn/evals-suite-detection-emulation
16+
channel: ''
17+
owner: '@elastic/security-defend-workflows'
18+
sourceRoot: x-pack/solutions/security/packages/kbn-evals-suite-detection-emulation
19+
dependsOn:
20+
- '@kbn/evals'
21+
- '@kbn/agent-builder-common'
22+
- '@kbn/tooling-log'
23+
- '@kbn/core-http-browser'
24+
tags:
25+
- functional-tests
26+
- package
27+
- prod
28+
- group-security
29+
- private
30+
fileGroups:
31+
src:
32+
- '**/*.ts'
33+
- '!target/**/*'
34+
tasks: {}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "@kbn/evals-suite-detection-emulation",
3+
"private": true,
4+
"version": "1.0.0",
5+
"license": "Elastic License 2.0"
6+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
import { createPlaywrightEvalsConfig } from '@kbn/evals';
9+
10+
export default createPlaywrightEvalsConfig({
11+
testDir: `${__dirname}/evals`,
12+
timeout: 30 * 60_000,
13+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "@kbn/tsconfig-base/tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "target/types"
5+
},
6+
"include": ["**/*.ts"],
7+
"exclude": ["target/**/*"],
8+
"kbn_references": [
9+
"@kbn/evals",
10+
"@kbn/agent-builder-common",
11+
"@kbn/tooling-log",
12+
"@kbn/core-http-browser"
13+
]
14+
}

0 commit comments

Comments
 (0)