Skip to content

fix(secops): avoid stdout logging in investigations - #285

Closed
nightcityblade wants to merge 1 commit into
google:mainfrom
nightcityblade:fix/issue-267
Closed

fix(secops): avoid stdout logging in investigations#285
nightcityblade wants to merge 1 commit into
google:mainfrom
nightcityblade:fix/issue-267

Conversation

@nightcityblade

Copy link
Copy Markdown

Fixes #267

Summary

  • route list_investigations diagnostics through the module logger instead of stdout
  • add a regression test that keeps the MCP stdio channel free of diagnostic output

Testing

  • python -m pytest -q server/secops/tests/test_investigation_management_unit.py (1 passed)
  • ruff check --isolated --select E9,F63,F7,F82 on changed files
  • python -m compileall -q on changed files

@nightcityblade
nightcityblade requested a review from a team August 21, 2026 03:14
@google-cla

google-cla Bot commented Aug 21, 2026

Copy link
Copy Markdown

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.

@dandye

dandye commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Thank you for opening this PR to address stdout printing in investigation management.

We are closing this PR due to the following considerations:

  1. Google CLA Requirement: The Google Contributor License Agreement check (cla/google) has not been completed for this PR.

  2. Test Coverage and Structure: The added unit test asserts capsys.readouterr().out == "" on the happy path, but does not exercise the exception handling path (where print(error_msg) was replaced with logger.exception(error_msg)). Additionally, checking for empty stdout does not verify that the logger was actually invoked with the appropriate severity level and message formatting. In this repository, we prefer standard caplog or unittest.mock.patch fixtures over ad-hoc stub classes and monkeypatch.

We will incorporate logger routing across investigation_management.py with full unit test coverage into our upcoming maintenance release. Thank you for bringing attention to this issue.

@dandye dandye closed this Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

secops_mcp_list_investigations_print_to_stdout_bug

2 participants