Repository navigation
Description
Split from #3631.
Problem Refine must write each item when that item is done, so a Service stop loses at most the item in progress. The unit tests prove the code path. They do not prove the behaviour during a real rollout of the Service. ### Why it is deferred The check needs the deployed Service and three rollouts in 2 hours. A release rolls the Service, and the time of a release is outside this item. This item cannot pass until that period happens. ### Acceptance criteria - Run refine for 2 hours across three rollouts of the Service. - Each rollout stops the Service during a refine round. - The log of each round holds one start line and one end line with the counts of items taken, written and failed. - Every item that a round wrote before a stop is Ready after the rollout, and its comment is on the issue. - The next round takes the items that the stopped round did not write.
Proposed design
Problem statement
Build one live check that verifies a refine rollout window, and run it after the merge. The unit tests prove the write path of refine. They do not prove the behaviour during a real Service rollout, when a stop can lose the item in progress. The new check reads the round lines from Loki and the item state from GitHub. It fails with the name of the rollout, the round or the item that breaks a rule. A person merges three release pull requests inside two hours and then runs the check.
Acceptance criteria
Requirement: Rollout window report
The new live check MUST read the refine round lines of a time window from Loki and MUST report the number of rollouts, the number of rounds and the span of the window.
Scenario: Three rollouts in a two-hour window
- WHEN
uv run pytest tests/roadmap/test_roadmap_refine_rollouts_check.py -k covers_windowruns with a Loki fake that returns three Service rollout stops inside a window of 7200 seconds. - THEN the check exits 0 and prints one report line with
rollouts=3andspan=7200.
Requirement: A stop outside a round fails the check
The check MUST exit 1 and MUST name the rollout when a Service rollout stop falls outside every refine round.
Scenario: Stop with no round
- WHEN
uv run pytest tests/roadmap/test_roadmap_refine_rollouts_check.py -k stop_outside_roundruns with a Loki fake whose rollout stop falls after the end line of the last round. - THEN the check exits 1 and prints a line that names that rollout.
Requirement: One start line and one end line per round
The check MUST require exactly one start line and one end line in each refine round, and the end line MUST hold the integer counts taken, written and failed.
Scenario: Round with no end line
- WHEN
uv run pytest tests/roadmap/test_roadmap_refine_rollouts_check.py -k round_linesruns with a Loki fake whose round holds a start line and no end line. - THEN the check exits 1 and prints a line that names that round.
Requirement: A written item is Ready with its comment
The check SHALL read each issue that carries the comment of a round and SHALL exit 1 when one of those issues is not Ready.
Scenario: Written item is in progress
- WHEN
uv run pytest tests/roadmap/test_roadmap_refine_rollouts_check.py -k written_items_readyruns with a GitHub fake that returns one issue with the round comment and StatusIn Progress. - THEN the check exits 1 and prints a line that names that issue number.
Requirement: The next round takes the items left
The check SHALL exit 1 when an item that a stopped round did not write gets no comment from the next round.
Scenario: Item left by the stopped round
- WHEN
uv run pytest tests/roadmap/test_roadmap_refine_rollouts_check.py -k next_round_takes_restruns with a GitHub fake whose New item carries no comment from the next round. - THEN the check exits 1 and prints a line that names that issue number.
Requirement: Each round names its Loki query and window
The report of each round MUST hold the Loki query and the start and end time that produced its lines.
Scenario: Round names its query
- WHEN
uv run pytest tests/roadmap/test_roadmap_refine_rollouts_check.py -k source_queryruns. - THEN the report of each round holds a non-empty
queryfield and astartand anendtime that bound its lines.
Requirement: Pending a person after the merge
A person MUST merge three release pull requests inside one two-hour window and MUST run the live check over that window.
Scenario: Live two-hour run over three rollouts
- WHEN a person merges three release pull requests inside two hours and runs
uv run devops roadmap refine-rollouts-check --start <start> --end <end>. - THEN the command prints one report line for each round and exits 0.
Existing Tool Considered
No alternatives check has run. Loki (grafana/loki, AGPL-3.0) is open and maintained, and it covers the log query of a rollout window. The cluster runs it as the logging service (k8s/README.md:17), and the repository already queries it with its LogQL tool (src/devops_cli/k8s/logql.py). The lines outlive the pod that a rollout replaces. Loki lacks the release schedule, the issue state and the invariant checks. The project already selects and parses the Service result lines with RESULT_LINES (src/devops_cli/roadmap/job_grade_report.py:151). The change adds one devops roadmap live check and its unit tests. It costs about 3k tokens to write, about 500 tokens a month to keep, and about 1k tokens for a fix. It takes under one day.
Key questions
- Which event stops the Service during a refine round?: A Service rollout. The Service closes its request budget in
drain_and_stopatsrc/devops_cli/server/service.py:1182, so the next request of a running refine round fails and the round ends. [sources: src/devops_cli/server/service.py:1182, tests/server/test_server_service.py] - Which source holds the log of a round that a rollout stopped?: Loki, read with the LogQL tool of the repository. The lines outlive the pod that the rollout replaces, so the check reads them after the rollout. (best practice) [sources: src/devops_cli/k8s/logql.py, tests/ai/mcp/test_k8s_logql.py]
- Chosen: Loki query. The lines outlive the pod, and the repository already wraps Loki in its LogQL tool.
- Rejected: kubectl logs --previous. It shows the previous run of a container in the current pod, not the deleted pod.
- Rejected: Live kubectl logs -f for two hours. The stream ends at each rollout, and a dropped stream loses the round.
- Which artifact does the pull request deliver?: A live check command that verifies a rollout window, with its unit tests. The check is product code, so its unit tests assert its behaviour with fakes. (best practice) [sources: AGENTS.md]
- Chosen: Live check command and its unit tests. The command encodes each rule of the item, and a person runs it on a real window.
- Rejected: Recorded fixture and a shape test. A shape test asserts no behaviour of the Service, and AGENTS.md rule 2 forbids compensating code.
- Rejected: A document that records the run. It asserts nothing that a check can show.
- How does the two-hour live run gate the pull request?: It does not gate the merge. The pull request delivers the check. A person runs the check after the merge, and the criterion
Pending a person after the mergerecords that step. (best practice) [sources: AGENTS.md, .github/workflows/release-merge.yml]- Chosen: Run the check after the merge. The check is the deliverable, and the live proof does not hold the merge.
- Rejected: Run the live window before the pull request. It holds the item on a person's release window and delays the check itself.
- How often does the scheduled release merge run, and how many release pull requests does one run merge?: The cron
0 */6 * * *starts the release merge every 6 hours. One run merges at most one release pull request.--match-head-commitfails the merge when release-please pushed after the pick. [sources: .github/workflows/release-merge.yml, CONTEXT.md] - How can three Service rollouts fall inside a two-hour window?: A person merges three release pull requests inside the window. A merge into
mainbetween two release merges makes release-please open the next release pull request. (best practice) [sources: .github/workflows/release-merge.yml, CONTEXT.md]- Chosen: Merge three release pull requests in the window. It follows the release path and gives three real Service rollouts.
- Rejected: Wait for the scheduled merges only. The schedule merges at most one release pull request every 6 hours, so it cannot give three rollouts in two hours.
- Rejected: Restart the deployment by hand. It proves nothing about the release path.
- How does a command find the Loki address?: The setting
loki.urlgives the address. With no setting, the repository falls back tokubectl logsand sends no HTTP request, so the live check needs the setting. [sources: tests/ai/mcp/test_k8s_logql.py, src/devops_cli/k8s/logql.py] - Which record ties an item to the refine round that wrote it?: No record holds a round id. The round start line and the round end line bound the round in time. Each written item logs one result line with
job=refineanditem=#<n>at its write, and Loki gives that line a timestamp. The check places the item in the round by that time. The write also sets the markrefine.read_atin the issue record and posts one comment with the marker<!-- devops roadmap refine: next step -->. [sources: src/devops_cli/roadmap/refine/refine.py:5402, src/devops_cli/roadmap/refine/refine.py:5456, src/devops_cli/roadmap/refine/refine.py:5362, src/devops_cli/roadmap/job_result.py:384, src/devops_cli/roadmap/refine/refine.py:5206, src/devops_cli/config/constants.py:3805, src/devops_cli/k8s/logql.py:386]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 6, 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.It verifies a shipped fix in production but does not block the fix itself.It gives confidence that the incremental-write fix survives real Service stops.It needs a 2-hour live run across three rollouts with log and state checks.Both concern refine writing items incrementally, but #3631 delivers the code fix and the candidate delivers a test that proves the fix across three live rollouts.fix(roadmap): refine writes each item when it is done (#3935)
devops-cli-service commentedon Nov 7, 2026
Refine cannot set this item to Ready at dc276b0 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
.github/workflows/release-merge.yml.devops-cli-service commentedon Nov 14, 2026
Refine cannot set this item to Ready at ffce5d9 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
devops-cli-service commentedon Nov 20, 2026
Owner question: See the first point of Open questions and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 25, 2026
Owner question: See the first point of Open questions and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 26, 2026
Owner question: See Suspected block and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Dec 1, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.