fix(cloud): send required PR review integration fields

This commit is contained in:
bearsyankees 2026-08-27 15:58:42 -04:00
parent a02c56423c
commit c59e36d353
3 changed files with 74 additions and 3 deletions

View file

@ -203,10 +203,14 @@ strix cloud scans report <scan-id> --format technical --type pdf --output strix-
## 6. PR reviews
Trigger an automated security review of a pull request (`pr_reviews:write`). The results appear as PR comments and in the dashboard:
Trigger an automated security review of a pull request (`pr_reviews:write`). Read the repository's `provider` and `installation_id` with `strix cloud repos list`; both identify the installed source-control integration. The results appear as PR comments and in the dashboard:
```bash
strix cloud pr-reviews start --repository-full-name org/app --pr-number 123
strix cloud pr-reviews start \
--provider github \
--installation-id <installation-id> \
--repository-full-name org/app \
--pr-number 123
```
List/inspect with `strix cloud pr-reviews list` and `strix cloud pr-reviews get <id>`. Repo-level PR-review behavior is configured with `strix cloud pr-reviews settings`.

View file

@ -476,6 +476,8 @@ SPEC: dict[str, dict[str, Cmd]] = {
"/pr-reviews/start",
"Start a PR review.",
body=(
P("provider", required=True, help="Git provider: github, gitlab, or bitbucket."),
P("installation_id", "int", required=True, help="Provider installation ID."),
P("repository_full_name", required=True, help="Repository full name."),
P("pr_number", "int", required=True, help="Pull request number."),
),
@ -816,7 +818,13 @@ SPEC: dict[str, dict[str, Cmd]] = {
"/llm-settings",
"Update the LLM settings.",
body=(
P("modelConfigs", "json", required=True, help="JSON list of model configurations."),
P(
"modelConfigs",
"json",
required=True,
flag="model-configs",
help="JSON list of model configurations.",
),
P("assignments", "json", required=True, help="JSON map of model assignments."),
),
),

View file

@ -485,6 +485,65 @@ def test_knowledge_policy_flags_use_the_api_field_names(
}
def test_pr_review_start_sends_provider_installation_and_pull_request(
monkeypatch: pytest.MonkeyPatch,
) -> None:
seen: dict[str, Any] = {}
def fake_request(_method: str, _path: str, **kwargs: Any) -> FakeResponse:
seen["body"] = kwargs.get("body")
return FakeResponse(payload={"review_id": "review-1", "status": "pending"})
monkeypatch.setattr(http, "request", fake_request)
code = cloud.run_cloud(
[
"pr-reviews",
"start",
"--provider",
"github",
"--installation-id",
"123",
"--repository-full-name",
"org/app",
"--pr-number",
"42",
"--json",
]
)
assert code == 0
assert seen["body"] == {
"provider": "github",
"installation_id": 123,
"repository_full_name": "org/app",
"pr_number": 42,
}
def test_llm_settings_uses_kebab_case_flag_for_camel_case_api_field(
monkeypatch: pytest.MonkeyPatch,
) -> None:
seen: dict[str, Any] = {}
def fake_request(_method: str, _path: str, **kwargs: Any) -> FakeResponse:
seen["body"] = kwargs.get("body")
return FakeResponse(payload={"ok": True})
monkeypatch.setattr(http, "request", fake_request)
code = cloud.run_cloud(
[
"llm-settings",
"update",
"--model-configs",
"[]",
"--assignments",
"{}",
"--json",
]
)
assert code == 0
assert seen["body"] == {"modelConfigs": [], "assignments": {}}
def test_integration_install_url_does_not_open_browser(
monkeypatch: pytest.MonkeyPatch, capsys: Any
) -> None: