Repository navigation
fix(secops-soar): log marketplace diagnostics instead of printing - #334
Conversation
Marketplace tools report fetch/action errors and missing-instance warnings with print(). On the MCP stdio transport that writes into the JSON-RPC stream (same class as google#267 / google#315). Mechanical substitution across the 294 marketplace modules: import logger_utils, replace Error/Warning prints with logger.error / logger.warning. Generator left unchanged for a follow-up. Adds unit coverage that asserts no remaining print() calls and that missing-instance / fetch-error paths leave stdout empty while logging. Fixes google#332 Signed-off-by: KVR Vishnu <46535652+VISHNU0906@users.noreply.github.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@googlebot I signed it! |
|
Thanks for cleaning up the Could you please update the logging calls to use lazy Per the Google Python Style Guide - Section 3.10.1 (Logging):
Following this established project convention (as done in PR #315 for |
Convert marketplace logger.error/warning calls from f-strings to lazy % style per Google Python Style Guide 3.10.1 and the convention set in PR google#315. Message text is unchanged; only the formatting style. Adds a static check that marketplace modules do not use f-string logger calls, and asserts fetch-error records carry args. Signed-off-by: KVR Vishnu <46535652+VISHNU0906@users.noreply.github.com>
dandye
left a comment
There was a problem hiding this comment.
Thanks for working through this and converting all the marketplace diagnostics over to use lazy % logging with clean unit test coverage! This is a great improvement and prevents stdio corruption on the MCP stream.
Merging now!
Fixes #332
secops-soar marketplace tools (~294 modules) report fetch/action errors
and missing-instance warnings with
print(). On the MCP stdio transportstdout is the JSON-RPC channel, so those writes go into the protocol
stream — same class as #267 / #315 for secops.
This routes every marketplace
Error fetching…/Error executing…print through
logger.error, and everyWarning: No active integration instance…print throughlogger.warning, after importinglogger_utils.get_loggerthe same way the rest of secops-soar does.The code generator is left alone for a follow-up; this matches the
immediate path the issue offered.
Test
print(undermarketplace/hit the logger (
tests/unit/test_marketplace_logging.py)tests/unit/suite: 10 passed