dev_status: Tweak defaults
Increase the number of builds requested, reduce the minimum number of
builds for comparison, and reduce the max age.
The max age increase will ensure the dev builders being compared are
more likely to come from the most recent image of dev. Increasing the
builds requested gives more of a chance for something to pass.
Decreasing the minimum number of builds lets more builders be compared
(and not excluded because because there aren't enough recent builds).
Bug: b/339638439
Change-Id: I95e43d709ffe333349408fdae817247c9528dad8
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/210034
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Reviewed-by: Taylor Cramer <cramertj@google.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
diff --git a/recipes/dev_status.proto b/recipes/dev_status.proto
index 1f33984..da8ad8e 100644
--- a/recipes/dev_status.proto
+++ b/recipes/dev_status.proto
@@ -19,9 +19,12 @@
import "google/protobuf/duration.proto";
message InputProperties {
- // Minimum number of builds to evaluate a builder. Defaults to 10.
+ // Minimum number of builds to evaluate a builder. Defaults to 4.
int32 min_builds = 1;
+ // Number of builds to request from buildbucket. Defaults to 10.
+ int32 requested_builds = 2;
+
// Maximum age for builds to consider. Defaults to 7 days.
- google.protobuf.Duration max_age = 2;
+ google.protobuf.Duration max_age = 3;
}
diff --git a/recipes/dev_status.py b/recipes/dev_status.py
index 1832afe..c93f5f8 100644
--- a/recipes/dev_status.py
+++ b/recipes/dev_status.py
@@ -42,8 +42,9 @@
PROPERTIES = InputProperties
-DEFAULT_MIN_BUILDS = 10
-DEFAULT_MAX_AGE = datetime.timedelta(days=21)
+DEFAULT_REQUESTED_BUILDS = 10
+DEFAULT_MIN_BUILDS = 4
+DEFAULT_MAX_AGE = datetime.timedelta(days=5)
def _make_dev(bucket_name):
@@ -64,6 +65,7 @@
def RunSteps(api: recipe_api.RecipeApi, props: InputProperties):
min_builds = props.min_builds or DEFAULT_MIN_BUILDS
+ requested_builds = props.requested_builds or DEFAULT_REQUESTED_BUILDS
max_age = props.max_age.ToTimedelta() or DEFAULT_MAX_AGE
bb_cfg: bb_pb2.BuildbucketCfg = api.luci_config.buildbucket()
@@ -94,7 +96,7 @@
builder_status = api.builder_status.retrieve(
bucket=bucket.name,
builder=builder.name,
- n=min_builds,
+ n=requested_builds,
max_age=max_age,
)