Skip to content

fix(ci): DevContainer Image averages over the 360 s limit #7970

Done
1 of 1 issue completed
Done

Description

@dan-petty

Problem Description

The check DevContainer Image averages more than the limit of AGENTS.md rule 5, which is 5 minutes and 1 minute of tolerance (360 s). The last 10 successful pull request runs of 2026-11-30 gave job times of 334 s to 487 s, with a mean of 417 s. The step Build and Push DevContainer Image by Digest took 175 s to 298 s of each job. The scenario "A pull request run of the DevContainer Image job" of openspec/specs/ci-devcontainer-image/spec.md says that the job ends in less than 6 minutes. devops ci job-time does not read this job, so it files no alarm.

Reproduction Steps

  1. List the runs: uv run devops gh api 'repos/{owner}/{repo}/actions/workflows/devcontainer-image.yml/runs?per_page=100&status=success&event=pull_request' --jq '.workflow_runs[0:10][].id'.
  2. For each run, read started_at, completed_at and the steps of the job DevContainer Image: uv run devops gh api 'repos/{owner}/{repo}/actions/runs/<run_id>/jobs'.
  3. The job runs 46526029818, 46525928087, 46505068310, 46504914573, 46483185314, 46482917587, 46469232216, 46460648922, 46460607804 and 46438705676 took 456, 441, 423, 334, 487, 405, 424, 423, 437 and 338 s.

Expected vs Actual Behavior

Expected: the job averages at most 360 s over its last runs.

Actual: the job averages 417 s.

Proposed Solution

Measure the build step of .github/actions/devcontainer-image and cut its time, for example the time that goes to the layers that the registry cache does not give. Do not raise the limit and do not remove the check.

Acceptance Criteria

  • The job DevContainer Image averages at most 360 s over 10 successful pull request runs.
  • uv run devops ci --check --only actionlint,zizmor passes.

Source

Source: #7966

Alternatives check of 2026-11-30: partly.
Tool: github_actions_exporter (https://github.com/cpanato/github_actions_exporter), Apache-2.0, last activity 2026-11-30, maintained.
Reason: Searches found GitHub Actions Prometheus exporters: cpanato/github_actions_exporter reports per-job durations by job name, but it files no roadmap issue and cuts no build time.

Covers:

  • Per-job duration histograms labelled with workflow and job name
  • Job status counts and queue time from GitHub webhook events
  • Prometheus metrics that an alert rule can read

Lacks:

  • No roadmap issue with priority P0
  • No per-step timing of the build step
  • No cut of the registry cache misses or build time
  • Needs a webhook endpoint and a Prometheus stack

Proposed design

Problem statement

The DevContainer Image job averages 417 s over its last 10 successful pull request runs. The limit of AGENTS.md rule 5 is 360 s. devops ci job-time does not read this job, so no alarm records the breach. This change adds the job to that check over the pull request runs and keeps the limit at 360 s. The cut of the build time is a separate issue.

Acceptance criteria

Requirement: The check reads the DevContainer Image job

devops ci job-time SHALL read the DevContainer Image job of .github/workflows/devcontainer-image.yml over its last 10 completed pull request runs.

Scenario: The 10 runs of the issue

  • WHEN a person runs uv run pytest tests/github/test_ci_job_time.py -q with the 10 runs of the issue routed
  • THEN the suite passes and the report shows the job DevContainer Image, 10 runs and a mean of 416.8 s

Requirement: The read asks for pull request runs and no branch

The read of the DevContainer Image job SHALL ask GitHub for the runs with event=pull_request and SHALL send no branch parameter.

Scenario: The request URL of the job runs

  • WHEN a person runs uv run pytest tests/github/test_ci_job_time.py -q
  • THEN the suite passes and the requested URL holds event=pull_request and no branch parameter

Requirement: A mean over the limit files one P0 issue

The check SHALL send one issue request with the label priority/P0 when the mean of the last 10 completed pull request runs of DevContainer Image is more than 360 s.

Scenario: The mean is 416.8 s

  • WHEN a person runs uv run pytest tests/github/test_ci_job_time.py -q with the 10 runs of the issue routed
  • THEN the suite passes and shows one issue request that names DevContainer Image and holds the label priority/P0

Requirement: A mean at or under the limit files no issue

The check SHALL send no issue request when the mean of the last 10 completed pull request runs of DevContainer Image is at most 360 s.

Scenario: The mean is 360 s

  • WHEN a person runs uv run pytest tests/github/test_ci_job_time.py -q with 10 routed runs of 360 s
  • THEN the suite passes and shows no issue request

Requirement: Pending a person after the merge

After the merge, the check SHALL file one issue with the label priority/P0 for the breach of the DevContainer Image job on its next run on main.

Scenario: The first run on main after the merge

  • WHEN a person reads the issues after the next run of the job-time check on main
  • THEN one open issue holds the label priority/P0, names DevContainer Image and shows the mean of its last 10 completed pull request runs

Existing Tool Considered

The alternatives check of 2026-11-30 in the issue body gives the verdict partly for github_actions_exporter (https://github.com/cpanato/github_actions_exporter). The block in the issue body lists what the tool covers and lacks. The tool lacks a roadmap issue with priority P0 and needs a webhook endpoint and a Prometheus stack. This change adds the job to the check devops ci job-time, which already files one P0 issue and runs in the existing workflow. Cost: one job entry, one event parameter, five test cases and one spec delta, about 150 lines and under 2 hours.

Key questions

  • Which job and which runs does the check read for the DevContainer Image workflow?: It reads the job DevContainer Image of .github/workflows/devcontainer-image.yml, over the last 10 completed runs with event pull_request and no branch filter. It uses the started_at and completed_at of each job. [sources: openspec/specs/ci-devcontainer-image/spec.md, openspec/specs/ci-job-time/spec.md, tests/github/test_ci_job_time.py, .github/workflows/devcontainer-image.yml]
  • What limit applies to the DevContainer Image job?: 360 s: 5 minutes plus the 1 minute tolerance of AGENTS.md rule 5. The scenario of the job in the spec also requires less than 6 minutes. [sources: AGENTS.md, openspec/specs/ci-devcontainer-image/spec.md]
  • Which event does the read ask for?: pull_request, with no branch. The workflow has no push trigger, so a read of push runs is always short and the check always fails. (best practice) [sources: .github/workflows/devcontainer-image.yml, tests/github/test_ci_job_time.py, openspec/specs/ci-job-time/spec.md]
    • Chosen: Add event=pull_request to the job entry and to the read, with no branch. The workflow runs on pull requests, and the 10 runs of the issue are pull request runs.
    • Rejected: Read the push runs of the workflow. The workflow has no push trigger, so the read is always short and the check always fails.
    • Rejected: Read the scheduled runs of the workflow. The schedule runs one time each day, so 10 runs take 10 days.
  • Does the check count a failed DevContainer Image job?: Yes. The conclusion of the job counts, as the spec requires for each job. The 10 runs of the issue are all successful, so their mean is 416.8 s. (best practice) [sources: openspec/specs/ci-job-time/spec.md, tests/github/test_ci_job_time.py]
    • Chosen: Count each job that ran to an end. The spec says the conclusion of the job counts, not the conclusion of the run.
    • Rejected: Read only the successful runs. It departs from the rule of the spec for one job, and a failed job is a real sample.
  • Does the change raise the limit or remove the check?: No. The check keeps the limit of 360 s and reads the job. The body forbids a higher limit and the removal of the check. (best practice) [sources: AGENTS.md, openspec/specs/ci-devcontainer-image/spec.md]
    • Chosen: Keep the limit of 360 s and add the job. The body forbids a threshold change, and rule 5 makes the breach a P0 bug.
    • Rejected: Raise the limit to 480 s. The body and AGENTS.md rule 5 forbid it without the owner.
    • Rejected: Remove the check. The body forbids it, and the check proves that the image builds and starts.
  • Does this change cut the build time?: No. The cut is deferred. No record names the layers that miss the registry cache, and only live pull request runs show the new mean. (best practice) [sources: openspec/specs/ci-devcontainer-image/spec.md, .github/actions/devcontainer-image/action.yml, .github/workflows/devcontainer-image.yml]
    • Chosen: Add the alarm now and defer the cut. The alarm records the breach now, and the cut needs the live measurement of each step.
    • Rejected: Cut the build time in this pull request. No record names the uncached layers, and no offline test shows the new mean.
  • Does the alternatives check change the plan?: No. The verdict is partly. The tool reports per-job durations but files no roadmap issue and needs a webhook endpoint and a Prometheus stack. The project keeps its own check. (best practice) [sources: openspec/specs/ci-job-time/spec.md]
    • Chosen: Keep the item with devops ci job-time. The check files one P0 issue and needs no new service or endpoint.
    • Rejected: Adopt github_actions_exporter. It files no roadmap issue and needs a webhook endpoint and a Prometheus stack.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Moved to new items

#7984

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    type/bug
    scope/ci
    source/agent
    on Nov 30, 2026
  2. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor
    • Priority: AGENTS.md rule 5 makes a check averaging over 360 s a P0 bug, and the slow job degrades CI for every pull request.
    • Related: perf(ci): bring the Runner Image check under 6 minutes #7205, which asks for a different change. Both bring a CI image job under the 360 s limit, but #7205 fixes the Runner Image job while this candidate fixes the DevContainer Image job.
  3. added
    status/new
    effort/medium
    value/high
    priority/p0-critical
    on Nov 30, 2026
  4. devops-cli-service commented on Nov 30, 2026

    @devops-cli-service
    Contributor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  5. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (10)

    Tools considered:

    Searches run:

    • GitHub Actions job duration metrics exporter Prometheus open source, results: 5
    • tool to track GitHub Actions workflow job run time and alert on slow jobs, results: 5
    • buildx cache-from type=registry mode=max slow docker build CI, results: 5
    • github-actions-exporter prometheus exporter workflow job duration, results: 5
    • github actions exporter, results: 5
    • prometheus exporter github actions workflow job duration seconds metric, results: 5
    • cpanato github_actions_exporter job duration metrics, results: 5
    • docker buildx registry cache mode=max missing layers rebuild, results: 5
    • earthly build cache reduce CI docker build time, results: 5
    • measure github actions step duration per step timing tool open source, results: 5

    Sources:

  6. added
    status/ready
    and removed
    status/new
    on Dec 1, 2026
  7. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  8. added
    owner/service
    on Dec 1, 2026
  9. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Plan state: branch fix/7970-devcontainer-image-averages-over-the-360, draft pull request #7997. The pull request plans the item and closes no issue. The stage job and the step fix-plan edit this comment, and a comment of each run tells what the run did.

    The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:

    1. Read the runs of one event with no branch filter: 35097 tokens
    2. Check the DevContainer Image job and its alarm: 35291 tokens
    3. Say in the workflow that the check reads the job: 9593 tokens
  10. 16 remaining items

  11. added
    status/in-progress
    on Dec 1, 2026
  12. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Stopped at fix.

    Failed check: pre-push. The end of its log:

    trim trailing whitespace................................................................Passed
    fix end of files........................................................................Passed
    check for added large files.............................................................Passed
    branch holds origin/main (docs/SDLC.md, Phase 5)........................................Passed
    devops ci (fast static checks before a push)............................................Failed
    - hook id: devops-ci-pre-push
    - exit code: 124
    
    \u2139 Quality gate root: /run/roadmap/work/model-clone
    \u2139 Executing CI quality gates concurrently...
      \u2713 pass [python_version] python version check (3.14+) (3\xb5s)
      \u2013 \\[domain] skipped: no k8s.domain or cloudflare.domain is configured, so the row read no commit
      \u2717 fail [uv-check] uv check (stopped after 39s)
      \u2717 fail [lint] ruff check (stopped after 39s)
      \u2717 fail [constructs] ast-grep scan (network constructs and working-directory reads in src, elapsed-time bounds in tests) (stopped after 39s)
      \u2717 fail [format] ruff format (stopped after 39s)
      \u2717 fail [deps] deptry (stopped after 39s)
      \u2717 fail [swallowed-failures] swallowed failures (ratchet of blind excepts and unread check=False) (stopped after 39s)
    
    devops ci (workflow checks before a push that changes a workflow).......................Passed
    

    Failure class: no_change_in_fix.
    Action taken: none.
    Action left: wait: wait for a person.

    Step Status Attempts Tokens in/out Last failing command
    group 1 done 1 1389166/4695 -
    group 2 done 1 6174787/21350 pytest on base: tests/github/test_ci_job_time.py
    group 3 done 1 907833/1030 -
    fix stopped 1 365561/4471 pre-push

    Reason:

    The group 0 (Make check pre-push pass) changed no file. The group may be too large or already done. Return the item for a smaller replacement of group 0, or amend the plan with a request of kind `group` that keeps the number and has fewer tasks.
    

    Last message of the agent (a claim that no check verified): The pre-push check still fails here, and I changed nothing. Hold the item for a retry on a runner with more than one CPU, or for a person to change the 40 s limit. This is not a defect in the diff. - What fails: the hook devops-ci-pre-push runs timeout 40 uv run devops ci --check --only lint,format,constructs,swallowed-failures,deps,uv-check,domain. timeout stops the three slowest rows at 40 s, so the hook exits 124. - Why: the runner has 1 CPU, nproc returns 1, and the seven rows run at once on it. In the hook command, format, lint and deps pass at 6 s, 20 s and 28 s. uv-check, constructs and swallowed-failures are cut at 39 s. - The checks pass without the limit: each of the six rows passes when it runs alone or without timeout 40. uv-check takes 9 s, constructs 15 s and swallowed-failures 13 s. The full set passes in 1 m 10 s without the limit. - Diff: ruff check and ruff format --check pass on src and tests. The diff changes no Python path that these rows read in a way that would slow them. I did not run the same command on origin/main, so I did not prove it fails there too. I did not raise the limit in .pre-commit-config.yaml. The comment there says the stage must add up to less than the 120 s agent-shell limit. That change is a threshold change for the owner.

    The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.
    The push of the commits that passed failed too.
    The patch is refused: .github/workflows/devcontainer-image.yml is a workflow file that the plan does not name

  13. added
    status/blocked
    and removed
    status/in-progress
    owner/service
    on Dec 1, 2026
  14. added
    status/in-review
    and removed
    status/blocked
    on Dec 1, 2026
  15. removed
    status/in-review
    on Dec 1, 2026
  16. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Live since 2026-12-01 16:44 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p0-criticalscope/cisource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions