Skip to content

Fix source-backed code scanning alerts - #18

Merged
Liang-Chun Tsai (ltsai-dev) merged 1 commit into
mainfrom
ltsai-microsoft-fix-code-scanning-alerts-385
Aug 19, 2026
Merged

Fix source-backed code scanning alerts#18
Liang-Chun Tsai (ltsai-dev) merged 1 commit into
mainfrom
ltsai-microsoft-fix-code-scanning-alerts-385

Conversation

@ltsai-dev

Copy link
Copy Markdown
Contributor

Summary

Code scanning reported 21 source-backed Python findings that added noise and obscured actionable security results. This change resolves those findings without changing runtime behavior.

  • Remove unused local assignments in tests and validation code.
  • Make Pydantic field validators explicit class methods.
  • Replace unnecessary lambdas and pass statements.
  • Narrow bare exception handling to ValueError.
  • Remove dead commented-out cancellation logic.

Validation

  • 191 targeted tests passed.
  • Modified production files compile successfully.

Notes

The two remaining repository-level code-scanning checks have no associated source files and are outside this PR's scope.

Remove unused assignments and dead code, narrow exception handling, and make Pydantic validators explicit class methods.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ee3418ba-976d-42ee-839f-5d398e0f1b1c
@ltsai-dev
Liang-Chun Tsai (ltsai-dev) requested review from a team and a lite review from Copilot August 19, 2026 00:08
@ltsai-dev
Liang-Chun Tsai (ltsai-dev) merged commit b9bb735 into main Aug 19, 2026
7 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces noise from source-backed Python code-scanning findings by removing unused assignments, making validator intent explicit, tightening exception handling, and deleting dead/commented logic—without changing runtime behavior.

Changes:

  • Make Pydantic @field_validator methods explicit @classmethods in the airline TAU bench system models.
  • Remove unused local assignments in multiple tests and simplify mocked datetime construction in airline system tests.
  • Clean up minor lint/code-scanning issues: remove a redundant pass, drop an unused agent assignment, and narrow a bare except to ValueError.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
servers/thinkingbox_tools/thinkingbox_tools/toolslib/airline_tau_bench_system.py Makes Pydantic validators explicit classmethods and removes dead/commented cancellation logic.
servers/thinkingbox_tools/tests/test_airline_tau_bench_system.py Simplifies datetime mocking by using mock_datetime.side_effect = datetime instead of a lambda.
servers/tb_business_ops_servers_202606/tests/sandbox_neobank_support/zendesk/test_create_item.py Removes an unused result assignment from an async tool call in a test.
servers/tb_business_ops_servers_202606/tests/sandbox_neobank_support/main/test_approval_api_create_request.py Removes an unused result assignment from an async tool call in a test.
servers/tb_business_ops_servers_202606/tests/sandbox_consulting/zendesk/test_create_item.py Removes an unused result assignment from an async tool call in a test.
servers/tb_business_ops_servers_202606/tests/sandbox_auto_insurance/zendesk/test_create_item.py Removes an unused result assignment from an async tool call in a test.
servers/tb_business_ops_servers_202606/tests/external_booking/payment_api/test_process_refund.py Removes unused result assignments where return values weren’t asserted.
servers/tb_business_ops_servers_202606/tests/external_booking/payment_api/test_process_charge.py Removes an unused result assignment where return value wasn’t asserted.
servers/tb_business_ops_servers_202606/tests/external_booking/payment_api/test_process_charge_dispute.py Removes unused result assignments where return values weren’t asserted.
servers/tb_business_ops_servers_202606/tb_business_ops_servers_202606/utils/typesense_helpers.py Removes a redundant pass in an exception handler during teardown cleanup.
scripts/validate_tags.py Removes an unused agent config local assignment and narrows an exception when building path context.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants