Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
924c880
Enhance CI workflows: update paths for Docker build, deploy, PyLint, …
Dec 16, 2025
1c3f5a7
Revert "Enhance CI workflows: update paths for Docker build, deploy, …
Dec 16, 2025
37b9fce
Update CI workflows: enhance path triggers for Docker build, deploy, …
Dec 16, 2025
a6723ab
Fixed the maintainability code quality issues
Prekshith-Microsoft Dec 16, 2025
cc7f864
Fix path pattern for .flake8 in PyLint workflow triggers
Dec 17, 2025
1efc3fd
Add 'src/frontend/requirements.txt' to workflow path triggers for pus…
Dec 17, 2025
1219287
Fixed the reliability code quality issues
Prekshith-Microsoft Dec 17, 2025
0ad1068
updated the deployment document
Prekshith-Microsoft Dec 17, 2025
83da989
updated the loginpage
Prekshith-Microsoft Dec 17, 2025
9c6b21e
fix the pylint issue
Prekshith-Microsoft Dec 17, 2025
21c2c35
Enhance CI workflows: add path triggers for 'infra/**', 'scripts/**',…
Dec 18, 2025
62b08d3
Merge pull request #302 from microsoft/psl-codequality
Prajwal-Microsoft Dec 18, 2025
6434419
Reverting my changes from dev
Prekshith-Microsoft Dec 19, 2025
31fd2e8
Merge pull request #304 from microsoft/psl-codequality2
Prajwal-Microsoft Dec 19, 2025
e35f862
Updated the semicolons, commented lines and identical operands
Prekshith-Microsoft Dec 22, 2025
bab02b3
Updated the others files with minor changes
Prekshith-Microsoft Dec 22, 2025
b8161a3
Updated the unused local variable
Prekshith-Microsoft Dec 22, 2025
ae0e967
Updated the conditional
Prekshith-Microsoft Dec 22, 2025
183cd0d
Updated the all the files
Prekshith-Microsoft Dec 22, 2025
ead8581
Fix the pylint issue
Prekshith-Microsoft Dec 22, 2025
72e0dc5
Added white space
Prekshith-Microsoft Dec 22, 2025
b9265ef
Merge pull request #3 from microsoft/dev
Harmanpreet-Microsoft Dec 23, 2025
1aa2ab0
Merge pull request #300 from Harmanpreet-Microsoft/dev
Roopan-Microsoft Dec 23, 2025
9f6f9d4
Merge pull request #305 from microsoft/psl-codeq
Prajwal-Microsoft Dec 24, 2025
0c670a6
add progressPercentage state
Dec 26, 2025
fc05e6e
Merge pull request #307 from microsoft/psl-fix-dev
Prajwal-Microsoft Dec 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ on:
- dev
- demo
- hotfix
paths:
- 'src/backend/**'
- 'src/frontend/**'
- 'docker/**'
- '.github/workflows/build-docker-images.yml'
- '.github/workflows/build-docker.yml'
- 'infra/**'
- 'scripts/**'
- 'azure.yaml'
- '.github/workflows/deploy.yml'
pull_request:
branches:
- main
Expand All @@ -18,6 +28,16 @@ on:
- ready_for_review
- reopened
- synchronize
paths:
- 'src/backend/**'
- 'src/frontend/**'
- 'docker/**'
- '.github/workflows/build-docker-images.yml'
- '.github/workflows/build-docker.yml'
- 'infra/**'
- 'scripts/**'
- 'azure.yaml'
- '.github/workflows/deploy.yml'
merge_group:
workflow_dispatch:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -438,4 +438,4 @@ jobs:
if: always()
run: |
az logout
echo "Logged out from Azure."
echo "Logged out from Azure."
9 changes: 8 additions & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: PyLint

on: [push]
on:
push:
paths:
- '**/*.py'
- '**/requirements.txt'
- '**/pyproject.toml'
- '.flake8'
- '.github/workflows/pylint.yml'

jobs:
lint:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ on:
- main
- dev
- demo
paths:
- 'src/backend/**/*.py'
- 'src/tests/backend/**'
- '.github/workflows/test.yml'
- 'src/backend/requirements.txt'
- 'src/frontend/requirements.txt'
- 'src/backend/pyproject.toml'
pull_request:
types:
- opened
Expand All @@ -16,6 +23,13 @@ on:
- main
- dev
- demo
paths:
- 'src/backend/**/*.py'
- 'src/tests/backend/**'
- '.github/workflows/test.yml'
- 'src/backend/requirements.txt'
- 'src/frontend/requirements.txt'
- 'src/backend/pyproject.toml'

jobs:
# frontend_tests:
Expand Down
1 change: 1 addition & 0 deletions src/backend/api/api_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ async def batch_status_updates(
try:
await websocket.receive_text()
except asyncio.TimeoutError:
# TimeoutError is ignored to keep the WebSocket connection open without receiving data
pass

except WebSocketDisconnect:
Expand Down
4 changes: 0 additions & 4 deletions src/backend/common/database/cosmosdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,6 @@ async def update_batch_entry(
batch["file_count"] = file_count

await self.batch_container.replace_item(item=batch_id, body=batch)
# if isinstance(status, ProcessStatus):
# self.logger.info(f"Updated batch {batch_id} to status {status.value}")
# else:
# self.logger.info(f"Updated batch {batch_id} to status {status}")

return batch
except Exception as e:
Expand Down
2 changes: 2 additions & 0 deletions src/backend/common/services/batch_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ async def delete_batch(self, batch_id: UUID, user_id: str):

self.logger.info(f"Successfully deleted batch with ID: {batch_id}")
return {"message": "Batch deleted successfully", "batch_id": str(batch_id)}
else:
return {"message": "Batch not found", "batch_id": str(batch_id)}

async def delete_file(self, file_id: UUID, user_id: str):
"""Delete a file and its logs, and update batch file count."""
Expand Down
2 changes: 1 addition & 1 deletion src/backend/common/storage/blob_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def upload_file(
raise
try:
# Upload the file
upload_results = blob_client.upload_blob( # noqa: F841
blob_client.upload_blob(
file_content,
content_type=content_type,
metadata=metadata,
Expand Down
14 changes: 0 additions & 14 deletions src/backend/sql_agents/helpers/comms_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,3 @@ async def cleanup(self):

except Exception as e:
self.logger.error("Error during cleanup: %s", str(e))

def __del__(self):
"""Destructor to ensure cleanup if not explicitly called."""
try:
# Only attempt cleanup if there's an active event loop
loop = asyncio.get_running_loop()
if loop and not loop.is_closed():
# Schedule cleanup as a task
loop.create_task(self.cleanup())
except RuntimeError:
# No event loop running, can't clean up asynchronously
self.logger.warning("No event loop available for cleanup in destructor")
except Exception as e:
self.logger.error("Error in destructor cleanup: %s", str(e))
13 changes: 5 additions & 8 deletions src/backend/sql_agents/tools/src/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.SqlServer.TransactSql.ScriptDom;
using Newtonsoft.Json;

Expand Down Expand Up @@ -42,18 +43,14 @@ static void Main(string[] args)

IList<ParseError> errors = ParseSqlQuery(sqlQuery);

var errorList = new List<Dictionary<string, object>>();

foreach (var error in errors)
{
var errorDict = new Dictionary<string, object>
var errorList = errors
.Select(error => new Dictionary<string, object>
{
{ "Line", error.Line },
{ "Column", error.Column },
{ "Error", error.Message }
};
errorList.Add(errorDict);
}
})
.ToList();

string jsonOutput = JsonConvert.SerializeObject(errorList, Formatting.Indented);
Console.WriteLine(jsonOutput);
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/frontend_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from dotenv import load_dotenv
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import FileResponse, HTMLResponse
from fastapi.responses import FileResponse
from fastapi.staticfiles import StaticFiles

# Load environment variables from .env file
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/api/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ export const renderErrorSection = (batchSummary, expandedSections, setExpandedSe

export const renderErrorContent = (batchSummary) => {
// Group errors by file
const errorFiles = batchSummary.files.filter(file => file.error_count && file.error_count);
const errorFiles = batchSummary.files.filter(file => file.error_count);
if (errorFiles.length === 0) {
return (
<div className={useStyles().errorItem}>
Expand Down
44 changes: 2 additions & 42 deletions src/frontend/src/components/batchHistoryPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect, useRef } from "react";

import { useDispatch, useSelector } from 'react-redux';
import { useDispatch } from 'react-redux';
import { Card, Spinner, Tooltip } from "@fluentui/react-components";
import { useNavigate } from "react-router-dom";
import ConfirmationDialog from "../commonComponents/ConfirmationDialog/confirmationDialogue";
Expand All @@ -21,7 +21,7 @@ interface BatchHistoryItem {
status: string;
}
const HistoryPanel: React.FC<HistoryPanelProps> = ({ isOpen, onClose }) => {
const headers = {}
const headers = {};
const [batchHistory, setBatchHistory] = useState<BatchHistoryItem[]>([]);
const [loading, setLoading] = useState(false);
const [error, setError] = useState<string | null>(null);
Expand Down Expand Up @@ -81,46 +81,6 @@ const HistoryPanel: React.FC<HistoryPanelProps> = ({ isOpen, onClose }) => {
}
};

// Function to categorize batches
const categorizeBatches = () => {
const now = new Date();
const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;

// Get start of "Today", "Past 7 days", and "Past 30 days" in LOCAL time
const todayStart = new Date(now.getFullYear(), now.getMonth(), now.getDate());
const past7DaysStart = new Date(todayStart);
const past30DaysStart = new Date(todayStart);

past7DaysStart.setDate(todayStart.getDate() - 7);
past30DaysStart.setDate(todayStart.getDate() - 30);

const todayBatches: BatchHistoryItem[] = [];
const past7DaysBatches: BatchHistoryItem[] = [];
const past30DaysBatches: BatchHistoryItem[] = [];

batchHistory.forEach(batch => {
// Convert UTC timestamp to user's local date
const updatedAtUTC = new Date(batch.created_at);
const updatedAtLocal = new Date(updatedAtUTC.toLocaleString("en-US", { timeZone: userTimeZone }));

// Extract only the local **date** part for comparison
const updatedDate = new Date(updatedAtLocal.getFullYear(), updatedAtLocal.getMonth(), updatedAtLocal.getDate());

// Categorize based on **exact day comparison**
if (updatedDate.getTime() === todayStart.getTime()) {
todayBatches.push(batch);
} else if (updatedDate.getTime() >= past7DaysStart.getTime()) {
past7DaysBatches.push(batch);
} else if (updatedDate.getTime() >= past30DaysStart.getTime()) {
past30DaysBatches.push(batch);
}
});

return { todayBatches, past7DaysBatches, past30DaysBatches };
};

// const { todayBatches, past7DaysBatches, past30DaysBatches } = categorizeBatches();

const deleteBatchFromHistory = (batchId: string) => {
// Get the current URL path
const currentPath = window.location.pathname;
Expand Down
3 changes: 1 addition & 2 deletions src/frontend/src/components/bottomBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button, Card, Dropdown, DropdownProps, Option } from "@fluentui/react-components"
import React, { useState } from "react"
import { useNavigate } from "react-router-dom"
import React from "react"

// Define possible upload states
const UploadState = {
Expand Down
2 changes: 0 additions & 2 deletions src/frontend/src/components/uploadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const FileUploadZone: React.FC<FileUploadZoneProps> = ({
const [uploadIntervals, setUploadIntervals] = useState<{ [key: string]: ReturnType<typeof setTimeout> }>({});
const [showCancelDialog, setShowCancelDialog] = useState(false);
const [showLogoCancelDialog, setShowLogoCancelDialog] = useState(false);
const [uploadState, setUploadState] = useState<'IDLE' | 'UPLOADING' | 'COMPLETED'>('IDLE');
const [batchId, setBatchId] = useState<string>(uuidv4());
const [allUploadsComplete, setAllUploadsComplete] = useState(false);
const [fileLimitExceeded, setFileLimitExceeded] = useState(false);
Expand Down Expand Up @@ -98,7 +97,6 @@ const FileUploadZone: React.FC<FileUploadZoneProps> = ({
}
}

setUploadState(newState);
onUploadStateChange?.(newState);
}, [uploadingFiles, onUploadStateChange]);

Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Main = () => {
const baseURL = config.API_URL.replace(/\/api$/, ''); // Remove '/api' if it appears at the end
console.log('Checking connection to:', baseURL);
try {
const response = await fetch(`${baseURL}/health`);
await fetch(`${baseURL}/health`);
} catch (error) {
console.error('Error connecting to backend:', error);
}
Expand Down
39 changes: 2 additions & 37 deletions src/frontend/src/pages/batchView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import PanelRight from "../components/Panels/PanelRight";
import PanelRightToolbar from "../components/Panels/PanelRightToolbar";
import BatchHistoryPanel from "../components/batchHistoryPanel";
import ConfirmationDialog from "../commonComponents/ConfirmationDialog/confirmationDialogue";
import { determineFileStatus, filesLogsBuilder, renderErrorSection, useStyles, renderFileError, filesErrorCounter, completedFiles, hasFiles, fileErrorCounter, BatchSummary, fileWarningCounter } from "../api/utils";
import { determineFileStatus, filesLogsBuilder, renderErrorSection, useStyles, renderFileError, filesErrorCounter, completedFiles, hasFiles, fileErrorCounter, BatchSummary } from "../api/utils";
export const History = bundleIcon(HistoryFilled, HistoryRegular);
import { format } from "sql-formatter";

Expand Down Expand Up @@ -73,7 +73,6 @@ const BatchStoryPage = () => {
const [selectedFileId, setSelectedFileId] = useState<string>("");
const [expandedSections, setExpandedSections] = useState(["errors"]);
const [batchSummary, setBatchSummary] = useState<BatchSummary | null>(null);
const [selectedFileContent, setSelectedFileContent] = useState<string>("");
const [selectedFileTranslatedContent, setSelectedFileTranslatedContent] = useState<string>("");


Expand Down Expand Up @@ -209,40 +208,6 @@ const BatchStoryPage = () => {
fetchFileContent();
}, [selectedFileId]);


const renderWarningContent = () => {
if (!expandedSections.includes("warnings")) return null;

if (!batchSummary) return null;

// Group warnings by file
const warningFiles = files.filter(file => file.warningCount && file.warningCount > 0 && file.id !== "summary");

if (warningFiles.length === 0) {
return (
<div className={styles.errorItem}>
<Text>No warnings found.</Text>
</div>
);
}

return (
<div>
{warningFiles.map((file, fileIndex) => (
<div key={fileIndex} className={styles.errorItem}>
<div className={styles.errorTitle}>
<Text weight="semibold">{file.name} ({file.warningCount})</Text>
<Text className={styles.errorSource}>source</Text>
</div>
<div className={styles.errorDetails}>
<Text>Warning in file processing. See file for details.</Text>
</div>
</div>
))}
</div>
);
};

const renderContent = () => {
// Define header content based on selected file
const renderHeader = () => {
Expand Down Expand Up @@ -385,7 +350,7 @@ const BatchStoryPage = () => {
}

// Show the summary page when summary is selected
if (selectedFile.id === "summary" && batchSummary) {
if (selectedFile.id === "summary") {
// Check if there are no errors and all files are processed successfully
const noErrors = (batchSummary.error_count === 0);
const allFilesProcessed = (batchSummary.completed_files === batchSummary.total_files);
Expand Down
1 change: 0 additions & 1 deletion src/frontend/src/pages/landingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const LandingPage = (): JSX.Element => {
const dispatch = useDispatch(); // Add dispatch hook
const [selectedTargetLanguage, setSelectedTargetLanguage] = useState<string[]>(["T-SQL"]);
const [selectedCurrentLanguage, setSelectedCurrentLanguage] = useState<string[]>(["Informix"]);
const batchHistoryRef = useRef<{ triggerDeleteAll: () => void } | null>(null);
const isPanelOpen = useSelector((state: RootState) => state.historyPanel.isOpen);
const navigate = useNavigate();

Expand Down
Loading