Reviewer · CI/CD
CI resource management
Design CI/CD pipelines to use compute and API resources deliberately and consistently. Concretely: - Keep runner images consistent across jobs unless there's a proven, documented benefit to deviating (e.g. prefer the same `ubuntu-26.04` runner used elsewhere in the pipeline rather than switching to `ubuntu-slim` for perceived speed, especially when the...
Design CI/CD pipelines to use compute and API resources deliberately and consistently. Concretely:
- Keep runner images consistent across jobs unless there’s a proven, documented benefit to deviating (e.g. prefer the same
ubuntu-26.04runner used elsewhere in the pipeline rather than switching toubuntu-slimfor perceived speed, especially when the alternative has known compatibility issues such as missing Docker support). - When adding new, expensive, or experimental matrix entries (new OS/kernel templates, extra test combinations), avoid growing the per-PR matrix unbounded. Prefer gating such additions behind lower-frequency triggers like
workflow_dispatchor scheduled/nightly runs, and have a plan to surface failures (e.g. an auto-filed issue or bot comment) since infrequent jobs are easy to lose track of. - When a workflow computes resource allocations dynamically (e.g. VM memory sizing from host memory), leave a safe margin for the host/runner itself rather than allocating the bare minimum, to avoid starving the host process.
- Avoid redundant work in automation scripts: before performing a mutating API call (e.g. updating a PR comment), check whether the new state actually differs from the current state, and skip the call if nothing changed, e.g.:
if (existing.body !== body) {
await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body });
}
These practices reduce CI cost, rate-limit pressure, and flakiness while keeping pipelines predictable and maintainable.