Skip to content

Resolve Python CodeQL quality alerts - #20

Merged
Liang-Chun Tsai (ltsai-dev) merged 4 commits into
mainfrom
ltsai-microsoft-fix-unused-import-alert
Aug 19, 2026
Merged

Resolve Python CodeQL quality alerts#20
Liang-Chun Tsai (ltsai-dev) merged 4 commits into
mainfrom
ltsai-microsoft-fix-unused-import-alert

Conversation

@ltsai-dev

@ltsai-dev Liang-Chun Tsai (ltsai-dev) commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove all six imports reported by py/unused-import
  • correct tests that patched accidental module-level imports
  • resolve the remaining actionable Python CodeQL findings for redundant assignments, empty exception handlers, overly broad BaseException catches, unused test variables, and an unnecessary lambda
  • preserve retry and cleanup behavior while making intentionally ignored exceptions explicit

Addresses code-scanning alerts #1-#7 and #41-#58. OpenSSF Scorecard findings are intentionally excluded because they concern repository policy, workflow pinning, fuzzing, and project governance rather than Python code defects.

Validation

  • all changed Python files compile successfully
  • git diff --check
  • focused code review found no remaining actionable issues

Local pytest and pre-commit execution remain unavailable because the environment cannot download missing dependencies due to a PyPI TLS handshake failure; CI runs both checks.

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

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 cleans up Python files by removing six unused imports that were flagged by CodeQL (py/unused-import), with the stated intent of keeping runtime behavior unchanged.

Changes:

  • Removed an unused logging import from the test runner utility.
  • Removed unused ssl and Path imports from the base LLM session module.
  • Removed unused imports/constants from AOAI session and test utilities (httpx, USER_PROMPT_TPL, json).

Reviewed changes

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

Show a summary per file
File Description
thinkingbox/common/testrunner.py Drops an unused logging import.
thinkingbox/common/llm_session_base.py Drops unused ssl and Path imports.
thinkingbox/common/aoai_responses_session.py Drops an unused httpx import and cleans up spacing.
tests/test_rubrics_judge.py Drops an unused USER_PROMPT_TPL import from the test module.
tests/mcp_test_tool.py Drops an unused json import from the MCP test tool.

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

Liang-Chun Tsai and others added 2 commits August 18, 2026 15:28
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c685bf42-ecb9-40bc-aaaf-dfe2d501bfd4
@ltsai-dev Liang-Chun Tsai (ltsai-dev) changed the title Remove unused imports flagged by CodeQL Resolve Python CodeQL quality alerts Aug 18, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c685bf42-ecb9-40bc-aaaf-dfe2d501bfd4
@ltsai-dev
Liang-Chun Tsai (ltsai-dev) merged commit 94f2bda into main Aug 19, 2026
6 checks passed
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