Skip to content

Commit ce5f2cd

Browse files
committed
Run SMP tests only on PRs containing changes that can impact agent artifacts
1 parent bfda662 commit ce5f2cd

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed

.gitlab-ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,31 @@ variables:
330330
- .gitlab/deploy/container_build/fakeintake.yml
331331
- .gitlab/deploy/dev_container_deploy/fakeintake.yml
332332

333+
# Paths that impact the final build artifacts (rpm, deb, docker images, etc.)
334+
# Used to conditionally skip expensive tests like SMP when only non-artifact files change
335+
# like documentation, CI config, e2e tests.
336+
.artifacts_build_impacting_paths: &artifacts_build_impacting_paths
337+
paths:
338+
# agent source code
339+
- go.mod
340+
- go.sum
341+
- cmd/**/*
342+
- comp/**/*
343+
- internal/**/*
344+
- pkg/**/*
345+
- rtloader/**/*
346+
# Build system
347+
- tasks/*agent*.py
348+
- tasks/build_tags.py
349+
- deps/**/*
350+
- omnibus/**/*
351+
- .bazelrc
352+
- .bazelversion
353+
- bazel/**/*
354+
- BUILD.bazel
355+
- MODULE.bazel
356+
- release.json
357+
333358
.if_coverage_pipeline: &if_coverage_pipeline
334359
if: $E2E_COVERAGE_PIPELINE == "true"
335360

@@ -477,6 +502,12 @@ workflow:
477502
- <<: *if_tagged_commit
478503
when: never
479504

505+
.on_dev_branch_with_artifact_changes:
506+
- !reference [.on_dev_branches]
507+
- changes:
508+
<<: *artifacts_build_impacting_paths
509+
compare_to: $COMPARE_TO_BRANCH
510+
480511
.on_main_or_release_branch_or_deploy_always:
481512
- <<: *if_deploy
482513
when: always

.gitlab/deploy/container_build/docker_linux.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@ single_machine_performance-full-amd64-a7:
180180
stage: container_build
181181
rules:
182182
- !reference [.except_mergequeue]
183-
- when: on_success
183+
# Always publish SMP images on main (needed for baseline comparisons)
184+
- !reference [.on_main]
185+
# On dev branches, only publish when artifact-impacting files change.
186+
# This skips SMP for doc-only, CI-only, or e2e test-only PRs.
187+
- !reference [.on_dev_branch_with_artifact_changes]
184188
needs:
185189
- docker_build_agent7_full
186190
variables:

.gitlab/test/functional_test/regression_detector.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ single_machine_performance-regression_detector-merge_base_check:
33
timeout: 10m
44
rules:
55
- !reference [.except_coverage_pipeline]
6-
- !reference [.on_dev_branches]
6+
# Only run SMP on dev branches when artifact-impacting files change.
7+
# This skips SMP for doc-only, CI-only, or e2e test-only PRs.
8+
- !reference [.on_dev_branches_with_artifact_changes]
79
- when: on_success
810
image: registry.ddbuild.io/ci/datadog-agent-buildimages/docker_x64$CI_IMAGE_DOCKER_X64_SUFFIX:$CI_IMAGE_DOCKER_X64
911
tags: ["arch:amd64", "specific:true"]
@@ -78,7 +80,9 @@ single_machine_performance-regression_detector-merge_base_check:
7880
tags: ["arch:amd64", "specific:true"]
7981
rules:
8082
- !reference [.except_coverage_pipeline] # Coverage pipeline creates a duplicate, specialized artifact that is not useful to run through SMP on every PR
81-
- !reference [.on_dev_branches]
83+
# Only run SMP on dev branches when artifact-impacting files change.
84+
# This skips SMP for doc-only, CI-only, or e2e test-only PRs.
85+
- !reference [.on_dev_branches_with_artifact_changes]
8286
- when: on_success
8387
artifacts:
8488
expire_in: 1 weeks
@@ -347,7 +351,9 @@ single-machine-performance-regression_detector-pr-comment:
347351
stage: functional_test
348352
rules:
349353
- !reference [.except_coverage_pipeline] # Coverage pipeline creates a duplicate, specialized artifact that is not useful to run through SMP on every PR
350-
- !reference [.on_dev_branches]
354+
# Only run SMP on dev branches when artifact-impacting files change.
355+
# This skips SMP for doc-only, CI-only, or e2e test-only PRs.
356+
- !reference [.on_dev_branches_with_artifact_changes]
351357
- when: always
352358
image:
353359
name: "486234852809.dkr.ecr.us-east-1.amazonaws.com/pr-commenter:3-jammy"

0 commit comments

Comments
 (0)