Skip to content

Commit 92e4a93

Browse files
authored
Fix queries in examples (#308)
- The `buildStartTime` operator was inverted, causing the examples run time to be much longer than expected when API cache is off - `buildOutcome:failed` shouldn't be in the examples, since they're supposed to present all builds
1 parent 93741f5 commit 92e4a93

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

examples/example-notebooks/MostFrequentBuilds.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
"val builds: List<GradleAttributes> = runBlocking {\n",
115115
" api.buildsApi.getBuildsFlow(\n",
116116
" fromInstant = 0,\n",
117-
" query = \"\"\"buildStartTime<-7d tag:local buildOutcome:failed\"\"\",\n",
117+
" query = \"\"\"buildStartTime>-7d tag:local\"\"\",\n",
118118
" models = listOf(BuildModelName.gradleAttributes),\n",
119119
" ).map {\n",
120120
" it.models!!.gradleAttributes!!.model!!\n",

examples/example-project/src/main/kotlin/com/gabrielfeo/develocity/api/example/analysis/MostFrequentBuilds.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ suspend fun mostFrequentBuilds(
2727
// Fetch builds from the API
2828
val builds: List<GradleAttributes> = api.getBuildsFlow(
2929
fromInstant = 0,
30-
query = """buildStartTime<$startTime tag:local buildOutcome:failed""",
30+
query = """buildStartTime>$startTime tag:local""",
3131
models = listOf(BuildModelName.gradleAttributes),
3232
).map {
3333
it.models!!.gradleAttributes!!.model!!

examples/example-scripts/example-script.main.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ val api = DevelocityApi.newInstance()
3838
val builds: List<GradleAttributes> = runBlocking {
3939
api.buildsApi.getBuildsFlow(
4040
fromInstant = 0,
41-
query = """buildStartTime<-7d tag:local buildOutcome:failed""",
41+
query = """buildStartTime>-7d tag:local""",
4242
models = listOf(BuildModelName.gradleAttributes),
4343
).map {
4444
it.models!!.gradleAttributes!!.model!!

0 commit comments

Comments
 (0)