Skip to content

Commit 3ccf85e

Browse files
committed
Revert "Run CI only for changed modules in pull requests (#6610)"
This reverts commit f66853f.
1 parent 15f80b5 commit 3ccf85e

File tree

4 files changed

+9
-67
lines changed

4 files changed

+9
-67
lines changed

.circleci/collect_results.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,8 @@ shopt -s globstar
1010
TEST_RESULTS_DIR=./results
1111
mkdir -p $TEST_RESULTS_DIR >/dev/null 2>&1
1212

13-
mkdir -p $TEST_RESULTS_DIR
14-
15-
mkdir -p workspace
16-
mapfile -t test_result_dirs < <(find workspace -name test-results -type d)
17-
18-
if [[ ${#test_result_dirs[@]} -eq 0 ]]; then
19-
echo "No test results found"
20-
exit 0
21-
fi
22-
2313
echo "saving test results"
24-
find "${test_result_dirs[@]}" -name \*.xml -exec sh -c '
14+
mkdir -p $TEST_RESULTS_DIR
15+
find workspace/**/build/test-results -name \*.xml -exec sh -c '
2516
file=$(echo "$0" | rev | cut -d "/" -f 1,2,5 | rev | tr "/" "_")
2617
cp "$0" "$1/$file"' {} $TEST_RESULTS_DIR \;

.circleci/config.continue.yml.j2

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,6 @@ commands:
9999
setup_code:
100100
steps:
101101
- checkout
102-
{% if use_git_changes %}
103-
- run:
104-
name: Fetch base branch
105-
command: git fetch origin {{ pr_base_ref }}
106-
{% endif %}
107102
- run:
108103
name: Checkout merge commit
109104
command: .circleci/checkout_merge_commit.sh
@@ -306,10 +301,6 @@ jobs:
306301
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'"
307302
./gradlew clean
308303
<< parameters.gradleTarget >>
309-
{% if use_git_changes %}
310-
-Paffected_module_detector.enable
311-
-PbaseBranch=origin/{{ pr_base_ref }}
312-
{% endif %}
313304
-PskipTests
314305
<< pipeline.parameters.gradle_flags >>
315306
--max-workers=8
@@ -402,10 +393,6 @@ jobs:
402393
GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx2G -Xms2G -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'"
403394
./gradlew
404395
<< parameters.gradleTarget >>
405-
{% if use_git_changes %}
406-
-Paffected_module_detector.enable
407-
-PbaseBranch=origin/{{ pr_base_ref }}
408-
{% endif %}
409396
-PskipTests
410397
-PrunBuildSrcTests
411398
-PtaskPartitionCount=${CIRCLE_NODE_TOTAL} -PtaskPartition=${CIRCLE_NODE_INDEX}
@@ -552,10 +539,6 @@ jobs:
552539
./gradlew
553540
<< parameters.gradleTarget >>
554541
<< parameters.gradleParameters >>
555-
{% if use_git_changes %}
556-
-Paffected_module_detector.enable
557-
-PbaseBranch=origin/{{ pr_base_ref }}
558-
{% endif %}
559542
-PtaskPartitionCount=${CIRCLE_NODE_TOTAL} -PtaskPartition=${CIRCLE_NODE_INDEX}
560543
<<# parameters.testJvm >>-PtestJvm=<< parameters.testJvm >><</ parameters.testJvm >>
561544
<< pipeline.parameters.gradle_flags >>

.circleci/render_config.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929
# Version to use for all the base Docker images, see
3030
# https://github.com/DataDog/dd-trace-java-docker-build/pkgs/container/dd-trace-java-docker-build
31-
DOCKER_IMAGE_VERSION = "v24.01"
31+
DOCKER_IMAGE_VERSION="v24.01"
3232

3333
# Get labels from pull requests to override some defaults for jobs to run.
3434
# `run-tests: all` will run all tests.
@@ -52,7 +52,7 @@
5252
)
5353
resp.raise_for_status()
5454
except Exception as e:
55-
print(f"Request failed: {e}")
55+
print(f"Request filed: {e}")
5656
time.sleep(1)
5757
continue
5858
data = resp.json()
@@ -63,16 +63,12 @@
6363
labels = {
6464
l.replace("run-tests: ", "") for l in labels if l.startswith("run-tests: ")
6565
}
66-
# get the base reference (e.g. `master`), commit hash is also available at the `sha` field.
67-
pr_base_ref = data.get("base", {}).get("ref")
6866
else:
6967
labels = set()
7068

71-
branch = os.environ.get("CIRCLE_BRANCH", "")
72-
run_all = "all" in labels
73-
is_master_or_release = branch == "master" or branch.startswith("release/v")
7469

75-
if is_master_or_release or run_all:
70+
branch = os.environ.get("CIRCLE_BRANCH", "")
71+
if branch == "master" or branch.startswith("release/v") or "all" in labels:
7672
all_jdks = ALWAYS_ON_JDKS | MASTER_ONLY_JDKS
7773
else:
7874
all_jdks = ALWAYS_ON_JDKS | (MASTER_ONLY_JDKS & labels)
@@ -87,9 +83,6 @@
8783
is_weekly = os.environ.get("CIRCLE_IS_WEEKLY", "false") == "true"
8884
is_regular = not is_nightly and not is_weekly
8985

90-
# Use git changes detection on PRs
91-
use_git_changes = not run_all and not is_master_or_release and is_regular
92-
9386
vars = {
9487
"is_nightly": is_nightly,
9588
"is_weekly": is_weekly,
@@ -99,14 +92,12 @@
9992
"nocov_jdks": nocov_jdks,
10093
"flaky": branch == "master" or "flaky" in labels or "all" in labels,
10194
"docker_image_prefix": "" if is_nightly else f"{DOCKER_IMAGE_VERSION}-",
102-
"use_git_changes": use_git_changes,
103-
"pr_base_ref": pr_base_ref,
10495
}
10596

10697
print(f"Variables for this build: {vars}")
10798

10899
loader = jinja2.FileSystemLoader(searchpath=SCRIPT_DIR)
109-
env = jinja2.Environment(loader=loader, trim_blocks=True)
100+
env = jinja2.Environment(loader=loader)
110101
tpl = env.get_template(TPL_FILENAME)
111102
out = tpl.render(**vars)
112103

build.gradle

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
buildscript {
22
dependencies {
33
classpath "pl.allegro.tech.build:axion-release-plugin:1.14.4"
4-
classpath "com.dropbox.affectedmoduledetector:affectedmoduledetector:0.2.2"
54
}
65

76
configurations.all {
@@ -25,8 +24,6 @@ plugins {
2524
id "me.champeau.jmh" version "0.7.0" apply false
2625
id 'org.gradle.playframework' version '0.13' apply false
2726
id 'info.solidsoft.pitest' version '1.9.11' apply false
28-
29-
id 'com.dropbox.affectedmoduledetector' version '0.2.2'
3027
}
3128

3229
description = 'dd-trace-java'
@@ -163,35 +160,15 @@ allprojects { project ->
163160
}
164161
}
165162

166-
affectedModuleDetector {
167-
baseDir = "${project.rootDir}"
168-
pathsAffectingAllModules = [".circleci/", "buildSrc/"]
169-
specifiedBranch = project.hasProperty("baseBranch") ? project.property("baseBranch") : "origin/master"
170-
compareFrom = "SpecifiedBranchCommit"
171-
excludedModules = []
172-
includeUncommitted = true
173-
}
174-
175-
subprojects { subproject ->
176-
subproject.tasks.withType(Test) { testTask ->
177-
com.dropbox.affectedmoduledetector.AffectedModuleDetector.configureTaskGuard(testTask)
178-
}
179-
}
180163

181164
def testAggregate(String baseTaskName, includePrefixes, excludePrefixes) {
182-
183165
def createRootTask = { rootTaskName, subProjTaskName ->
184-
tasks.register(rootTaskName) { aggTask ->
166+
tasks.register(rootTaskName) { aggTest ->
185167
subprojects { subproject ->
186168
if (subproject.property("activePartition") && includePrefixes.any { subproject.path.startsWith(it) } && !excludePrefixes.any { subproject.path.startsWith(it) }) {
187-
def affected = com.dropbox.affectedmoduledetector.AffectedModuleDetector.isProjectAffected(subproject)
188169
def testTask = subproject.tasks.findByName(subProjTaskName)
189170
if (testTask != null) {
190-
if (affected) {
191-
aggTask.dependsOn(testTask)
192-
} else {
193-
logger.info("Skipped based on git changes: ${subproject.path}")
194-
}
171+
aggTest.dependsOn(testTask)
195172
}
196173
}
197174
}

0 commit comments

Comments
 (0)