mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[Security solution] Add github label for evals for prompt changes (#224488)
This commit is contained in:
parent
f0b862f113
commit
63134aa8eb
3 changed files with 20 additions and 2 deletions
|
@ -83,6 +83,11 @@ if is_pr; then
|
||||||
export ELASTIC_APM_CONTEXT_PROPAGATION_ONLY=true
|
export ELASTIC_APM_CONTEXT_PROPAGATION_ONLY=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# value for security genai prompts evals
|
||||||
|
if is_pr_with_label "ci:security-genai-run-evals-local-prompts"; then
|
||||||
|
export IS_SECURITY_AI_PROMPT_TEST=true
|
||||||
|
fi
|
||||||
|
|
||||||
# These can be removed once we're not supporting Jenkins and Buildkite at the same time
|
# These can be removed once we're not supporting Jenkins and Buildkite at the same time
|
||||||
# These are primarily used by github checks reporter and can be configured via /github_checks_api.json
|
# These are primarily used by github checks reporter and can be configured via /github_checks_api.json
|
||||||
export ghprbGhRepository="elastic/kibana"
|
export ghprbGhRepository="elastic/kibana"
|
||||||
|
|
|
@ -470,7 +470,10 @@ const getPipeline = (filename: string, removeSteps = true) => {
|
||||||
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/scout_tests.yml'));
|
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/scout_tests.yml'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GITHUB_PR_LABELS.includes('ci:security-genai-run-evals')) {
|
if (
|
||||||
|
GITHUB_PR_LABELS.includes('ci:security-genai-run-evals') ||
|
||||||
|
GITHUB_PR_LABELS.includes('ci:security-genai-run-evals-local-prompts')
|
||||||
|
) {
|
||||||
pipeline.push(
|
pipeline.push(
|
||||||
getPipeline('.buildkite/pipelines/pull_request/security_solution/gen_ai_evals.yml')
|
getPipeline('.buildkite/pipelines/pull_request/security_solution/gen_ai_evals.yml')
|
||||||
);
|
);
|
||||||
|
|
|
@ -35,6 +35,7 @@ export default ({ getService }: FtrProviderContext) => {
|
||||||
const es = getService('es');
|
const es = getService('es');
|
||||||
const ml = getService('ml') as ReturnType<typeof MachineLearningProvider>;
|
const ml = getService('ml') as ReturnType<typeof MachineLearningProvider>;
|
||||||
const esArchiver = getService('esArchiver');
|
const esArchiver = getService('esArchiver');
|
||||||
|
const isEvalLocalPrompts = process.env.IS_SECURITY_AI_PROMPT_TEST === 'true';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Results will be written to LangSmith for project associated with the langSmithAPIKey, then later
|
* Results will be written to LangSmith for project associated with the langSmithAPIKey, then later
|
||||||
|
@ -63,6 +64,12 @@ export default ({ getService }: FtrProviderContext) => {
|
||||||
await esArchiver.load(
|
await esArchiver.load(
|
||||||
'x-pack/test/functional/es_archives/security_solution/attack_discovery_alerts'
|
'x-pack/test/functional/es_archives/security_solution/attack_discovery_alerts'
|
||||||
);
|
);
|
||||||
|
// if run is to test prompt changes, uninstall prompt integration to default to local prompts
|
||||||
|
if (isEvalLocalPrompts) {
|
||||||
|
// delete integration prompt saved objects
|
||||||
|
const route = routeWithNamespace(`/api/saved_objects/epm-packages/security_ai_prompts`);
|
||||||
|
await supertest.delete(route).set('kbn-xsrf', 'foo');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@ -78,9 +85,12 @@ export default ({ getService }: FtrProviderContext) => {
|
||||||
|
|
||||||
describe('Run Evaluations', () => {
|
describe('Run Evaluations', () => {
|
||||||
const buildNumber = process.env.BUILDKITE_BUILD_NUMBER || os.hostname();
|
const buildNumber = process.env.BUILDKITE_BUILD_NUMBER || os.hostname();
|
||||||
|
const prNumber = process.env.BUILDKITE_PULL_REQUEST;
|
||||||
const config = getSecurityGenAIConfigFromEnvVar();
|
const config = getSecurityGenAIConfigFromEnvVar();
|
||||||
const defaultEvalPayload: PostEvaluateBody = {
|
const defaultEvalPayload: PostEvaluateBody = {
|
||||||
runName: `Eval Automation${buildNumber ? ' - ' + buildNumber : ''}`,
|
runName: `Eval Automation${buildNumber ? ' | Build ' + buildNumber : ''}${
|
||||||
|
prNumber ? ' | PR ' + prNumber : ''
|
||||||
|
}${isEvalLocalPrompts ? ' | [Local Prompts]' : ''}`,
|
||||||
graphs: ['DefaultAssistantGraph'],
|
graphs: ['DefaultAssistantGraph'],
|
||||||
datasetName: 'Sample Dataset',
|
datasetName: 'Sample Dataset',
|
||||||
connectorIds: Object.keys(config.connectors),
|
connectorIds: Object.keys(config.connectors),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue