Skip to content

fix(roadmap): the roadmap service logs each failed job's own error with its repository, and a configuration error without a traceback #1365

Closed

Description

@dan-petty

Refreshed plan (2026-10-17, unblocking review)

This section supersedes any text below that conflicts with it.

Decisions

Scope
The scope is unchanged apart from these points:

Delivery

  • One PR, size S, with Fixes #1365. It touches roadmap/run.py, exceptions/roadmap.py, commands/roadmap.py, roadmap/refine.py and server/service.py, plus their tests.

Acceptance criteria (the body's other criteria stand, at the references below)

  • Replaces the blind-except criterion: uv run pytest tests/test_swallowed_failures_ratchet.py passes, and no ceiling for the touched files in tests/fixtures/swallowed_failures_ceilings.json is raised. If a count falls, the same PR locks it in with uv run python tests/test_swallowed_failures_ratchet.py --lower. No # noqa: BLE001, S110 or S112 is added.
  • A case in tests/test_roadmap_run.py sets PATH to an empty directory under tmp_path, so the clone fails, and keeps remote_url at a missing path under tmp_path, as the body's no-network criterion asks. The clone rows fail with the FileNotFoundError as a group member, and the message quotes its first line.
  • RoadmapRunError has no reset_at. For a run in which a job's write was refused, service_pause_until returns that refusal's reset plus the skew bound. When no member is a refusal, it returns None. test_a_jobs_refused_write_fails_the_round_with_the_reset_and_the_next_job_still_runs (tests/test_roadmap_run.py:1760) reads the reset through service_pause_until and the member, not through reset_at.
  • run_research_step re-raises a GitHubRateLimitError from repository_is_private(). For any other error it still logs a warning and returns ([], set()). Both are checked in tests/test_roadmap_refine.py.
  • The RepoWorker case builds the worker with a lane and reads the counters on repo, lane and result. Each ERROR record carries repo, lane and result="error".
  • Pending a person, once the Service runs again (as D2's App or a reinstated account): (a) and (b) as written. For (c), each poll logs one ERROR record per lane (two in all), and devops_cli_service_jobs_total{repo="<it>",result="error"} rises by two per poll, one per lane.

Current references (checked at 3dd7fa6)

  • service_job: src/devops_cli/roadmap/run.py:1017-1032. Its open_roadmap call (not _open_roadmap) is at :1024, before the try at :1026. SERVICE_JOBS: :1035-1042.
  • parse_roadmap_config and read_roadmap_config: src/devops_cli/roadmap/config.py:69-90, raising ConfigurationError at :74 and :81. The 404 raise: src/devops_cli/roadmap/github_store.py:1766.
  • _awaiting_intake: src/devops_cli/commands/gh.py:1016-1023. The triage tests: tests/test_gh_cmd.py:219, :241, :259. unreadable_github_roadmap: tests/conftest.py:585 (gh exits 1 with HTTP 503).
  • ensure_checkout: run.py:324-372. Its docstring at :349-351 says a timeout or a missing git propagates.
  • _prepare_clone: run.py:829-850, with its catch at :849.
  • _execute_due_rows: run.py:853-916. The clone failure is at :883-889, the runner catch and logger.exception at :904-905, and the raise at :910-915.
  • Lanes: RELEASE_LANE_ROWS at run.py:657-679 (feat(release): release-please makes every release from main #1952 renamed it STATUS_LANE_ROWS, which holds only metrics), MODEL_LANE_ROWS at :683-701, DEFAULT_DUE_TABLE at :704, build_stub_table at :708-729.
  • The reset: _refused_reset at run.py:1000-1003 and service_pause_until at :1006-1014. refusal_reset is at src/devops_cli/roadmap/board_read.py:364, and RoadmapRunError at src/devops_cli/exceptions/roadmap.py:19-42. The docstring of _refuse_jobs_write (tests/test_server_service.py:916-918) says the RoadmapRunError carries the reset, so it changes with the reset's move.
  • RepoWorker: src/devops_cli/server/service.py:130, with start at :157, enqueue at :166, stop at :187 and wait_active at :199. Batches coalesce in _wait_for_next_batch (:216-233). _execute_batch is at :235-280: its handler is at :256-268, the span message at :258-260 and exc_info=True at :266. The poll loop is at :350-368.
  • CLI: src/devops_cli/commands/roadmap.py:576-583. The message is rebuilt at :581 and printed without safe at :582. print_error(..., safe=...) is at src/devops_cli/output/console.py:428-437.
  • Tests: test_failure_isolation_and_cli_exit is at tests/test_roadmap_run.py:580, with its patch at :632. test_checkouts_git_management is at :706.
  • The ratchet: tests/test_swallowed_failures_ratchet.py. Its ceilings are at tests/fixtures/swallowed_failures_ceilings.json:132-133 and :149. The BLE family is left out at pyproject.toml:109 (feat(cli): blind exception handling policy #423). The 256-character cap is AGENTS.md:36.

Dependencies and order


Problem

The roadmap Service (devops serve --service, namespace devops, image service:v0.2.28, the same code as 910b823) has three logging defects when a job fails:

  • it logs a configuration error with a full traceback on every poll;
  • it splits every job failure across two records;
  • it drops clone failures entirely.

#1358 proposed this item in its Key questions. The evidence below comes from Loki and Prometheus, read on 2026-10-08 up to 01:18 UTC.

1. A configuration error carries a full traceback on every poll

  • What happened. Six repositories were added to service.repos before their .github/roadmap.toml landed.
    • From 2026-10-07 23:51 to 2026-10-08 00:16 UTC, each logged one ERROR record per 300 s poll: 35 records in all (six each, and five for one).
    • Each record carries a traceback of about 1.5 KB whose last line repeats the message.
    • It stopped when the files landed at about 00:17 UTC. It will happen again for every repository added before its file.
  • The call chain.
    • service_job opens the repository with _open_roadmap (src/devops_cli/roadmap/run.py:870).
    • read_roadmap_config (src/devops_cli/roadmap/config.py:80-82) reads the file through GitHubRoadmapStore.repository_file, which raises GitHubFileNotFoundError on a 404 (src/devops_cli/roadmap/github_store.py:1525-1530).
    • RepoWorker._execute_batch logs any exception with exc_info=True (src/devops_cli/server/service.py:172-185).
  • The traceback adds nothing.
    • Every time it shows the same six frames: _execute_batch, service_job, _open_roadmap, open_roadmap, read_roadmap_config, repository_file.
    • The fix is a file a person commits.
    • devops_cli_service_jobs_total{result="error"} already counts every failure. It reads 7 for each of the six repositories: six failures to open the repository, plus the 00:17 intake failure. Loki holds only five of the six for one repository; its first, due at about 23:51, is missing.
  • The exception class doesn't say "configuration".
  • The fix can't go in read_roadmap_config.
    • devops gh issues triage relies on GitHubFileNotFoundError from open_roadmap to mean "this repository has no board" (src/devops_cli/commands/gh.py:1000-1007).
    • Two tests pin that: test_gh_issues_triage (tests/test_gh_cmd.py:213) and test_gh_issues_triage_does_not_hide_a_failed_board_read (:253, "Only a missing .github/roadmap.toml means no board").
    • For the Service, the same missing file is a configuration error, because service.repos lists the repository.

2. Every failed job is logged twice: one record has the cause, the other has the repository

  • How it happens.
    • _execute_due_rows logs a runner's exception with logger.exception("Roadmap job %s failed", row.name) and passes no extra (run.py:782-784).
    • It then raises RoadmapRunError("Roadmap jobs failed: <names>") with no cause (run.py:786-790).
    • _execute_batch logs that again, with a traceback that ends at run.py:787.
  • What Loki shows for the 48 h to 01:18 UTC.
    • 78 per-job records from devops_cli.roadmap.run, none of them with a repo field.
    • 68 summary records from devops_cli.server.service. After the repository name, their message says only "Roadmap jobs failed: ": close 23, refine 25, intake 8, intake, refine 6, reprioritize 4, intake, reprioritize 2.
    • With eight managed repositories, the record with the cause doesn't say which repository it is about, and the record with the repository doesn't say what went wrong.
  • The trace has the same gap. The span's error.message is str(exc)[:256] (service.py:176-178), so a trace shows "Roadmap jobs failed: intake" and nothing more.
  • The CLI has it too. devops roadmap run --confirm prints only the job names, rebuilt from failed_jobs (src/devops_cli/commands/roadmap.py:554-556).
    • The cause reaches the terminal only because Python's last-resort handler prints the logger.exception record.
    • The CLI installs no logging handler: under src, only server/json_logs.py calls addHandler.

3. A clone failure is not logged at all

Acceptance criteria

  • A managed repository without .github/roadmap.toml is a configuration error. service_job catches the GitHubFileNotFoundError from its _open_roadmap call and raises a ConfigurationError from it, with key="service.repos" and details={"path": ".github/roadmap.toml"}.

    • The message names the repository and the file. It says to commit the file or to remove the repository from service.repos.
    • open_roadmap and read_roadmap_config do not change.

    Checked in tests/test_roadmap_run.py:

    • with the roadmap_store fixture and no file seeded, service_job raises that ConfigurationError;
    • with the unreadable_github_roadmap fixture (tests/conftest.py:429-450, where gh answers HTTP 503), it raises the store's GitHubOperationError unchanged: not a GitHubFileNotFoundError and not a ConfigurationError;
    • the devops gh issues triage tests in tests/test_gh_cmd.py:213-270 pass unchanged.
  • A failed run keeps every job's error, including clone errors. _execute_due_rows no longer logs anything. The RoadmapRunError it raises:

    • names every failed job with the first line of its error, for example Roadmap jobs failed: intake: <error>; metrics, refine: git clone failed: <stderr>. A clone error that stopped several jobs appears once, listing the jobs it stopped;
    • caps each quoted error line at 256 characters (AGENTS.md:40) and never cuts a job name. DEFAULT_DUE_TABLE has three rows, so the message stays bounded, and the full text stays in the members' tracebacks;
    • is raised from a stdlib ExceptionGroup of those exceptions, each carrying a PEP 678 note that names its job or jobs;
    • says whether its group holds only ConfigurationErrors (checked with ExceptionGroup.split), for example as a property;
    • keeps failed_jobs as it is.

    Checked by new cases in tests/test_roadmap_run.py:

    • one builds its table with build_stub_table(..., needs_clone=True), as test_checkouts_git_management (:562) does. intake raises a ConfigurationError, and remote_url points at a missing path under tmp_path, so the clone fails before any session login is read;
    • it expects the message to name intake with its error text, and metrics, refine with git clone failed; __cause__ to be an ExceptionGroup with two members; the run not to be configuration-only; and no ERROR record from devops_cli.roadmap.run in caplog;
    • another, with no clone, has only intake fail with a ConfigurationError and expects the run to be configuration-only.
  • The Service logs a configuration-only failure without a traceback, and every other failure as today. A run is configuration-only when it raises a ConfigurationError, or a RoadmapRunError whose group holds only ConfigurationErrors.

    • A configuration-only failure logs one ERROR record without exc_info, on every run. The record names the repository and the error, and carries repo and result="error".
    • Any other failure logs one ERROR record with exc_info, as today. For a RoadmapRunError, the traceback shows each member's traceback and note.
    • On every failed run, devops_cli_service_jobs_total{result="error"} still increments and the span still gets ERROR status. Its error.message, still capped at 256, now starts with the first failed job and its error.
    • The Service keeps no state between runs.

    Checked by a new case in tests/test_server_service.py:

    • it drives a RepoWorker through its public methods: start(), then enqueue("poll", "", "") followed by wait_active(1.0) once per run, then stop(). It does not go through create_service_app, whose poll loop keeps enqueuing (service.py:258-277) while the worker merges pending triggers into one batch (:133-152), so runs would coalesce;
    • the job raises, in turn: a ConfigurationError; the same again; a RoadmapRunError from a group of two ConfigurationErrors; a RoadmapRunError from a group of a ConfigurationError and a RuntimeError; a RuntimeError. Then it succeeds;
    • the records from devops_cli.server.service at WARNING or above are exactly three ERROR records without exc_info, then two with it;
    • the error counter rises by 5 and the success counter by 1, read as deltas or on a repository label no other test uses, because GLOBAL_METRICS is process-wide and no fixture resets it;
    • JsonLogFormatter renders the first record with no exception key, and the fourth with both members' notes in its exception text.
  • devops roadmap run --confirm prints the RoadmapRunError message, which now names each job and its error, with print_error(..., safe=True) so markup in quoted git or GitHub text prints literally, and exits 1.

    Checked by the CLI half of test_failure_isolation_and_cli_exit (tests/test_roadmap_run.py:489-509): its RoadmapRunError message gains a Rich markup fragment, and the test asserts that the message prints literally. That half already patches devops_cli.roadmap.run.run_due_jobs (:493). This is a pre-existing exemption that test(cli): tests double only process edges and mirror the source tree #1307's children remove; this item adds no patch.

  • server/service.py and roadmap/run.py gain no new blind except, except: pass or except: continue. Their counts under uv run ruff check --select BLE001,S110,S112 don't grow (the BLE family is not enabled in pyproject.toml:94; feat(cli): blind exception handling policy #423 owns it), and test(cli): swallowed failures may not grow: blind excepts, except-pass, except-continue and unread check=False are held at their ceilings #1347's ceilings hold if it has landed.

  • No new test reaches the network or runs helm, and each new test's call phase stays under 1 s, as shown by uv run pytest tests/test_server_service.py tests/test_roadmap_run.py tests/test_gh_cmd.py --durations=0. New tests patch no devops-cli name (test(cli): tests double only process edges and mirror the source tree #1307). They use RepoWorker's public methods, the shared store fixtures and a missing local path as the remote instead.

  • uv run devops ci passes within its 5-minute budget.

  • Pending a person, after merge, once the Service runs a release image that contains this fix:

    • (a) sum(count_over_time({namespace="devops"} | json | logger="devops_cli.roadmap.run" | level="ERROR" [24h])) returns nothing for the 24 h after the rollout.

    • (b) sum(count_over_time({namespace="devops"} | json | logger="devops_cli.server.service" | message=~".*Roadmap jobs failed: [a-z]+(, [a-z]+)*" [24h])) returns nothing, so no failure record ends in bare job names.

    • (c) The next time a repository is added to service.repos before its .github/roadmap.toml lands, as six were on 2026-10-07:

      • each poll logs one ERROR record for that repository with no exception field, naming .github/roadmap.toml and service.repos;
      • devops_cli_service_jobs_total{repo="<it>",result="error"} rises by one per poll.

      Skip (c) if no such repository is added within a week of the rollout.

Key questions

Strategic alignment

Update 2026-10-08: refinement

Lines moved (roadmap/run.py:852-862, :829-835; server/service.py:230-261). #1400 landed, so the group's rate-limit members carry the reset. #1280 made a failed cut push a typed error (commands/release.py:1113-1130), closing the typer.exceptions.Exit question. #1404 narrows the refine-hook catch this item's comment targets (roadmap/intake.py:1389-1390), and #1409 makes a failed login lookup fail the clone rows.

Activity

  1. added
    type/bug
    scope/telemetry
    scope/github
    priority/p2-medium
    on Oct 8, 2026
  2. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. The defects degrade operational observability and make debugging harder but do not break job execution or data integrity, and the service continues to function.
    • Value: Medium. Operators debugging the service across eight repositories need accurate, single-record, context-rich logs; the current split-and-noisy output slows incident response but does not block the service.
    • Effort: Medium. The fix requires distinguishing a missing roadmap.toml as a ConfigurationError in the service path without breaking the existing GitHubFileNotFoundError contract used by devops gh issues triage, consolidating two log sites into one with bot
  3. added
    source/agent
    and removed
    priority/p2-medium
    on Oct 8, 2026
  4. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Note from #1366 (2026-10-08): after #1366, ensure_checkout raises GitOperationError for any failed git command, with the command and git's reason. A subprocess.TimeoutExpired or a missing git binary still reaches _prepare_clone unconverted, so this item's clone-error log should render those two as well.

  5. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Amendment from #1400 (in review for v0.2.29):

    • fix(roadmap): a GraphQL budget refusal pauses every Service worker until the reset, and each Service round ends with its spend line #1400 carries a job-level GraphQL refusal's reset on RoadmapRunError.reset_at, because this item's ExceptionGroup cause has not landed. When it lands, move the reset onto its GitHubRateLimitError members, and have service_pause_until read the earliest refusal_reset among them.
    • Intake's refine hook (roadmap/intake.py, around lines 1202-1205) and refine's visibility read (roadmap/refine.py, around lines 327-331) log and drop every exception. A GraphQL budget refusal there does not pause the Service until the round's next board call raises it again. Re-raise GitHubRateLimitError there, so the job's own error carries the refusal.
  6. added
    status/blocked
    on Oct 11, 2026
  7. dan-petty commented on Oct 11, 2026

    @dan-petty
    OwnerAuthor

    Blocked by #1562: the roadmap Service's machine account is suspended, and the Service is held at 0 replicas. This item develops the Service or can only be checked on it, so it waits until the account is reinstated or the jobs act as a GitHub App.


    Generated by Claude Code

  8. removed
    status/blocked
    on Oct 30, 2026
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

    scope/githubscope/telemetrysource/agenttype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions