Repository navigation
Description
Problem or Motivation
Part of #1335. The pull request for #3746 moved the roadmap and CI tests onto the store install hook and the shared fakes. Four patch sites and two CI cases stay, because each needs a seam that the tree does not have yet:
patch("uvicorn.run")twice intests/roadmap/test_roadmap_run.py(test_service_wiringandtest_the_service_that_serve_starts_reads_its_halt_and_budget_from_the_volume).devops serve --servicestarts the ASGI server withuvicorn.run. No seam lets a test see the app that it gets.tests/server/test_server.pypatches the same name five times.patch("devops_cli.roadmap.run.run_due_jobs")twice in the same file. One case (test_service_wiring) reads the lane tables and clone directories that the lane jobs ofdevops serve --servicepass on. The other case (test_failure_isolation_and_cli_exit) reads howdevops roadmap run --confirmprints aRoadmapRunErrorwhose text holds Rich markup. The lane table has no injection point, and no real job fails with such a text.devops ci --forcewith a matching cache entry has no test. The old test patched_run_all_checks_async.run_subprocess_asyncstarts real child processes unlesssubprocess.runis patched (core/process.py), so no process fake answers the checks ofdevops ci(test(cli): Use edge fakes and real git; drop test rebind hooks #1333). A probe in a temporary tree started a realuv, and the floor refused it.- The warning that
_try_save_ci_cacheprints when the tree changed during a CI run (MESSAGES.ci.cache_tree_changed) has no test. The rule itself is tested throughrecord_passing_run. The command glue needs the same async seam.
Proposed Solution & Architectural Design
- After test(cli): Use edge fakes and real git; drop test rebind hooks #1333 removes the async reroute, add two CLI tests of
devops ciover the process fake and the git fake:--forceskips a matching cache entry, and a tree that changes during a run prints the warning and leaves the cache file as it was. - Add a server-start seam, with a fake and a contract test, that
tests/server/test_server.pyandtests/roadmap/test_roadmap_run.pyboth use. Remove the twouvicorn.runpatches. - Give the lane jobs a public way to be read, such as the lane table as data on the app state, so a test needs no
run_due_jobspatch. Test the markup case with a real failing row of the due table.
Target Subsystem
SDLC, Git & PR Governance
Existing Tool Considered
The ASGI server runs under uvicorn, which stays. Only the call that starts it needs a seam, in the pattern of install_exporter.
Source: #3746
Proposed design
Problem statement
The serve and roadmap tests still patch uvicorn.run and run_due_jobs because the tree has no seam to see the ASGI app or the lane job tables. The CI cache tests also wait on #1333. This issue adds a server-start seam, exposes lane metadata on the app state, and adds a table seam for the roadmap CLI. It defers the CI tests until #1333 lands.
Acceptance criteria
Requirement: Server start seam
The serve command SHALL start the ASGI server through an installable server starter.
Scenario: Fake starter records the service start
- WHEN A test installs a fake server starter and runs
devops serve --service. - THEN The fake records one start call with the app factory and the host, port and log config, and the test builds the app from the factory.
Requirement: Server start contract
The server start seam MUST have a contract test that runs the fake and the real uvicorn starter.
Scenario: Contract test starts uvicorn on a loopback port
- WHEN The contract test runs each case over the fake and over the real starter.
- THEN The fake records the same start arguments, and the real starter serves a request on a loopback port and stops.
Requirement: No uvicorn patch
The server tests SHALL use the fake server starter instead of patching uvicorn.run.
Scenario: No uvicorn.run patch in the server tests
- WHEN A search runs over
tests/server/test_server.pyandtests/roadmap/test_roadmap_run.py. - THEN It finds no
patch("uvicorn.run")call.
Requirement: Lane metadata on app state
The service app SHALL expose each lane's job table and clone directory on its state.
Scenario: Service wiring reads lane metadata
- WHEN A test starts
devops serve --servicewith the fake server starter and builds the app. - THEN
app.state.lanesgives the status, triage and model lane tables and clone dirnames, and the tables equal the lane row constants.
Requirement: No run_due_jobs patch
The roadmap tests SHALL read the lane metadata and the CLI table instead of patching run_due_jobs.
Scenario: No run_due_jobs patch in the roadmap tests
- WHEN A search runs over
tests/roadmap/test_roadmap_run.py. - THEN It finds no
patch("devops_cli.roadmap.run.run_due_jobs")call.
Requirement: Roadmap CLI table seam
The roadmap run command SHALL accept an optional due table for tests.
Scenario: Failing row drives the CLI error
- WHEN A test calls the roadmap run command with a table whose intake row raises
RoadmapRunError("Crash [bold red]markup[/bold red]", failed_jobs=("intake",)). - THEN The command exits 1 and its output contains the literal
[bold red]markup[/bold red]text.
Existing Tool Considered
No alternatives check has run. The ASGI server is uvicorn, which stays; only the call that starts it needs a seam, in the pattern of install_exporter. The change builds its own test seam, not a replacement for a tool. Cost: about 1,500 tokens to add, about 300 tokens a year to keep, in less than one day.
Key questions
- Which shape should the server-start seam take?: Add
install_server_starterandremove_server_starterinsrc/devops_cli/server/start.py. The serve command calls the installed starter. A fake starter records the app factory and options. A contract test runs the fake and the real uvicorn starter. (best practice) [sources: docs/TESTING.md:198, src/devops_cli/telemetry/tracer.py, tests/support/fakes/otlp.py]- Chosen: Install hook with a protocol and fake. Matches install_exporter, keeps the source free of patch-shaped modules, and gives a contract test.
- Rejected: Patch uvicorn.run in each test. ADR 0007 and docs/TESTING.md forbid a module shaped for patching.
- Rejected: Pass a starter parameter through the CLI. Leaks a test detail into the command signature and every caller.
- How should the lane jobs expose their tables and clone directories?: Store a
LaneSpecfor each lane onapp.state.lanes, with the lane name, table and clone dirname. The service wiring test reads that mapping. (best practice) [sources: src/devops_cli/server/app.py, tests/roadmap/test_roadmap_run.py]- Chosen: App state mapping. The test already reads app.state.jobs and pause_until; data on app state is public and needs no patch.
- Rejected: Module-level install hook for lane jobs. Adds global state and a reset for no gain.
- Rejected: Keep patching run_due_jobs. The issue removes this patch site.
- How should the roadmap CLI test get a failing due table?: Add a public
run_roadmap_command(table=...)function insrc/devops_cli/commands/roadmap.py. The Typer command calls it with no table. The test calls it with a stub table whose intake row raises the markup error. (best practice) [sources: src/devops_cli/commands/roadmap.py, src/devops_cli/roadmap/run.py]- Chosen: Public command function with a table parameter. Exercises the real error path and exit code with no global patch.
- Rejected: Patch run_due_jobs in the CLI test. The issue removes this patch site.
- Rejected: Test only an error formatter. Does not cover the command's exit code and output.
- Can the
devops ci --forceand cache-warning tests run before test(cli): Use edge fakes and real git; drop test rebind hooks #1333 lands?: No.run_subprocess_asyncstarts real child processes unlesssubprocess.runis patched, so the process fake cannot answer the checks ofdevops ci. A probe started a realuv, and the floor refused it. The CI part waits on test(cli): Use edge fakes and real git; drop test rebind hooks #1333 and is deferred. [sources: src/devops_cli/core/process.py, openspec/changes/archive/2026-11-07-3746-roadmap-tests-install-store-hook/proposal.md:36] - Does the ASGI server stay uvicorn?: Yes. uvicorn stays. The change adds a seam around the call that starts it, not a new server. [sources: src/devops_cli/commands/serve.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-08: not-applicable.
Class: test, no search.
Tool: none found.
Activity
dan-petty commentedon Nov 7, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
testprefix of the title gives the type.(roadmap)scope of the title gives the scope.Test-infrastructure work that unblocks remaining test coverage but does not fix a user-facing defect.Removes fragile patches and enables reliable serve and CI test coverage for all contributors.Four distinct seams with fakes and contract tests across server, lane jobs, CI process, and cache warning paths.Both remove internal devops_cli patches from command tests; #3769 is the umbrella rule for all command tests, while the candidate adds the specific serve and CI seams that remain.test(roadmap): install the roadmap store through one hook (#3889)
devops-cli-service commentedon Nov 7, 2026
Status set to Ready at a6fff84 (see proposed design in issue body).
Moved to new items: #4016.
devops-cli-service commentedon Nov 8, 2026
Alternatives check: not-applicable
Class: test. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.
34 remaining items
devops-cli-service commentedon Nov 17, 2026
The runner Job devops-cli-implement-devops-cli-3885-c81462 ended: succeeded.
Image digest: sha256:47b191971ac0f40357ab821d8b13fa5ae022b11beccd42ea859f629c94751c51
The last lines of its log:
test(roadmap): Add the server start seam and its contract test (#3885)
test(roadmap): Start the server of serve through the installed starter (
test(roadmap): Put each lane's table and clone directory on the app s…
test(roadmap): Let the roadmap run command take the due table of its …
test(ci): Add the two devops ci cache cases over the git fake (#3885)
docs(roadmap): Document the two test seams and archive the change (#3885
devops-cli-service commentedon Nov 18, 2026
Released in v0.175.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.175.0
devops-cli-service commentedon Nov 18, 2026
Live since 2026-11-18 06:26 UTC