Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
4 changes: 2 additions & 2 deletions src/backend/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME = ""
APP_ENV = "dev"

# Basic application logging (default: INFO level)
AZURE_BASIC_LOGGING_LEVEL=INFO
AZURE_BASIC_LOGGING_LEVEL=DEBUG
# Azure package logging (default: WARNING level to suppress INFO)
AZURE_PACKAGE_LOGGING_LEVEL=WARNING
AZURE_PACKAGE_LOGGING_LEVEL=DEBUG
# Comma-separated list of specific logger names to configure (default: empty - no custom loggers)
# Example: AZURE_LOGGING_PACKAGES=azure.identity.aio._internal,azure.monitor.opentelemetry.exporter.export._base
AZURE_LOGGING_PACKAGES=
18 changes: 11 additions & 7 deletions src/backend/common/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import os

from azure.identity.aio import ClientSecretCredential
from azure.identity.aio import DefaultAzureCredential as AioDefaultAzureCredential
from azure.identity.aio import ManagedIdentityCredential as AioManagedIdentityCredential

from helper.azure_credential_utils import get_azure_credential

Expand Down Expand Up @@ -54,13 +56,15 @@ def __init__(self):

def get_azure_credentials(self):
"""Retrieve Azure credentials, either from environment variables or managed identity."""
if all([self.azure_tenant_id, self.azure_client_id, self.azure_client_secret]):
return ClientSecretCredential(
tenant_id=self.azure_tenant_id,
client_id=self.azure_client_id,
client_secret=self.azure_client_secret,
)
return self.__azure_credentials
if os.getenv("APP_ENV", "prod").lower() == "dev":
if all([self.azure_tenant_id, self.azure_client_id, self.azure_client_secret]):
Comment thread
Shreyas-Microsoft marked this conversation as resolved.
Outdated
return ClientSecretCredential(
tenant_id=self.azure_tenant_id,
client_id=self.azure_client_id,
client_secret=self.azure_client_secret,
)
return AioDefaultAzureCredential()
return AioManagedIdentityCredential(client_id=self.azure_client_id)
Comment thread
Shreyas-Microsoft marked this conversation as resolved.
Outdated
Comment thread
Shreyas-Microsoft marked this conversation as resolved.
Outdated


app_config = Config()
Expand Down
7 changes: 5 additions & 2 deletions src/backend/sql_agents/convert_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ async def convert_script(

# orchestrate the chat
current_migration = "No migration"
while True:
is_complete: bool = False
while not is_complete:
await comms_manager.group_chat.add_chat_message(
ChatMessageContent(role=AuthorRole.USER, content=source_script)
)
Expand Down Expand Up @@ -273,7 +274,9 @@ async def convert_script(
break

if comms_manager.group_chat.is_complete:
break
is_complete = True
Comment thread
Shreyas-Microsoft marked this conversation as resolved.
Dismissed

break

Comment thread
Shreyas-Microsoft marked this conversation as resolved.
Outdated
migrated_query = current_migration

Expand Down
3 changes: 3 additions & 0 deletions src/frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
.git
22 changes: 7 additions & 15 deletions src/frontend/src/pages/modernizationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { Light as SyntaxHighlighter } from "react-syntax-highlighter"
import { vs } from "react-syntax-highlighter/dist/esm/styles/hljs"
import sql from "react-syntax-highlighter/dist/cjs/languages/hljs/sql"
import { useNavigate, useParams } from "react-router-dom"
import { useState, useEffect, useCallback } from "react"
import { useState, useEffect, useCallback, useRef } from "react"
Comment thread
Shreyas-Microsoft marked this conversation as resolved.
Dismissed
Comment thread
Shreyas-Microsoft marked this conversation as resolved.
Outdated
import { getApiUrl, headerBuilder } from '../api/config';
import BatchHistoryPanel from "../components/batchHistoryPanel"
import PanelRight from "../components/Panels/PanelRight";
Expand Down Expand Up @@ -497,6 +497,7 @@ const ModernizationPage = () => {
const [fileId, setFileId] = React.useState<string>("");
const [expandedSections, setExpandedSections] = React.useState<string[]>([]);
const [allFilesCompleted, setAllFilesCompleted] = useState(false);
const [progressPercentage, setProgressPercentage] = useState(0);
Comment thread
Shreyas-Microsoft marked this conversation as resolved.
Dismissed
const [isZipButtonDisabled, setIsZipButtonDisabled] = useState(true);
const [fileLoading, setFileLoading] = useState(false);
const [lastActivityTime, setLastActivityTime] = useState<number>(Date.now());
Expand All @@ -514,18 +515,9 @@ const ModernizationPage = () => {
if (!selectedFile || !selectedFile.translatedCode) {
setFileLoading(true);
const newFileUpdate = await fetchFileFromAPI(selectedFile?.fileId || "");
setFiles((prevFiles) =>
prevFiles.map((file) =>
file.fileId === selectedFile?.fileId
? {
...file,
code: newFileUpdate.content,
translatedCode: newFileUpdate.translated_content,
}
: file
)
);
setFileLoading(false);
Comment thread
Shreyas-Microsoft marked this conversation as resolved.
} else {

}

} catch (err) {
Expand Down Expand Up @@ -1013,16 +1005,16 @@ useEffect(() => {
};
}, [handleWebSocketMessage]);

// Set a timeout for initial loading - if still loading after 30 seconds, show a warning message
// Set a timeout for initial loading - if no progress after 30 seconds, show error
useEffect(() => {
const loadingTimeout = setTimeout(() => {
if (showLoading) {
if (progressPercentage < 5 && showLoading) {
setLoadingError('Processing is taking longer than expected. You can continue waiting or try again later.');
}
Comment thread
Shreyas-Microsoft marked this conversation as resolved.
Comment thread
Shreyas-Microsoft marked this conversation as resolved.
}, 30000);

return () => clearTimeout(loadingTimeout);
}, [showLoading]);
}, [progressPercentage, showLoading]);

// Add timeout mechanism to navigate if no activity for 30 seconds
useEffect(() => {
Expand Down
Loading