fleetlint Policy for a fleet of repositories
v0.11 (latest)
Getting started

ci/job-timeouts

CI jobs have timeouts

Severityinfo
Tiersall
Stacksany
Scoperoot
Kindexpr
Sourcelibrary v0.8.0
Selected byfleetlint-recommended@v0.8.0

Requirement

Every Actions job sets timeout-minutes (reusable-workflow jobs excepted); every GitLab job sets timeout: or inherits one from default: timeout: (trigger jobs excepted). The GitLab project timeout lives outside the repository and does not count.

Why

The default job timeout is six hours on GitHub and one hour on GitLab, both far longer than a hung job deserves.

Applies when

workflows().size() > 0

Check

For each item in:

workflows().map(w, jobs(w).map(j, {
  "path": w,
  "name": j.name,
  "ok": j.timeout_minutes > 0 || j.uses != ""
    || (ci_kind(w) == "gitlab" && (
      (type(yaml(w)[j.name]) == map && "trigger" in yaml(w)[j.name])
      || workflows().exists(g, ci_kind(g) == "gitlab" && type(yaml(g)) == map && "default" in yaml(g)
           && type(yaml(g)["default"]) == map && "timeout" in yaml(g)["default"])))
})).flatten()
item.ok

Fix

Add timeout-minutes: 15 (GitLab: timeout: 15m, or once under default:) sized to what the job needs.

Agent instruction: Add timeout-minutes to each Actions job in the flagged file (GitLab: timeout: per job or under default:), sized to roughly twice its typical duration.

Sources


Generated by fleetlint docs from catalog v0.8.0.