Skip to content

fix(roadmap): the metrics job walks release tags in each repository's own clone, and a missing or type-less labels.yml stops intake as a configuration error before any model call #1358

Closed

Description

@dan-petty

Problem

This item covers two defects in the roadmap Service (devops serve --service, namespace devops, image service:v0.2.28):

  • Defect 1 is live. It was observed on 2026-10-08.
  • Defect 2 is latent. It was found by reading the code at 910b823 and has not fired in the Service yet.

The Service manages eight repositories through service.repos: this one and seven others.

1. The metrics job runs git tag in the pod's working directory instead of in a checkout of the repository

  • The warning. Every metrics run logs this from devops_cli.github.metrics: Failed to inspect git tags: Command '['git', 'tag', '-l', 'v*', ...]' returned non-zero exit status 128.
    • Loki counted 150 of these in the 24 hours up to 2026-10-08 00:27 UTC. That is one per repository per metrics run.
    • Each repository gets a run every 15 to 20 minutes, which is three to four warnings per repository per hour. DEFAULT_ROADMAP_METRICS_INTERVAL_MINUTES = 15 is at src/devops_cli/config/defaults.py:801, and the Service checks it on each 300 s poll.
    • Until 2026-10-07 23:51 UTC only two repositories reached the job. Six more reached it at about 00:17 UTC, when their .github/roadmap.toml landed, and each logged the warning within its first minute.
    • Seven repositories produce the warning now, about 24 an hour. This repository's Service job has been in progress since 23:51:27 UTC (devops_cli_service_job_start_timestamp_seconds, still running at 00:45 UTC), so its metrics job has not run since then. With all eight running, expect about 27 an hour.
  • The call chain.
    • The metrics row of DEFAULT_DUE_TABLE (src/devops_cli/roadmap/run.py:532-537) does not set needs_clone.
    • The executor passes clone_path to every runner (run.py:771-777), but _run_metrics_adapter (run.py:462-501) ignores it. It calls collect_project_metrics_report(repo=target_repo) with no root (run.py:481).
    • With no root, the report uses find_worktree_root(None) (src/devops_cli/github/metrics.py:502). When no .git or pyproject.toml lies above the current directory, that returns the current directory (src/devops_cli/core/repo.py:51-62, :156-175).
    • The image's WORKDIR is /home/devops (Dockerfile:46), which is not a git repository. In the running pod, git rev-parse there exits with "not a git repository" (checked 2026-10-08).
    • _get_git_tag_entries runs git tag with cwd=root (metrics.py:144-170). On failure it logs the warning and returns [] (metrics.py:155-157), so get_release_cadence_metrics returns no releases (metrics.py:222-226).
  • Result. Every repository's report says it has zero releases.
    • devops_cli_project_releases_total read 0 on both export paths at 2026-10-08 00:28 UTC, and still read 0 at 00:48.
    • Two of the eight repositories have v* tags on GitHub: this one has 34 and one other has 4.
    • After the fix the gauge reads at most 10, because get_release_cadence_metrics returns metrics[-limit:] (metrics.py:245) and the default release_limit is 10. This repository will read 10, not 34.
  • This repository already has a clone.
    • It is at /home/devops/.data/roadmap/<owner>/<name>/clone and holds 33 of the 34 tags.
    • close (hourly) and refine fetch it through ensure_checkout when they run (run.py:184-251; needs_clone=True at :518 and :529). Its last fetch was at 2026-10-07 23:32 UTC, before the v0.2.28 tag.
    • It sits on the 1 GiB roadmap-service-home PVC (k8s/devops/roadmap-service/pvc.yaml). The whole roadmap data directory uses 61 MB, and the eight repositories together are about 18 MB on GitHub.
  • The CLI path makes the same call. devops gh metrics (src/devops_cli/commands/gh.py:1875-1881) also passes no root, so it reads the working directory's tags. That is only right when the command runs inside a checkout of the repository it reports.
  • Consistency with fix(telemetry): the project velocity dashboard reads the latest snapshot of each gauge, and the project gauges drop the _total suffix #974. fix(telemetry): the project velocity dashboard reads the latest snapshot of each gauge, and the project gauges drop the _total suffix #974 (open, backlog) keeps the release walk on a checkout: "the release walk reads that worktree's tags". It leaves scheduled collection to the roadmap Service's due table, and that table now has the metrics row. So the Service's job should also read a checkout of its own repository.
  • Calling find_worktree_root on the clone is not enough. In the pod it would return the clone. But DEFAULT_DATA_DIR is the relative path .data (defaults.py:30), so a local devops roadmap run clones inside the workspace. find_worktree_root then climbs past a clone that sits inside another checkout and returns the outer one. This is the known limit tracked in Checkouts and Worktrees Below Another Repository Resolve to Their Own Repository #617.

2. Intake reads .github/labels.yml only when it decides its first candidate, and a missing file is not reported as a configuration error

  • How the file is read. _Run.types (src/devops_cli/roadmap/intake.py:511-527) reads .github/labels.yml through store.repository_file.

    • Only YAML errors and label-spec errors become a ConfigurationError (intake.py:517-521).
    • A missing file raises GitHubFileNotFoundError from GitHubRoadmapStore.repository_file (src/devops_cli/roadmap/github_store.py:1519-1532), with the message "<owner>/<name> has no .github/labels.yml at the default branch."
    • A file that declares no type/* label passes. Every candidate without a type is then skipped, because _choice (intake.py:667-674) rejects every proposed type.
  • When the read happens. types is a cached_property. It is first evaluated in _Planner._decide (intake.py:1011-1028), while the ProposalRequest for the first candidate is being built.

    • This happens whether or not the candidate needs a type.
    • If any candidate went through the duplicate check, _embed has already called the embedding model by then (intake.py:979).
    • A run with no candidates never reads the file.
  • What the Service would log. A failing intake run produces two ERROR records, each with a traceback:

    • the original exception, from _execute_due_rows (logger.exception, run.py:783);
    • Service job execution failed for <repo>: Roadmap jobs failed: intake, from _execute_batch (src/devops_cli/server/service.py:179-185, exc_info=True). This record carries a new RoadmapRunError that names only the failed job. Its traceback ends at run.py:787 and does not include the original message.

    The board-read failures at 00:17-00:18 UTC produced exactly this pair. A failed job is not stamped, because schedule[row.name] is written only on success (run.py:780-781). So intake stays due and fails again on every 300 s poll until the file is fixed.

  • Which repositories are affected. Seven of the eight managed repositories have no .github/labels.yml, and all eight have .github/roadmap.toml (checked through the contents API on 2026-10-08). None of the seven has an open issue.

    • At 00:17 UTC, intake in six of them stopped earlier, at the board read.
    • From the next poll at 00:21 UTC, all seven read their boards and finished intake with no candidate. Loki shows no intake ERROR after 00:18:05 UTC, and devops_cli_service_jobs_total{result="success"} has risen on every poll since.
    • So the first issue filed in any of them reaches this path today.
  • There is no other source for the type list. None of the seven repositories has any type/* label on GitHub (checked 2026-10-08).

Acceptance criteria

  • The metrics row of DEFAULT_DUE_TABLE has needs_clone=True, and _run_metrics_adapter passes the clone_path it receives to collect_project_metrics_report as root. Checked by a new test in tests/test_roadmap_run.py:

    • it runs run_due_jobs with table set to the metrics row of DEFAULT_DUE_TABLE;
    • remote_url points at a bare repository in tmp_path that has two v* tags, built as _make_bare_remote does (tests/test_roadmap_run.py:78, used at :566-573);
    • gh is faked at the process edge, and the GitHub and Cloudflare status fetches at the HTTP edge;
    • it expects the registry's devops_cli_project_releases_total to read 2, and no Failed to inspect git tags record in caplog.

    The test patches no devops-cli name (test(cli): tests double only process edges and mirror the source tree #1307). It replaces the adapter half of test_metrics_job_registered_in_default_due_table_and_adapter (:850-895). That half patches the collector out and leaves the status fetches unstubbed, so it cannot show this.

  • collect_project_metrics_report(root=<path>) walks the tags of <path> itself; only root=None goes through find_worktree_root. Checked by a new test in tests/test_github_metrics.py:

    • it builds a git repository with two v* tags in tmp_path, nested inside another git repository that has different tags;
    • it fakes the gh reads at the process edge;
    • it expects a report with the inner repository's two tags and no Failed to inspect git tags record in caplog.
  • build_stub_table's metrics row follows its needs_clone argument the way close and refine already do (run.py:566, :580). When the clone cannot be prepared, the metrics job fails the way close and refine do. Checked by a tests/test_roadmap_run.py case with remote_url set to a missing path under tmp_path: run_due_jobs raises a RoadmapRunError whose failed_jobs contains metrics, and the stub intake and reprioritize runners still ran.

  • plan_intake reads .github/labels.yml once per run, as soon as the run has at least one candidate and before the closures reads and the embedding call. A run with no candidates does not read it. Checked in tests/test_roadmap_intake.py on the in-memory store with no labels file:

    • (i) with no open issues, the run returns a plan with no decisions and raises nothing;
    • (ii) with one open issue off the board, the run raises ConfigurationError, and FakeModel.embedded and FakeModel.requests stay empty.
  • Two cases raise ConfigurationError with details={"path": ".github/labels.yml"}: a missing .github/labels.yml, and one that declares no type/* label other than type/epic. The message names the repository and the file, and says the file must declare the type/* labels intake may assign. Checked in tests/test_roadmap_intake.py.

  • Any other failed read of the file still raises GitHubOperationError, not ConfigurationError. Checked in tests/test_roadmap_intake.py on a GitHubRoadmapStore whose fake gh runner answers the contents read of .github/labels.yml with HTTP 502. The fake goes through the runner seam (github_store.py:1187), or through refactor(github): the github session owns transport, ledger, error classes and link pagination #983's session fake if that lands first.

  • The dry run lists the labels read where a run now makes it. The step moves from after embed (src/devops_cli/roadmap/intake_requests.py:150) to the start of decisions(), before the closures steps.

    • test_dry_run_makes_no_request_and_prints_the_requests_a_run_makes_in_order (tests/test_roadmap_intake.py:769) expects the step before the timeline read.
    • test_a_dry_runs_requests_follow_the_order_a_run_makes_them (:922) passes in both of its cases.
  • 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_github_metrics.py tests/test_roadmap_run.py tests/test_roadmap_intake.py --durations=0.

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

  • A changelog.d/<n>.md fragment exists, CHANGELOG.md and docs/ROADMAP.md are untouched, and uv run devops pr check-readiness passes.

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

    • (a) The Loki query sum(count_over_time({namespace="devops"} |= "Failed to inspect git tags" [1h])) returns nothing for the hour after the rollout.
    • (b) kubectl -n devops exec deploy/roadmap-service -- sh -c 'ls -d /home/devops/.data/roadmap/*/*/clone' prints one line for each repository in service.repos.
    • (c) Run this against a managed repository that still has no .github/labels.yml: uv run devops roadmap intake --plan -R <owner>/<name> --title "labels probe" --body-file <a one-line text file>. It exits 1, and its message names .github/labels.yml and says the file must declare the type/* labels intake may assign. Skip (c) if every managed repository already has the file.

Key questions

Strategic alignment

Update 2026-10-08: delivered scope

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. Defect 1 is live and has produced ~150 warnings in 24 h across all eight repositories, but it corrupts a monitoring gauge rather than blocking a user workflow.
    • Value: Medium. All eight repositories report zero releases when some have up to 34 tags, so release-cadence dashboards and any downstream alerting read wrong data.
    • Effort: Low. The fix is to pass the already-available clone_path into _run_metrics_adapter instead of ignoring it, plus a small validation guard for labels.yml.
  3. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Two follow-ups proposed in this item's Key questions are filed.

    Also: #1360 changes the same due table, build_stub_table and the start of plan_intake. Whichever lands second rebases, and its intake cap applies after this item's early labels.yml read.

  4. added
    source/agent
    and removed
    priority/p2-medium
    on Oct 8, 2026
  5. added this to the v0.2.29 milestone on Oct 8, 2026
  6. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Placed in v0.2.29 by the owner on 2026-10-08. The owner's instruction was to pull every issue that keeps the roadmap service from working into the current milestone and complete them. This is a person's placement and should stay in the release (#1349). Implementation started the same day, so the board Status is In Progress.

  7. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1426, merged into release/v0.2.29 as ee55c49.

    Closes #1358

    The roadmap Service's metrics job now walks release tags in each repository's own clone. Intake now treats an unusable .github/labels.yml as a configuration error that names the repository, and stops before any timeline read or model call.

    Metrics

    • The metrics row of DEFAULT_DUE_TABLE sets needs_clone=True, and build_stub_table's metrics row follows needs_clone.
    • _run_metrics_adapter passes its clone to collect_project_metrics_report as root.
    • collect_project_metrics_report walks root as given. It calls find_worktree_root() only when root is None, so devops gh metrics is unchanged and a clone kept under .data/ inside a checkout reports its own tags (the nested-checkout limit is Checkouts and Worktrees Below Another Repository Resolve to Their Own Repository #617).
    • The metrics and refine adapters take their clone through _job_clone. Given none, it raises GitOperationError naming the job and needs_clone, so neither job ever reads the working directory.
    • A clone that can't be prepared fails the job, as it fails close and refine.
    • A failed tag read, a REST read that warns and drops, a failed collection and a failed status read keep their warn-only behaviour. Making those fail closed is fix(telemetry): the project velocity dashboard reads the latest snapshot of each gauge, and the project gauges drop the _total suffix #974's scope; the scope handed over is recorded there.

    Intake

    • plan_intake and intake_candidate take a required repo. devops roadmap intake passes its --repo, and the Service's intake job passes the repository it runs.
    • _Planner.decide_all reads .github/labels.yml at the run's first candidate…

    12 file(s) changed.

    How it was verified

    Check runs at 7dd50a1:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Analyze (actions): pass
    • Tests & Coverage: pending
    • Static Analysis: pass
    • Analyze (python): pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1358-metrics-clone-and-labels-config-error.md:

    • The metrics row of DEFAULT_DUE_TABLE has needs_clone=True, and _run_metrics_adapter passes its clone to collect_project_metrics_report as root: test_the_metrics_job_walks_the_release_tags_of_its_own_clone runs run_due_jobs with that row over the bare remote _make_bare_remote builds in tmp_path, with two v* tags added to it, with gh faked at the process edge (GitHubFake.process in place of subprocess.run, git passed through) and the GitHub and Cloudflare status pages through stub_web. The registry's devops_cli_project_releases_total reads 2 and the job logs no WARNING record at all, so no Failed to inspect git tags, no Project metrics collection failed and no Failed to query. No devops-cli name is patched. It replaces test_metrics_job_registered_in_default_due_table_and_adapter.
    • collect_project_metrics_report(root=<path>) walks the tags of <path> itself; only root=None goes through find_worktree_root (test_a_given_root_is_walked_as_it_is_even_inside_another_checkout: a clone with two tags under .data/ inside a checkout with two other tags reports the clone's, with no warning). test_collect_project_metrics_report patches no reader: its releases are three dated tags in tmp_path, its milestones and open issues' labels GitHubFake's answers.
    • build_stub_table's metrics row follows needs_clone, and a clone that can't be prepared fails metrics as it fails close and refine while the stub intake and reprioritize still run (test_checkouts_git_management expects failed_jobs == ("close", "refine", "metrics")).
    • Given no clone, the metrics and refine adapters raise GitOperationError naming the job and needs_clone, and read nothing (test_a_job_that_reads_the_clone_fails_without_one_rather_than_reading_the_cwd, both jobs).
    • A failed collection and failed status reads stay warnings that skip that part of the run: GitHub answering a milestone the report can't count and both status pages answering 404 give the job's three WARNING records, and the job returns its JobOutcome (test_a_failed_metrics_collection_or_status_read_is_logged_and_the_job_goes_on).
    • plan_intake reads .github/labels.yml once, at the run's first candidate, before the timeline reads and the embedding call; a run with no candidate does not read it (test_a_run_with_no_candidate_needs_no_labels_file; test_a_labels_file_it_cant_use_stops_intake_before_any_read_or_model_call records no closures call and leaves FakeModel.embedded and FakeModel.requests empty).
    • A missing file and one with only type/epic raise ConfigurationError with details={"path": ".github/labels.yml"}, and the message names the repository (example/roadmap), the file and the rule; a file that is no label specs names the repository and the file (same test, three cases). Through the command, the error names the --repo repository (test_intake_names_the_repository_whose_labels_file_declares_no_type).
    • A 502 on the read raises GitHubOperationError, neither a ConfigurationError nor a GitHubFileNotFoundError, before any model call (test_a_labels_read_github_fails_stays_a_github_error, a GitHubRoadmapStore over GitHubFake whose files entry answers (1, "gh: Server Error (HTTP 502)")).
    • The dry run lists the labels read before the timeline read (test_dry_run_makes_no_request_and_prints_the_requests_a_run_makes_in_order), with the candidate condition over the open issues and none for a --title candidate (test_a_dry_runs_labels_read_waits_for_a_candidate_unless_it_has_a_title), and test_a_dry_runs_requests_follow_the_order_a_run_makes_them passes for both of its cases.
    • No new test reaches the network or runs helm, and each new test's call phase is under 1 s (uv run pytest tests/test_github_metrics.py tests/test_roadmap_run.py tests/test_roadmap_intake.py --durations=0).
    • uv run devops ci passes within its 5-minute budget.
    • changelog.d/1358.md records the change; CHANGELOG.md and docs/ROADMAP.md are untouched.
    • Pending a person: ship v0.2.29 so the Service runs a release image with this fix (merge the release PR; Argo CD deploys the new service tag). Both checks below wait on it.
    • Pending a person, for the hour after the rollout: the Loki query sum(count_over_time({namespace="devops"} |= "Failed to inspect git tags" [1h])) returns nothing (baseline: 71 lines in the 3 hours before 2026-10-08 ~12:35 UTC).
    • Pending a person, after the rollout: kubectl -n devops exec deploy/roadmap-service -- sh -c 'ls -d /home/devops/.data/roadmap/*/*/clone' prints one line for each repository in service.repos.
  8. added a commit that references this issue on Oct 8, 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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions