Skip to content

Commit 03b6126

Browse files
committed
chore: drop integration field from cli-run register payload
The server-side handler now rejects unknown fields and the integration column has been removed from the schema (it was plumbed end-to-end but never displayed, filtered, or grouped on). Stop sending it. Removes the integration parameter from register_cli_run and setup_streaming, drops the corresponding wiring in socketcli.py, and prunes the now-pointless test_register_cli_run_omits_integration_when_falsy case.
1 parent b07e621 commit 03b6126

5 files changed

Lines changed: 3 additions & 24 deletions

File tree

socketsecurity/core/cli_run.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,12 @@
2323
def register_cli_run(
2424
client: CliClient,
2525
client_version: str,
26-
integration: Optional[str] = None,
2726
) -> Optional[str]:
28-
payload = {"client_version": client_version}
29-
if integration:
30-
payload["integration"] = integration
3127
try:
3228
resp = client.request(
3329
path="python-cli-runs",
3430
method="POST",
35-
payload=json.dumps(payload),
31+
payload=json.dumps({"client_version": client_version}),
3632
)
3733
except APIFailure as e:
3834
log.debug(f"cli-run register failed (streaming disabled): {e}")

socketsecurity/core/streaming.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ def setup_streaming(
3030
cli_logger: logging.Logger,
3131
sdk_logger: logging.Logger,
3232
client_version: str,
33-
integration: Optional[str],
3433
enable_debug: bool,
3534
) -> Optional[Callable[[], None]]:
3635
run_id = register_cli_run(
3736
client,
3837
client_version=client_version,
39-
integration=integration,
4038
)
4139
if not run_id:
4240
cli_logger.debug("server log streaming disabled (register failed)")

socketsecurity/socketcli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ def main_code():
104104
cli_logger=log,
105105
sdk_logger=socket_logger,
106106
client_version=config.version,
107-
integration=config.integration_type,
108107
enable_debug=config.enable_debug,
109108
)
110109
if teardown:

tests/unit/test_cli_run.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ def test_register_cli_run_returns_run_id():
1616
client = Mock(spec=CliClient)
1717
client.request.return_value = _resp({"run_id": "srv-issued-123"})
1818

19-
run_id = register_cli_run(client, client_version="1.2.3", integration="github")
19+
run_id = register_cli_run(client, client_version="1.2.3")
2020

2121
assert run_id == "srv-issued-123"
2222
args, kwargs = client.request.call_args
2323
assert kwargs["path"] == "python-cli-runs"
2424
assert kwargs["method"] == "POST"
2525
body = json.loads(kwargs["payload"])
26-
assert body == {"client_version": "1.2.3", "integration": "github"}
26+
assert body == {"client_version": "1.2.3"}
2727

2828

2929
def test_register_cli_run_returns_none_on_api_failure():
@@ -49,16 +49,6 @@ def test_register_cli_run_returns_none_on_bad_json():
4949
assert register_cli_run(client, client_version="1.0.0") is None
5050

5151

52-
def test_register_cli_run_omits_integration_when_falsy():
53-
client = Mock(spec=CliClient)
54-
client.request.return_value = _resp({"run_id": "x"})
55-
56-
register_cli_run(client, client_version="1.0.0", integration=None)
57-
58-
body = json.loads(client.request.call_args.kwargs["payload"])
59-
assert body == {"client_version": "1.0.0"}
60-
61-
6252
def test_finalize_cli_run_posts_status():
6353
client = Mock(spec=CliClient)
6454
finalize_cli_run(client, "run-x", status="failure")

tests/unit/test_streaming.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ def test_setup_streaming_returns_none_when_register_fails():
2121
cli_logger=logging.getLogger("t-fail"),
2222
sdk_logger=logging.getLogger("t-fail-sdk"),
2323
client_version="1.0",
24-
integration=None,
2524
enable_debug=False,
2625
)
2726
assert teardown is None
@@ -45,7 +44,6 @@ def fake_finalize(client, run_id, status="success"):
4544
cli_logger=cli_logger,
4645
sdk_logger=sdk_logger,
4746
client_version="1.0",
48-
integration=None,
4947
enable_debug=False,
5048
)
5149
assert teardown is not None
@@ -74,7 +72,6 @@ def fake_finalize(client, run_id, status="success"):
7472
cli_logger=cli_logger,
7573
sdk_logger=sdk_logger,
7674
client_version="1.0",
77-
integration=None,
7875
enable_debug=False,
7976
)
8077
teardown()
@@ -100,7 +97,6 @@ def test_setup_streaming_restores_logger_state_on_teardown():
10097
cli_logger=cli_logger,
10198
sdk_logger=sdk_logger,
10299
client_version="1.0",
103-
integration=None,
104100
enable_debug=False,
105101
)
106102
# During streaming: levels and propagate are forced

0 commit comments

Comments
 (0)