ci: set go mod tidy step timeout (#64449)

Closes DINF-198

## Test plan
CI
```
{
      "label": ":bazel:🧹 Go mod tidy",
      "key": "bazel-go-mod",
      "command": [
        "./dev/ci/bazel-gomodtidy.sh"
      ],
      "timeout_in_minutes": "5",
      "retry": {
        "automatic": [
          {
            "limit": 1,
            "exit_status": "*"
          },
          {
            "limit": 1,
            "exit_status": -1
          }
        ]
      },
      "agents": {
        "queue": "aspect-small"
      }
    },
```

## Changelog
This commit is contained in:
William Bezuidenhout 2024-08-13 17:45:30 +02:00 committed by GitHub
parent 9d2220ea33
commit 26f14c0888
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -560,6 +560,13 @@ func AllowDependencyFailure() StepOpt {
}
}
// TimeoutInMinutes sets the timeout in minutes of the step to the given value
func TimeoutInMinutes(min int) StepOpt {
return func(step *Step) {
step.TimeoutInMinutes = fmt.Sprintf("%d", min)
}
}
// flattenStepOpts conveniently turns a list of StepOpt into a single StepOpt.
// It is useful to build helpers that can then be used when defining operations,
// when the helper wraps multiple stepOpts at once.

View File

@ -26,6 +26,8 @@ func bazelGoModTidy() func(*bk.Pipeline) {
bk.Agent("queue", AspectWorkflows.QueueSmall),
bk.Key("bazel-go-mod"),
bk.Cmd("./dev/ci/bazel-gomodtidy.sh"),
bk.AutomaticRetry(1),
bk.TimeoutInMinutes(5),
}
return func(pipeline *bk.Pipeline) {