Skip to content

Commit

Permalink
Merge branch 'main' into refactor-integrations-to-not-depend-on-main-…
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
achyutjhunjhunwala authored Jul 4, 2024
2 parents b15f822 + 07a7430 commit 2c42112
Show file tree
Hide file tree
Showing 14 changed files with 538 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,66 @@ steps:
automatic:
- exit_status: '-1'
limit: 1

- group: "API MKI - Explore"
key: api_test_explore
steps:
- label: Running explore:hosts:runner:qa:serverless
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:hosts:runner:qa:serverless
key: explore:hosts:runner:qa:serverless
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2

- label: Running explore:network:runner:qa:serverless
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:network:runner:qa:serverless
key: explore:network:runner:qa:serverless
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2

- label: Running explore:overview:runner:qa:serverless
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:overview:runner:qa:serverless
key: explore:overview:runner:qa:serverless
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2

- label: Running explore:users:runner:qa:serverless
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:users:runner:qa:serverless
key: explore:users:runner:qa:serverless
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,36 @@ steps:
automatic:
- exit_status: '-1'
limit: 1

- group: "API MKI - Investigations"
key: api_test_investigations
steps:
- label: Running investigations:timeline:runner:qa:serverless
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh investigations:timeline:runner:qa:serverless
key: investigations:timeline:runner:qa:serverless
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2

- label: Running investigations:saved-objects:runner:qa:serverless
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh investigations:saved-objects:runner:qa:serverless
key: investigations:saved-objects:runner:qa:serverless
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,66 @@ steps:
automatic:
- exit_status: '-1'
limit: 1

- group: "API MKI - Explore"
key: api_test_explore
steps:
- label: Running explore:hosts:runner:qa:serverless:release
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:hosts:runner:qa:serverless:release
key: explore:hosts:runner:qa:serverless:release
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2

- label: Running explore:network:runner:qa:serverless:release
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:network:runner:qa:serverless:release
key: explore:network:runner:qa:serverless:release
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2

- label: Running explore:overview:runner:qa:serverless:release
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:overview:runner:qa:serverless:release
key: explore:overview:runner:qa:serverless:release
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2

- label: Running explore:users:runner:qa:serverless:release
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:users:runner:qa:serverless:release
key: explore:users:runner:qa:serverless:release
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,36 @@ steps:
automatic:
- exit_status: '-1'
limit: 1

- group: "API MKI - Investigations"
key: api_test_investigations
steps:
- label: Running investigations:timeline:runner:qa:serverless:release
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh investigations:timeline:runner:qa:serverless:release
key: investigations:timeline:runner:qa:serverless:release
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2

- label: Running investigations:saved-objects:runner:qa:serverless:release
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh investigations:saved-objects:runner:qa:serverless:release
key: investigations:saved-objects:runner:qa:serverless:release
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2
2 changes: 1 addition & 1 deletion x-pack/plugins/ml/server/routes/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export function systemRoutes(
path: `${ML_INTERNAL_BASE_PATH}/ml_node_count`,
access: 'internal',
options: {
tags: ['access:ml:canGetJobs', 'access:ml:canGetDatafeeds'],
tags: ['access:ml:canGetMlInfo'],
},
})
.addVersion(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ export const cloudSecurityMetringCallback = async ({
lastSuccessfulReport,
config,
}: MeteringCallbackInput): Promise<MeteringCallBackResponse> => {
const projectHasCloudProductLine = config.productTypes.some(
(product) => product.product_line === ProductLine.cloud
);

if (!projectHasCloudProductLine) {
logger.info('No cloud product line found in the project');
return { records: [] };
}

const projectId = cloudSetup?.serverless?.projectId || 'missing_project_id';

const tier: Tier = getCloudProductTier(config, logger);
Expand All @@ -30,8 +39,8 @@ export const cloudSecurityMetringCallback = async ({

const promiseResults = await Promise.allSettled(
cloudSecuritySolutions.map((cloudSecuritySolution) => {
if (cloudSecuritySolution === CLOUD_DEFEND) {
return getCloudDefendUsageRecords({
if (cloudSecuritySolution !== CLOUD_DEFEND) {
return getCloudSecurityUsageRecord({
esClient,
projectId,
logger,
Expand All @@ -41,7 +50,9 @@ export const cloudSecurityMetringCallback = async ({
tier,
});
}
return getCloudSecurityUsageRecord({

// since lastSuccessfulReport is not used by getCloudSecurityUsageRecord, we want to verify if it is used by getCloudDefendUsageRecords before getCloudSecurityUsageRecord.
return getCloudDefendUsageRecords({
esClient,
projectId,
logger,
Expand Down
Loading

0 comments on commit 2c42112

Please sign in to comment.