Skip to content

feat(ci): devops ci stops its rows when timeout ends it - #5031

Merged
dan-petty merged 3 commits into
mainfrom
feat/4775-ci-row-time-limit
Nov 12, 2026
Merged

dan-petty merged 3 commits into
mainfrom
feat/4775-ci-row-time-limit

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Each inner time limit must end before the limit around it. The pre-push hooks had no limit inside the 120 s default limit of the agent shell. coreutils timeout could not give one: the gate run of devops ci took no SIGTERM, so each row kept running in its own session and no line named it.

  • The gate run takes Ctrl-C, SIGTERM and SIGHUP through the helper of devops ci test. It stops the process group of each running row, prints (stopped after <time>) for the row, and exits 130.
  • The two devops ci pre-push hooks run under timeout 40 and timeout 30. A structural test holds the push under 120 s.
  • No --timeout option and no setting: timeout covers the need (AGENTS.md rule 3).
  • This change does not change ci.yml. The rows of the Static Analysis gate step keep their limit of 1,800 s, which is longer than the step limit of 3 minutes. feat(ci): the Static Analysis gate ends before its step limit #5047 tracks a timeout limit for that step and a structural test that compares it with the step limit.

Closes #4775

Change: openspec/changes/archive/2026-11-12-4775-devops-ci-ends-each-row-at/

…hooks

A SIGTERM ended the gate run of `devops ci` at once and left each row
running in its own session, so coreutils `timeout` could not limit a
hook. The gate run now takes Ctrl-C, SIGTERM and SIGHUP through the
helper of `devops ci test`, stops the process group of each running
row, names the row and exits 130.

The two `devops ci` pre-push hooks run under `timeout 40` and
`timeout 30`. With the 20 s fetch of `branch-current` and 25 s for the
rest of the push, the push ends before the 120 s default limit of the
agent shell. A structural test holds this budget.

Closes #4775
@dan-petty dan-petty added type/feature Type feature: a new function scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners labels Nov 12, 2026
@dan-petty

dan-petty commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner Author

Measurements and checks (2026-11-12, devcontainer, load average 20 to 25 on 16 CPUs).

fail-to-pass (uv run devops ci fail-to-pass --base origin/main, exit 0): 3 failed on base and pass on head, 309 others pass on both.

  • tests.commands.test_ci::test_a_sigterm_to_the_gate_stops_the_group_of_each_running_row_and_names_it: on base (True, -15, False, []). devops died by SIGTERM, the row group was not stopped, and no line named the row.
  • tests.invariants.test_workflow_contracts::test_the_pre_push_hooks_end_before_the_agent_shell_limit: on base the two devops ci hooks have no limit.
  • tests.commands.test_instruction_generator::test_devops_cli_renders_the_check_line_of_its_pre_push_hooks: the check line now shows the timeout prefix.

Reproduction of the defect, at origin/main 87ae9ee: timeout 15 uv run devops ci --check --only startup-imports,swallowed-failures returned 124, and both rows and their children still ran. One row still ran 69 s after the limit.

With this change: the same command returned 124 after 20 s, printed ✗ fail startup imports ... (stopped after 9.27s) and ✗ fail swallowed failures ... (stopped after 9.31s), and ps showed no process of the run.

Hook times without a limit, two runs each: lint,format 12 s to 23 s, actionlint,zizmor 14 s to 22 s. The limits are 40 s and 30 s. The push of this branch through the new hooks took 14 s.

Local checks: devops ci --check --only lint,format,docs,constructs,swallowed-failures,openspec pass. mypy --strict on the two changed source files passes. tests/commands/test_ci*.py, tests/ci, tests/invariants/test_workflow_contracts.py, tests/invariants/test_runner_hooks.py, tests/invariants/test_runner_image.py, tests/roadmap/test_roadmap_runner_tools.py, tests/roadmap/implement/test_roadmap_implement_*hooks.py and tests/commands/test_instruction_generator.py pass (616 tests).

No live, cluster, ConfigMap, Secret or repository-setting step is necessary.

The live test runs devops in a child process, so the changed-line
coverage of CI did not count the stop path. This test raises a Ctrl-C
in process while a row waits for its child.
@dan-petty
dan-petty force-pushed the feat/4775-ci-row-time-limit branch from 98d1545 to f35ffa5 Compare November 12, 2026 11:03
@dan-petty

Copy link
Copy Markdown
Owner Author

The first run of Tests & Coverage failed in Changed-Line Coverage (50 %, src/devops_cli/commands/ci.py lines 592-602 and 1542-1543). The live test runs devops in a child process, so coverage did not count the stop path. The new test test_a_stop_signal_cancels_the_gate_and_the_running_row_names_itself raises a Ctrl-C in process while a row waits for its child. Locally, diff-cover against origin/main gives 100 % for ci.py.

@dan-petty

Copy link
Copy Markdown
Owner Author

Review findings and what I did

1. Major: the PR closes #4775, but the ci.yml part of the issue is not done. Confirmed.

Evidence on origin/main 87ae9ee:

  • Static Analysis has timeout-minutes: 6 (.github/workflows/ci.yml:44). Its Static Analysis Quality Gate step has timeout-minutes: 3 (ci.yml:82).
  • The rows of that step keep DEFAULT_SUBPROCESS_TIMEOUT_SECONDS = 1800.0 (src/devops_cli/config/defaults.py:361). Thus the step limit ends a hung row, not an inner limit.
  • test_every_job_has_a_limit_and_each_step_limit_is_under_it checks only that a step limit is under its job limit. No test compares a row limit with the step limit.
  • The step took 76 s to 104 s in the last 8 successful runs on main (2026-11-12).

What I did:

  • I filed feat(ci): the Static Analysis gate ends before its step limit #5047 for the ci.yml part: run the gate step under timeout <N> with N plus the stop time under 180 s, and add a structural test that compares N with the step limit. Intake made feat(ci): the Static Analysis gate ends before its step limit #5047 a sub-issue of feat(ci): devops ci ends each row at a time limit #4775. The CI audit work owns .github/workflows/*, so this PR does not change ci.yml.
  • I removed "The ci.yml part is already done" from the PR body. The body now says that this change does not change ci.yml and that feat(ci): the Static Analysis gate ends before its step limit #5047 tracks the step limit.
  • The proposal Feasibility still has the wrong claim. The auto mode check refused the amend of the archive commit, so I pushed no commit. A person or a later run must do this step:
    1. In openspec/changes/archive/2026-11-12-4775-devops-ci-ends-each-row-at/proposal.md, replace the last ## Feasibility bullet with this text:

      - This change does not do the `ci.yml` part of the issue. The `Static Analysis Quality Gate` step has a limit of 3 minutes in a job of 6 minutes, and `tests/invariants/test_workflow_contracts.py` checks only that a step limit is under its job limit. The rows of the step keep their limit of 1,800 s (`DEFAULT_SUBPROCESS_TIMEOUT_SECONDS`), so the step limit ends a hung row, not an inner limit. #5047 runs the step under `timeout` and adds a structural test that compares that limit with the step limit. The CI audit work owns `.github/workflows/*`, so this change does not change `ci.yml`.
    2. Amend the archive commit (git commit --amend --no-edit), so that the archive stays the last commit.

    3. git fetch origin && git rebase origin/main, then git push --force-with-lease.

    4. uv run devops pr monitor 5031 --timeout 1800.

No code changed, so no fail-to-pass run applies.

@dan-petty
dan-petty merged commit 1fa4e9c into main Nov 12, 2026
27 checks passed
@dan-petty
dan-petty deleted the feat/4775-ci-row-time-limit branch November 12, 2026 12:10
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.118.0](v0.117.2...v0.118.0)
(2026-11-12)


### Features

* **ci:** devops ci stops its rows when timeout ends it
([#5031](#5031))
([1fa4e9c](1fa4e9c))
* **roadmap:** keep the stage gate problems as a list with a code
([#5022](#5022))
([5819627](5819627))
* **roadmap:** log one result line for each roadmap job attempt
([#4966](#4966))
([2b6fe3f](2b6fe3f))
* **telemetry:** record each CLI usage error by name and kind
([#4973](#4973))
([a179fd9](a179fd9))


### Bug Fixes

* **ai:** chat loads each persona prompt and challenger gets tools
([#5037](#5037))
([c40b0ad](c40b0ad))
* **ai:** keep the HTTP status of a Claude reply after retries
([#4976](#4976))
([5bf9466](5bf9466))
* **deps:** keep Renovate uv bumps green and groups on Monday
([#4987](#4987))
([b19e153](b19e153))
* **k8s:** raise the limits that 7 d of use shows are too low
([#5030](#5030))
([028c62b](028c62b))
* **roadmap:** a job posts no comment that repeats a recent one
([#4978](#4978))
([fff903a](fff903a))
* **service:** alert when GitHub cannot deliver a webhook
([#5045](#5045))
([2bfbfcb](2bfbfcb))
* **service:** delete the stream route that sends canned verified text
([#5038](#5038))
([e9d51b5](e9d51b5))
* **telemetry:** keep one upstream status series per service
([#4986](#4986))
([3e4ca56](3e4ca56))
* **tests:** remove the runner variable in the test floor
([#4988](#4988))
([093aa61](093aa61))


### Performance Improvements

* **ai:** make the ast graph walk and call search faster
([#5039](#5039))
([3b25cc6](3b25cc6)),
closes [#4662](#4662)
* **ci:** build the devcontainer only on its own inputs
([#4977](#4977))
([c5b15ac](c5b15ac))
* **ci:** test each merge once, on the push to main
([#5043](#5043))
([c6992b1](c6992b1))
* **tests:** remove fixed waste in six slow tests
([#4995](#4995))
([1c7044e](1c7044e))


### Code Refactoring

* **ai:** delete devops ai pipeline and persona leftovers
([#5044](#5044))
([d5fefde](d5fefde)),
closes [#4827](#4827)
* **openspec:** split big capabilities into nested ones
([#4981](#4981))
([dfb09bd](dfb09bd))
* **pr:** devops pr update acts only on a failed check
([#4990](#4990))
([aa4fa1a](aa4fa1a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/ci GitHub Actions workflows, pre-commit hooks, CI gates, and runners type/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ci): devops ci ends each row at a time limit

1 participant