Skip to content

Commit 5ed6d06

Browse files
committed
修复本地运行器完整刷新发布
1 parent 8cbc1f2 commit 5ed6d06

3 files changed

Lines changed: 45 additions & 1 deletion

File tree

‎engine/repobrain_engine/hub/refresh_pipeline.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ async def _run_sub(
736736
" ✓ Wrote deterministic git insights (host-runner mode).",
737737
file=sys.stderr,
738738
)
739-
refresh_status.stages["git_insights"] = "partial"
739+
refresh_status.stages["git_insights"] = "success"
740740
except Exception as exc:
741741
print(f" ⚠ Git insights fallback failed: {exc}", file=sys.stderr)
742742
_mark_stage_failure(

‎engine/tests/test_hub_pipeline.py‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,49 @@ async def test_refresh_scan_only_can_be_enabled_from_env_file(
162162
assert (knowledge_root(tmp_path) / "scan_report.json").exists()
163163

164164

165+
@pytest.mark.asyncio
166+
async def test_generic_host_runner_full_refresh_promotes_generation(
167+
tmp_path: Path,
168+
monkeypatch,
169+
commit_workspace,
170+
) -> None:
171+
"""A successful deterministic git stage must not block promotion."""
172+
runner = tmp_path.parent / f"{tmp_path.name}-generic-runner"
173+
runner.write_text(
174+
"#!/bin/sh\n"
175+
"cat >/dev/null\n"
176+
"printf '# Generated\\n\\nHost runner output.\\n'\n",
177+
encoding="utf-8",
178+
)
179+
runner.chmod(0o755)
180+
181+
monkeypatch.setenv("WORKSPACE_PATH", str(tmp_path))
182+
monkeypatch.setenv("OPENAI_API_KEY", "")
183+
monkeypatch.setenv("OPENAI_BASE_URL", "")
184+
monkeypatch.setenv("GOOGLE_API_KEY", "")
185+
monkeypatch.setenv("RB_REFRESH_SCAN_ONLY", "0")
186+
monkeypatch.setenv("RB_HOST_RUNNER", "generic")
187+
monkeypatch.setenv("RB_HOST_COMMAND", str(runner))
188+
monkeypatch.setenv("RB_HOST_OUTPUT_MODE", "stdout")
189+
190+
(tmp_path / "main.py").write_text("value = 1\n", encoding="utf-8")
191+
commit_workspace(tmp_path)
192+
193+
from repobrain_engine.config import reset_settings
194+
from repobrain_engine.hub.refresh_pipeline import refresh_pipeline
195+
from repobrain_engine.hub.storage import active_generation_root
196+
197+
reset_settings()
198+
status = await refresh_pipeline(tmp_path, quick=False)
199+
200+
generation_root = active_generation_root(tmp_path)
201+
assert status.stages["git_insights"] == "success"
202+
assert status.overall_status == "success"
203+
assert status.exit_code == 0
204+
assert generation_root is not None
205+
assert (generation_root / "modules" / "_git_insights.md").exists()
206+
207+
165208
@pytest.mark.asyncio
166209
async def test_ask_pipeline_returns_answer(tmp_path: Path, monkeypatch) -> None:
167210
"""ask_pipeline returns an answer string."""

‎engine/tests/test_plugin_packaging.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def test_legacy_unprefixed_mcp_tool_names_do_not_reappear() -> None:
130130
"venv",
131131
".venv",
132132
".tmp-venv",
133+
".work",
133134
"repobrain_workspace_template_venv",
134135
# Generated / local-only dirs that are never part of shipped source:
135136
# the knowledge base, IDE & agent state, eval artifacts, build output.

0 commit comments

Comments
 (0)