Skip to content

fix: Code Quality Fix#411

Merged
Roopan-Microsoft merged 4 commits intodevfrom
feature/fix-code-quality-alerts
Apr 21, 2026
Merged

fix: Code Quality Fix#411
Roopan-Microsoft merged 4 commits intodevfrom
feature/fix-code-quality-alerts

Conversation

@Kanchan-Microsoft
Copy link
Copy Markdown
Contributor

Purpose

This pull request includes several code quality improvements and minor logic corrections across the backend and frontend. The main focus is on improving error handling, simplifying state management, and removing unused or redundant code.

Backend improvements:

  • Improved error detection in create_batch by adding an explicit RuntimeError for unreachable code paths, making unexpected states easier to diagnose.
  • Added clarifying comments in parse_parameters_env_vars to explain behavior when JSON parsing fails, ensuring maintainability.
  • Removed an unnecessary assignment to is_complete in convert_script, as the loop is always broken immediately after.

Frontend cleanup and simplification:

  • Removed unused Redux state (batchState) and progressPercentage state from ModernizationPage, simplifying component state management. [1] [2]
  • Simplified file loading logic in ModernizationPage by removing an unnecessary variable assignment in the file fetch handler.
  • Updated the loading timeout logic to only depend on showLoading, making the effect less brittle and easier to understand.

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

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 focuses on small code-quality cleanups and minor logic tweaks across the frontend and backend to reduce redundant state/assignments and make unexpected states easier to diagnose.

Changes:

  • Frontend: removed unused component state and simplified the file-fetch handler + loading timeout dependencies.
  • Backend: removed a redundant assignment in convert_script and added an explicit “should be unreachable” error in create_batch.
  • Scripts: added clarifying comments around JSON parsing fallback behavior in validate_bicep_params.py.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/frontend/src/pages/modernizationPage.tsx Removes unused Redux/state plumbing, simplifies file loading, and adjusts the loading timeout effect dependencies.
src/backend/sql_agents/convert_script.py Removes a redundant is_complete assignment immediately before a break.
src/backend/common/database/cosmosdb.py Adds an explicit RuntimeError for an “unexpected/unreachable” state in create_batch.
scripts/validate_bicep_params.py Adds comments clarifying behavior when JSON parsing fails in env var extraction.

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

Comment on lines 478 to 482
const ModernizationPage = () => {
const { batchId } = useParams<{ batchId: string }>();
const navigate = useNavigate();

// Redux state to listen for start processing completion
const batchState = useSelector((state: any) => state.batch);

const [batchSummary, setBatchSummary] = useState<BatchSummary | null>(null);
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

batchState/Redux selector usage was removed in this block, but the file still imports useSelector from react-redux (and it’s no longer referenced anywhere). This will typically trip TS/ESLint “unused import” checks—please remove the unused useSelector import (and any other now-unused Redux imports, if present).

Copilot uses AI. Check for mistakes.
@Roopan-Microsoft Roopan-Microsoft merged commit a4dd91b into dev Apr 21, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.8.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants