Skip to content

fix: resolve code quality findings#268

Merged
Roopan-Microsoft merged 1 commit into
devfrom
fix/code-quality-issues-48033
Jun 24, 2026
Merged

fix: resolve code quality findings#268
Roopan-Microsoft merged 1 commit into
devfrom
fix/code-quality-issues-48033

Conversation

@Prachig-Microsoft

Copy link
Copy Markdown
Contributor

This pull request primarily improves the robustness and clarity of both backend and end-to-end (E2E) test code by adding explanatory comments and handling transient or expected exceptions more gracefully. The changes ensure that tests and async operations behave predictably in edge cases, especially when UI elements may not appear as expected or asynchronous operations might not have observable effects.

Test robustness and clarity improvements:

  • Added comments and exception handling in webUserPage.py to clarify why certain UI waits may fail (e.g., stop button not appearing for instant replies, or response bubbles being mid-render), and to ensure tests proceed correctly in those cases. [1] [2] [3]
  • Added a comment in test_byocc.py to clarify fallback behavior when clicking the "New Session" button fails, ensuring test intent is clear.

Backend async operation improvement:

  • In voice_live.py, assigned the result of an awaited close function to a variable to ensure the await statement has an observable effect, improving code clarity and preventing potential linter warnings.

Does this introduce a breaking change?

  • Yes
  • No

Add explanatory comments to 5 intentional empty-except blocks (py/empty-except) and bind awaited result in voice_live.py (py/ineffectual-statement). No behavior change.

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

Copy link
Copy Markdown

Coverage

Coverage Report •
FileStmtsMissCoverMissing
routers
   voice_live.py3674089%31–34, 155–156, 162–163, 174, 177, 214–217, 238–240, 308–311, 328, 330, 376–378, 381, 384, 386–388, 405–406, 415–416, 617, 646–647, 722, 731
TOTAL240025889% 

Tests Skipped Failures Errors Time
402 0 💤 0 ❌ 0 🔥 9.440s ⏱️

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 targets code quality findings by improving E2E test robustness/clarity around transient UI timing states and by adjusting an async shutdown path in the Voice Live backend.

Changes:

  • Added clarifying comments around Playwright timeout/exception handling in the E2E WebUserPage helper to explain expected transient behaviors.
  • Added a clarifying comment in the BYOCC E2E test to explain fallback click behavior.
  • Modified VoiceLiveHandler.stop() to bind an awaited close result (intended to address a code-quality warning).

Reviewed changes

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

File Description
tests/e2e-test/tests/test_byocc.py Adds a comment clarifying the “New Session” click fallback behavior in the E2E test.
tests/e2e-test/pages/webUserPage.py Adds comments explaining expected Playwright timeouts/transient UI states during response waits and bubble reads.
src/api/app/routers/voice_live.py Adjusts awaited credential close handling in the Voice Live shutdown path.

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

Comment thread src/api/app/routers/voice_live.py
Comment thread tests/e2e-test/pages/webUserPage.py
@Roopan-Microsoft Roopan-Microsoft merged commit 1cb8f84 into dev Jun 24, 2026
17 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.

3 participants