Skip to content

feat(gate): stop a gate after 30 minutes by default, and take --timeout in minutes - #55

Merged
protonspy merged 2 commits into
mainfrom
fix/gate-timeout-30m
Oct 4, 2026
Merged

protonspy merged 2 commits into
mainfrom
fix/gate-timeout-30m

Conversation

@protonspy

Copy link
Copy Markdown
Owner

What changed

  • The bound on one gate run (build, format, lint, test) moves from 10 to 30 minutes: gate.Timeout becomes gate.DefaultTimeout = 30 * time.Minute.
  • scc check and scc validate accept --timeout <minutes> to move the bound for one run. On validate it implies --checks, since a bound with no gates to apply to would be silently ignored.
  • The value lives on gate.Config.Timeout (json:"-"), so it is never written to the manifest; Config.Limit() falls back to the default for zero.
  • A check.timed-out finding now names the limit the gate was held to (Result.Limit), since it is no longer a constant.
  • --timeout of 0, a negative, a non-number, or a value too large to fit a time.Duration is a usage error (exit 1).

Plan: plans/gate-timeout-30m.md

How it was verified

  • New tests: TestLimitDefaults, TestRunStopsAtTheLimit (gate); timed-out finding names the limit (validate); TestCheckTimeoutTakesPositiveMinutes, TestValidateTimeoutRunsTheGates (cli).
  • scc validate --checks exits 0: build, format, lint, and test gates pass (1009 tests, 86.2% coverage).

Reviews

  • scc-code-review: clean. No findings. Scoped tests and lint re-run green.
  • scc-security-review: clean. Two low findings:
    • --timeout overflow when multiplied into a time.Duration: fixed in the second commit, which rejects values above MaxInt64/time.Minute.
    • A hanging gate can now stall a pre-push for up to 30 minutes per gate: not changing. That is the requested trade-off, and --timeout lowers the bound for a run.

…ut in minutes

The bound on one gate run moves from 10 to 30 minutes, so a suite that
legitimately takes longer than ten is no longer killed as check.timed-out.
scc check and scc validate accept --timeout <minutes> to move it for one
run; on validate it implies --checks. The value is never written to the
manifest, and a timed-out finding now names the limit it was held to.

Plan: plans/gate-timeout-30m.md
A minute count above MaxInt64/time.Minute wrapped when multiplied, giving a
bound nobody asked for. It is now a usage error, like zero or a negative.

Plan: plans/gate-timeout-30m.md
@protonspy
protonspy merged commit d057763 into main Oct 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant