Skip to content

fix: code quality issue#266

Open
Priyanka-Microsoft wants to merge 1 commit into
devfrom
feature/code-quality-issues
Open

fix: code quality issue#266
Priyanka-Microsoft wants to merge 1 commit into
devfrom
feature/code-quality-issues

Conversation

@Priyanka-Microsoft
Copy link
Copy Markdown
Contributor

Purpose

  • ...
    This pull request includes minor test and import cleanup changes across both backend and frontend code. The main updates are simplifications in test factories, a comment clarification, and a small frontend import cleanup.

Test code simplifications:

  • Updated test cases in test_application_context_extras.py to pass class references directly instead of using lambda factories for singleton registration, making the tests clearer and more concise. [1] [2]
  • Added a clarifying comment in the exception handler for task cancellation cleanup in test_queue_service_internals.py.
  • Removed an unused import (Type) in test_sk_logic_base.py.

Frontend code cleanup:

  • Removed an unused useSelector import from batchHistoryPanel.tsx.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL309720893% 
report-only-changed-files is enabled. No files were changed during this commit :)

Tests Skipped Failures Errors Time
588 0 💤 0 ❌ 0 🔥 14.702s ⏱️

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Coverage

Processor Coverage Report •
FileStmtsMissCoverMissing
TOTAL572772287% 
report-only-changed-files is enabled. No files were changed during this commit :)

Tests Skipped Failures Errors Time
812 0 💤 0 ❌ 0 🔥 18.924s ⏱️

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 makes small code-quality cleanups across the repo, primarily simplifying test registrations in the processor’s AppContext unit tests and removing unused imports in both backend and frontend.

Changes:

  • Simplifies AppContext test registrations by passing class references directly instead of lambdas.
  • Adds a clarifying comment during async task cancellation cleanup in a queue service internal test.
  • Removes unused imports in a backend test and a frontend component.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/processor/src/tests/unit/services/test_queue_service_internals.py Adds a comment in a cancellation cleanup block while awaiting a cancelled task.
src/processor/src/tests/unit/libs/application/test_application_context_extras.py Simplifies singleton registration in tests by passing class references instead of lambda factories.
src/frontend/src/components/batchHistoryPanel.tsx Removes unused useSelector import.
src/backend-api/src/tests/base/test_sk_logic_base.py Removes unused Type import.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 189 to +192
try:
await task
except (asyncio.CancelledError, Exception):
pass
pass # Expected during task cancellation cleanup
Comment on lines 119 to 122
def test_create_async_instance_with_callable_factory():
async def _run():
ctx = AppContext().add_async_singleton(_AsyncSvc, lambda: _AsyncSvc())
ctx = AppContext().add_async_singleton(_AsyncSvc, _AsyncSvc)
a = await ctx.get_service_async(_AsyncSvc)
Comment on lines 153 to 156
def test_create_instance_with_factory_callable():
ctx = AppContext().add_singleton(_S, lambda: _S())
ctx = AppContext().add_singleton(_S, _S)
a = ctx.get_service(_S)
assert isinstance(a, _S)
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