From c59e36d353c1a0fb0a39b336abfbf60d20774651 Mon Sep 17 00:00:00 2001 From: bearsyankees Date: Thu, 27 Aug 2026 15:58:42 -0400 Subject: [PATCH] fix(cloud): send required PR review integration fields --- skills/managed-pentesting-with-strix/SKILL.md | 8 ++- strix/interface/cloud/spec.py | 10 +++- tests/test_cloud_cli.py | 59 +++++++++++++++++++ 3 files changed, 74 insertions(+), 3 deletions(-) diff --git a/skills/managed-pentesting-with-strix/SKILL.md b/skills/managed-pentesting-with-strix/SKILL.md index 7dadccb2..464cf2f6 100644 --- a/skills/managed-pentesting-with-strix/SKILL.md +++ b/skills/managed-pentesting-with-strix/SKILL.md @@ -203,10 +203,14 @@ strix cloud scans report --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 \ + --repository-full-name org/app \ + --pr-number 123 ``` List/inspect with `strix cloud pr-reviews list` and `strix cloud pr-reviews get `. Repo-level PR-review behavior is configured with `strix cloud pr-reviews settings`. diff --git a/strix/interface/cloud/spec.py b/strix/interface/cloud/spec.py index 46da9d04..fbbabbf1 100644 --- a/strix/interface/cloud/spec.py +++ b/strix/interface/cloud/spec.py @@ -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."), ), ), diff --git a/tests/test_cloud_cli.py b/tests/test_cloud_cli.py index fa03e8bf..03fbecf5 100644 --- a/tests/test_cloud_cli.py +++ b/tests/test_cloud_cli.py @@ -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: