Skip to content

Commit 998ad61

Browse files
[8.19] [Security solution] Add github label for evals for prompt changes (elastic#224488) (elastic#224977)
# Backport This will backport the following commits from `main` to `8.19`: - [[Security solution] Add github label for evals for prompt changes (elastic#224488)](elastic#224488) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Steph Milovic","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-06-23T23:25:05Z","message":"[Security solution] Add github label for evals for prompt changes (elastic#224488)","sha":"63134aa8eb8a1ad1cb06356eada5af9dfca338e4","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team: SecuritySolution","Team:Security Generative AI","backport:version","v9.1.0","v8.19.0","ci:security-genai-run-evals-local-prompts"],"title":"[Security solution] Add github label for evals for prompt changes","number":224488,"url":"https://github.com/elastic/kibana/pull/224488","mergeCommit":{"message":"[Security solution] Add github label for evals for prompt changes (elastic#224488)","sha":"63134aa8eb8a1ad1cb06356eada5af9dfca338e4"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224488","number":224488,"mergeCommit":{"message":"[Security solution] Add github label for evals for prompt changes (elastic#224488)","sha":"63134aa8eb8a1ad1cb06356eada5af9dfca338e4"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Steph Milovic <[email protected]>
1 parent 3fdd625 commit 998ad61

File tree

3 files changed

+20
-2
lines changed
  • .buildkite/scripts
  • x-pack/test/security_solution_api_integration/test_suites/genai/evaluations/trial_license_complete_tier

3 files changed

+20
-2
lines changed

.buildkite/scripts/common/env.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ if is_pr; then
8383
export ELASTIC_APM_CONTEXT_PROPAGATION_ONLY=true
8484
fi
8585

86+
# value for security genai prompts evals
87+
if is_pr_with_label "ci:security-genai-run-evals-local-prompts"; then
88+
export IS_SECURITY_AI_PROMPT_TEST=true
89+
fi
90+
8691
# These can be removed once we're not supporting Jenkins and Buildkite at the same time
8792
# These are primarily used by github checks reporter and can be configured via /github_checks_api.json
8893
export ghprbGhRepository="elastic/kibana"

.buildkite/scripts/pipelines/pull_request/pipeline.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,10 @@ const getPipeline = (filename: string, removeSteps = true) => {
407407
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/scout_tests.yml'));
408408
}
409409

410-
if (GITHUB_PR_LABELS.includes('ci:security-genai-run-evals')) {
410+
if (
411+
GITHUB_PR_LABELS.includes('ci:security-genai-run-evals') ||
412+
GITHUB_PR_LABELS.includes('ci:security-genai-run-evals-local-prompts')
413+
) {
411414
pipeline.push(
412415
getPipeline('.buildkite/pipelines/pull_request/security_solution/gen_ai_evals.yml')
413416
);

x-pack/test/security_solution_api_integration/test_suites/genai/evaluations/trial_license_complete_tier/evaluations.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default ({ getService }: FtrProviderContext) => {
3535
const es = getService('es');
3636
const ml = getService('ml') as ReturnType<typeof MachineLearningProvider>;
3737
const esArchiver = getService('esArchiver');
38+
const isEvalLocalPrompts = process.env.IS_SECURITY_AI_PROMPT_TEST === 'true';
3839

3940
/**
4041
* Results will be written to LangSmith for project associated with the langSmithAPIKey, then later
@@ -63,6 +64,12 @@ export default ({ getService }: FtrProviderContext) => {
6364
await esArchiver.load(
6465
'x-pack/test/functional/es_archives/security_solution/attack_discovery_alerts'
6566
);
67+
// if run is to test prompt changes, uninstall prompt integration to default to local prompts
68+
if (isEvalLocalPrompts) {
69+
// delete integration prompt saved objects
70+
const route = routeWithNamespace(`/api/saved_objects/epm-packages/security_ai_prompts`);
71+
await supertest.delete(route).set('kbn-xsrf', 'foo');
72+
}
6673
});
6774

6875
after(async () => {
@@ -78,9 +85,12 @@ export default ({ getService }: FtrProviderContext) => {
7885

7986
describe('Run Evaluations', () => {
8087
const buildNumber = process.env.BUILDKITE_BUILD_NUMBER || os.hostname();
88+
const prNumber = process.env.BUILDKITE_PULL_REQUEST;
8189
const config = getSecurityGenAIConfigFromEnvVar();
8290
const defaultEvalPayload: PostEvaluateBody = {
83-
runName: `Eval Automation${buildNumber ? ' - ' + buildNumber : ''}`,
91+
runName: `Eval Automation${buildNumber ? ' | Build ' + buildNumber : ''}${
92+
prNumber ? ' | PR ' + prNumber : ''
93+
}${isEvalLocalPrompts ? ' | [Local Prompts]' : ''}`,
8494
graphs: ['DefaultAssistantGraph'],
8595
datasetName: 'Sample Dataset',
8696
connectorIds: Object.keys(config.connectors),

0 commit comments

Comments
 (0)