Skip to content

Commit d575af2

Browse files
authored
Reduce memory use of verify bot by deleting IDEs after verify (#8637)
1 parent 6382f0e commit d575af2

File tree

4 files changed

+47
-4
lines changed

4 files changed

+47
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Changed
66

7-
- Made log file `dash.log` (instead of `flutter.log`).
7+
- Made log file `dash.log` (instead of `flutter.log`). (#8638)
88

99
### Removed
1010

build.gradle.kts

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,36 @@ intellijPlatform {
292292
ignoredProblemsFile.set(project.file("verify-ignore-problems.txt"))
293293

294294
ides {
295-
recommended()
295+
// `singleIdeVersion` is only intended for use by GitHub actions to enable deleting instances of IDEs after testing.
296+
if (project.hasProperty("singleIdeVersion")) {
297+
val singleIdeVersion = project.property("singleIdeVersion") as String
298+
select {
299+
types = listOf(IntelliJPlatformType.AndroidStudio)
300+
channels = listOf(ProductRelease.Channel.RELEASE)
301+
sinceBuild = singleIdeVersion
302+
untilBuild = "$singleIdeVersion.*"
303+
}
304+
} else {
305+
recommended()
306+
}
307+
}
308+
}
309+
}
310+
311+
// If we don't delete old versions of the IDE during `verifyPlugin`, then GitHub action bots can run out of space.
312+
tasks.withType<VerifyPluginTask> {
313+
if (project.hasProperty("singleIdeVersion")) {
314+
doLast {
315+
ides.forEach { ide ->
316+
if (ide.exists()) {
317+
// This isn't a clean deletion because gradle has internal logic for tagging that it has downloaded something, and the tagging
318+
// isn't deleted. So if we were to run `./gradlew verifyPlugin -PsingleIdeVersion=<someVersion` twice in a row, the second time
319+
// would fail due to gradle thinking that there should be an IDE at a place it recorded from the last run.
320+
println("Deleting IDE directory at ${ide.path}")
321+
val result = ide.deleteRecursively()
322+
println("IDE was deleted? $result")
323+
}
324+
}
296325
}
297326
}
298327
}
@@ -418,4 +447,3 @@ tasks.withType<ProcessResources>().configureEach {
418447
exclude("jxbrowser/jxbrowser.properties")
419448
}
420449
}
421-

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
ideaVersion=2025.2.1.5
88
dartPluginVersion= 252.25557.23
9+
# Also update the versions for verify checks in tool/github.sh.
910
sinceBuild=243
1011
untilBuild=253.*
1112
javaVersion=21

tool/github.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,24 @@ elif [ "UNIT_TEST_BOT" = "$BOT" ] ; then
7373

7474
elif [ "VERIFY_BOT" = "$BOT" ] ; then
7575
# Run the verifier
76+
echo "Check on space before verifyPluginProjectConfiguration\n"
77+
df -h
7678
./gradlew verifyPluginProjectConfiguration
79+
echo "Check on space before verifyPluginStructure\n"
80+
df -h
7781
./gradlew verifyPluginStructure
82+
echo "Check on space before verifyPluginSignature\n"
83+
df -h
7884
./gradlew verifyPluginSignature
79-
./gradlew verifyPlugin
85+
86+
for version in 243 251 252; do
87+
echo "Check on space before verifyPlugin for $version\n"
88+
df -h
89+
./gradlew verifyPlugin -PsingleIdeVersion=$version
90+
done
91+
92+
echo "Check on space after verifyPlugin"
93+
df -h
8094

8195
elif [ "INTEGRATION_BOT" = "$BOT" ]; then
8296
# Run the integration tests

0 commit comments

Comments
 (0)