Repository navigation
fix(roadmap): Share one tracker rule with refine - #5963
Conversation
|
The steps of the job: Stopped at group 2. Failure class:
Reason: Last message of the agent (a claim that no check verified): none. The item is Blocked, and the job will not run it. Fix the cause. Then comment
|
d60e55f to
ddf92ab
Compare
|
The steps of the job: Stopped at group 2. Failure class:
Reason: Last message of the agent (a claim that no check verified): none. The job discarded this work. Read it before you retry: diff --git a/tests/roadmap/refine/test_roadmap_refine_tracker.py b/tests/roadmap/refine/test_roadmap_refine_tracker.py
new file mode 100644
index 000000000..8b2cf83a3
--- /dev/null
+++ b/tests/roadmap/refine/test_roadmap_refine_tracker.py
@@ -0,0 +1,179 @@
+"""A refine round leaves out an item that is a tracker, as the stage job does: it has sub-issues or
+the label `type/epic`, so its sub-issues deliver it (#3703).
+"""
+
+from __future__ import annotations
+
+from pathlib import Path
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from tests.support.fakes.model import ModelFake
+import pytest
+
+from devops_cli.config import constants
+from devops_cli.config.constants import CONST_ROADMAP_STATUS_READY
+from devops_cli.lang import MESSAGES
+from devops_cli.roadmap.refine.refine import (
+ apply_refine,
+ plan_refine,
+ refine_left_out,
+)
+from devops_cli.roadmap.stores.store import ItemField
+from tests.support.fakes.roadmap_store import InMemoryRoadmapStore
+from tests.support.roadmap_refine import (
+ PLACED,
+ READY,
+ REPO,
+ comment_bodies,
+ require_item,
+ seed_item,
+)
+
+pytestmark = pytest.mark.usefixtures("keyring_store")
+
+
+TRACKER_TEXT = MESSAGES.roadmap.refine_left_tracker
+
+
+def _seed_sub_issue_tracker(store: InMemoryRoadmapStore, *, sub_issues: int = 2) -> int:
+ """A New backlog P1 item that GitHub records `sub_issues` sub-issues for."""
+ number = store.seed_issue(
+ "feat(roadmap): the parent",
+ body="The parent body.",
+ fields=PLACED,
+ sub_issues=sub_issues,
+ )
+ store.set_field(require_item(store, number), ItemField.STATUS, "New")
+ return number
+
+
+def _seed_epic_tracker(store: InMemoryRoadmapStore) -> int:
+ """A New backlog P1 item with the label `type/epic` and no sub-issue."""
+ return seed_item(store, "New", "P1-High", labels=("type/epic",))
+
+
+def _tracker_writes(store: InMemoryRoadmapStore, *numbers: int) -> list[int]:
+ """The numbers of `numbers` that a job wrote to, in the order of the writes."""
+ return [w.number for w in store.job_writes() if w.number in numbers]
+
+
+def test_a_round_leaves_out_an_item_with_sub_issues_and_an_item_with_the_epic_label(
+ git_repo: Path, store: InMemoryRoadmapStore, model_fake: ModelFake
+) -> None:
+ """A round takes neither a tracker with sub-issues nor one with the label `type/epic`: both
+ wait with the tracker text, and the round sends no model request and writes no comment, no
+ body and no field for them (#3703)."""
+ store.seed_visibility(is_private=True)
+ parent = _seed_sub_issue_tracker(store)
+ epic = _seed_epic_tracker(store)
+ plain = seed_item(store, "New", "P1-High")
+ bodies = {number: store.read_issue_body(number) for number in (parent, epic)}
+ model_fake.answer(READY)
+
+ plan = plan_refine(store, repo=REPO, source=git_repo)
+ apply_refine(store, plan)
+
+ assert (
+ [r.item.number for r in plan.refined_items],
+ sorted((w.item.number, w.step, w.details) for w in plan.waiting_items),
+ model_fake.call_count,
+ [comment_bodies(store, number) for number in (parent, epic)],
+ {number: store.read_issue_body(number) for number in (parent, epic)},
+ require_item(store, parent).job_record,
+ require_item(store, epic).job_record,
+ _tracker_writes(store, parent, epic),
+ ) == (
+ [plain],
+ [(parent, "none", (TRACKER_TEXT,)), (epic, "none", (TRACKER_TEXT,))],
+ 1,
+ [[], []],
+ bodies,
+ {},
+ {},
+ [],
+ )
+
+
+def test_a_named_tracker_is_left_out(
+ git_repo: Path, store: InMemoryRoadmapStore, model_fake: ModelFake
+) -> None:
+ """`--item` on a tracker takes no item: the round sends no model request, writes no comment,
+ and the item keeps its body and its record (#3703)."""
+ store.seed_visibility(is_private=True)
+ tracker = _seed_sub_issue_tracker(store, sub_issues=1)
+ body = store.read_issue_body(tracker)
+ writes_before = store.job_writes()
+
+ plan = plan_refine(store, repo=REPO, source=git_repo, item_number=tracker)
+ apply_refine(store, plan)
+
+ assert (
+ plan.refined_items,
+ [(w.item.number, w.step, w.details) for w in plan.waiting_items],
+ model_fake.call_count,
+ comment_bodies(store, tracker),
+ store.read_issue_body(tracker) == body,
+ store.job_writes() == writes_before,
+ ) == ([], [(tracker, "none", (TRACKER_TEXT,))], 0, [], True, True)
+
+
+def test_a_tracker_of_an_untrusted_author_gets_no_notice_comment(
+ git_repo: Path, store: InMemoryRoadmapStore, model_fake: ModelFake
+) -> None:
+ """The tracker check runs before the author check, so a tracker that an outside account
+ opened waits with the tracker text and gets no notice comment (#3703)."""
+ store.seed_visibility(is_private=True)
+ tracker = store.seed_issue(
+ "feat(roadmap): an outside tracker",
+ body="The parent body.",
+ fields=PLACED,
+ author_association="NONE",
+ sub_issues=2,
+ )
+ store.set_field(require_item(store, tracker), ItemField.STATUS, "New")
+
+ plan = plan_refine(store, repo=REPO, source=git_repo)
+ apply_refine(store, plan)
+
+ assert (
+ [(w.item.number, w.step, w.details, w.notice) for w in plan.waiting_items],
+ model_fake.call_count,
+ comment_bodies(store, tracker),
+ ) == ([(tracker, "none", (TRACKER_TEXT,), False)], 0, [])
+
+
+def test_refine_left_out_gives_the_tracker_text(store: InMemoryRoadmapStore) -> None:
+ """`devops roadmap explain` reads the reason from `refine_left_out`: a tracker gets the
+ tracker text, and a plain item gets none (#3703)."""
+ parent = _seed_sub_issue_tracker(store)
+ epic = _seed_epic_tracker(store)
+ plain = seed_item(store, "New", "P1-High")
+
+ assert (
+ refine_left_out(store, require_item(store, parent)),
+ refine_left_out(store, require_item(store, epic)),
+ refine_left_out(store, require_item(store, plain)),
+ ) == (TRACKER_TEXT, TRACKER_TEXT, None)
+
+
+def test_a_plain_item_is_still_refined(
+ git_repo: Path, store: InMemoryRoadmapStore, model_fake: ModelFake
+) -> None:
+ """An item with no sub-issue and no `type/epic` label refines as before: one model request,
+ the Ready Status, and its comment (#3703)."""
+ store.seed_visibility(is_private=True)
+ plain = seed_item(store, "New", "P1-High")
+ model_fake.answer(READY)
+
+ plan = plan_refine(store, repo=REPO, source=git_repo)
+ apply_refine(store, plan)
+
+ (comment,) = comment_bodies(store, plain)
+ assert (
+ [r.item.number for r in plan.refined_items],
+ plan.waiting_items,
+ model_fake.call_count,
+ require_item(store, plain).status,
+ comment.startswith(constants.CONST_ROADMAP_REFINE_COMMENT_MARKER),
+ ) == ([plain], [], 1, CONST_ROADMAP_STATUS_READY, True)The item is Blocked, and the job will not run it. Fix the cause. Then comment
|
ddf92ab to
d48d692
Compare
|
The steps of the job: Stopped at group 2. Failure class:
Reason: Last message of the agent (a claim that no check verified): none. The item is Blocked, and the job will not run it. Fix the cause. Then comment
|
d48d692 to
2e3213e
Compare
🤖 I have created a release *beep* *boop* --- ## [0.167.1](v0.167.0...v0.167.1) (2026-11-16) ### Bug Fixes * **roadmap:** Share one tracker rule with refine ([#5963](#5963)) ([d1a2ce8](d1a2ce8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
The refine job has no tracker rule, while the stage job leaves out an item with sub-issues or the label
type/epic. This change shares one tracker test onItem.is_tracker, makes the refine round leave a tracker out, explains the reason withrefine_left_tracker, and leaves out a named tracker under--item.Closes #3703
Change:
openspec/changes/archive/2026-11-16-3703-refine-leaves-out-a-tracker-as/