Skip to content

chore: Main merge to Demo#259

Merged
66 commits merged into
demofrom
main
May 26, 2026
Merged

chore: Main merge to Demo#259
66 commits merged into
demofrom
main

Conversation

@Shreyas-Microsoft
Copy link
Copy Markdown
Collaborator

Purpose

This pull request introduces significant improvements to CI/CD workflows, infrastructure automation, and documentation. The main changes are the addition of a new test workflow for the processor service, enhancements to parameter validation and notification for Bicep deployments, improved tagging and resource management in Bicep templates, and minor documentation and dependency updates.

CI/CD Workflow Enhancements:

  • Added a new processor_tests job to .github/workflows/test.yml to run tests and coverage for the src/processor service, mirroring the backend API test process. This includes coverage threshold enforcement, test file detection, and automated coverage reporting. [1] [2] [3]
  • Updated the backend API test job to install pytest-asyncio, enforce a minimum coverage threshold, and prefix coverage XML filenames for better reporting. [1] [2] [3]

Infrastructure Automation and Bicep Improvements:

  • Enhanced the Bicep parameter validation workflow to generate and use an HTML email body for notifications, include additional environment variables, and attach new artifacts for improved notification formatting and clarity. [1] [2] [3]
  • Updated Bicep modules and templates (infra/main.bicep, infra/main_custom.bicep, infra/main.json, etc.) to propagate tags more comprehensively to resources, update role definition comments, and ensure correct dependency ordering in generated ARM templates. [1] [2] [3] [4] [5] [6] [7]
  • Updated Bicep module generator metadata to reflect the latest Bicep CLI version. [1] [2] [3] [4]

Other Notable Changes:

  • Added Bicep CLI to the list of required tools in the deployment documentation.
  • Updated role definition comments from "Azure AI User" to "Foundry User" for clarity. [1] [2] [3]
  • Removed the unused enableAnalyticalStorage parameter from the Cosmos DB Bicep module.
  • Clarified a comment in the Python parameter parsing script for better maintainability.

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

VishalS-Microsoft and others added 30 commits April 29, 2026 12:18
Co-authored-by: Copilot <copilot@github.com>
Adds Bicep CLI (v0.33.0+) to the local deployment prerequisites so users provisioning this accelerator locally have the required Bicep version installed before running 'azd up' / 'az deployment'.

Work item: AB#42634
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fix: fixed CodQL issues for Container Migration.
fix: Refactor code structure for improved readability and maintainability
docs: Add Bicep CLI (v0.33.0+) to local deployment prerequisites
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Only shows Coverage badge + TOTAL row + test summary in PR comment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AjitPadhi-Microsoft and others added 11 commits May 18, 2026 14:28
Address CodeQL (github-code-quality) and Copilot review comments on PR #242:

CodeQL: unused imports / variables
  - test_queue_service_internals.py: drop redundant `tp = _task_param()`
    in test_output_cleanup_refuses_broad_prefix; drop unused
    `_no_op_worker` in test_start_service_runs_and_completes.
  - test_application_base_init.py: drop unused `import inspect` and
    unused `app` local in test_init_loads_app_config_when_url_set.
  - test_agent_speaking_capture.py: drop unused `datetime`/`MagicMock`
    imports.
  - test_agent_telemetry.py: drop unused `from datetime import UTC, datetime`
    (only the literal string ` UTC` is used, not the imports).
  - test_agent_telemetry_records.py: drop unused `import pytest`.
  - test_config.py (backend SAS blob): drop unused `pytest` import and
    unused `default_config` symbol from the import list (still
    referenced via `blob_config_module.default_config`).

Copilot review: order-dependent MagicMock leak
  - test_async_helper_extra.py and test_helper_extra.py: replace
    `type(MagicMock()).__name__ = ...` mutation in `_wire_credential`
    with a dedicated dynamically-created stub class per credential type.
    Mutating `__name__` on the shared MagicMock class globally renamed
    that class for any later test that introspected `type(...)`,
    making the suite order-dependent/flaky. The new stubs scope each
    credential class name to its own type while preserving
    `hasattr(cred, 'account_key')` semantics for both account-key and
    AAD code paths.

Verification
  - Backend unit tests: 585 passing (1 unrelated environmental failure
    against example.azconfig.io), 93.28% coverage.
  - Processor unit tests: 812 passing, 87.44% coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
test: resolve PR #242 review comments (CodeQL + Copilot)
Removes ten unused imports identified by github-code-quality on
PR #242:

  - test_cosmos_checkpoint_storage.py: drop `patch`, `pytest`, and
    the unused `cosmos_checkpoint_storage as ccs` alias.
  - test_groupchat_orchestrator_internals.py: drop `AgentResponseStream`
    from the multi-symbol import.
  - test_mermaid_internals.py: drop `json` and `pytest`.
  - test_migration_processor_extras.py: drop `patch` and `pytest`.
  - test_queue_service_internals.py: drop `pytest`.
  - test_shared_config.py: drop `pytest`.

No behavioural change. All affected test files were re-run locally and
still pass (15 backend-api + 213 processor tests).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds `src/backend-api/uv.lock` and `src/processor/uv.lock` to the
`paths` filter for both `push` and `pull_request` triggers so that
dependency lockfile updates (e.g. Dependabot bumps) re-run the test
workflow. Addresses the copilot-pull-request-reviewer comment on
PR #242.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tGenerator max_tokens (Bug #43771)

Two-part fix for the Design step failure 'The model produced invalid content':

1. Add 'model produced invalid content' / 'invalid content' to the transient-error patterns recognised by _looks_like_rate_limit so that AzureOpenAIResponseClientWithRetry retries instead of failing.

2. Increase the ResultGenerator agent's max_tokens from 12_000 to 25_000 in OrchestratorBase to prevent truncation of large nested JSON schemas (the underlying cause of the 'invalid content' error).

ADO #43771

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
refactor: Updated Foundry Roles name
fix(processor): retry 'model produced invalid content' and bump Resul…
chore: resolve remaining PR #242 review feedback (unused imports + uv.lock triggers)
…05-20

chore: sync main hotfix (v2.0.4) into dev
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 merges mainline changes into the demo branch, focusing on CI coverage expansion (including src/processor), improved deployment/infra parameter validation + notifications, broader tag propagation in Bicep templates, and a large set of new unit tests across the processor and backend API.

Changes:

  • Extended GitHub Actions testing to run processor unit tests with coverage reporting and added/adjusted coverage threshold enforcement.
  • Improved infra automation: Bicep parameter validation now emits an HTML email body; Bicep templates propagate tags more consistently; ARM template regeneration updated.
  • Added substantial unit test coverage for processor and backend-api modules; updated a few runtime components to log best-effort exception paths instead of silently swallowing.

Reviewed changes

Copilot reviewed 104 out of 115 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.github/workflows/test.yml Adds processor test+coverage job and adjusts backend job coverage behavior/reporting.
.github/workflows/validate-bicep-params.yml Enhances scheduled param validation to generate HTML email artifacts and send formatted notifications.
docs/DeploymentGuide.md Documents Bicep CLI as a required tool.
infra/main.bicep Propagates tags to container apps environment and updates role comment text.
infra/main_custom.bicep Mirrors tag propagation and role comment updates for the custom template.
infra/main.parameters.json Adds tags parameter wiring for deployments.
infra/main.waf.parameters.json Adds tags parameter wiring for WAF deployments.
infra/main.json Regenerated ARM template (updated generator metadata, dependsOn ordering, and tags wiring).
infra/modules/cosmosDb.bicep Removes unused enableAnalyticalStorage param passthrough.
src/backend-api/pyproject.toml Pins/updates dependencies, adds pytest-asyncio, and coverage omit config.
src/backend-api/src/app/application.py DI registration tweak (uses class directly instead of lambda factory).
src/backend-api/src/app/libs/base/SKLogicBase.py Type improvements (Any) and overload bodies changed to pass.
src/backend-api/src/app/libs/base/fastapi_protocol.py Protocol stub method body changed to pass.
src/backend-api/src/tests/application/test_application.py Adds bootstrap coverage for backend Application wiring.
src/backend-api/src/tests/application/test_application_context_extra.py Adds more AppContext DI lifecycle tests.
src/backend-api/src/tests/application/test_dependency_injection.py Updates singleton registration test to match new DI registration pattern.
src/backend-api/src/tests/azure/test_app_configuration_helper.py Adds tests for App Configuration helper behavior.
src/backend-api/src/tests/base/test_kernel_agent.py Adds isolated tests for kernel_agent with stubs/shims.
src/backend-api/src/tests/base/test_sk_logic_base.py Adds tests for SKLogicBase import quirks and abstract contract branches.
src/backend-api/src/tests/base/test_typed_fastapi.py Adds coverage for TypedFastAPI and protocol helper utilities.
src/backend-api/src/tests/model/test_entities.py Adds model/entity default-value tests.
src/backend-api/src/tests/model/test_router_models.py Adds router model validation/serialization tests.
src/backend-api/src/tests/repositories/test_process_status_repository.py Adds tests for status rendering helpers and repository snapshot behavior.
src/backend-api/src/tests/repositories/test_repositories_extra.py Adds tests ensuring repositories set updated_at and call super.
src/backend-api/src/tests/routers/test_http_probes.py Adds tests for health/startup probe routes.
src/backend-api/src/tests/routers/test_router_debug.py Adds tests for debug config route payload.
src/backend-api/src/tests/routers/test_router_files.py Adds tests for upload route behavior, including filename sanitization.
src/backend-api/src/tests/sas/storage/blob/test_config.py Adds tests for blob storage helper configuration behavior.
src/backend-api/src/tests/sas/storage/test_shared_config.py Adds tests for shared storage config behavior.
src/backend-api/src/tests/services/test_auth.py Adds tests for header-based auth/user extraction.
src/backend-api/src/tests/services/test_implementations.py Adds tests for concrete service implementations.
src/backend-api/src/tests/services/test_input_validation.py Adds tests for UUID validation helper.
src/backend-api/src/tests/services/test_interfaces.py Adds coverage-only tests exercising ABC no-op bodies.
src/backend-api/src/tests/services/test_process_services.py Adds tests for blob/queue process service behavior.
src/backend-api/src/tests/test_app_init.py Adds trivial coverage for app package import bootstrap.
src/backend-api/src/tests/test_main.py Adds tests for main.get_app() singleton caching.
src/frontend/package.json Updates dependencies and adds overrides.
src/frontend/requirements.txt Bumps python-multipart version.
src/frontend/frontend_server.py Removes unused imports/vars in config endpoint.
src/frontend/vite.config.js Removes unused path import.
src/frontend/src/main.jsx Adjusts config fetch/fallback flow initialization.
src/frontend/src/api/utils.tsx Fixes error-file filtering logic to check > 0.
src/frontend/src/commonComponents/ProgressModal/progressModal.tsx Progress calc ordering tweak.
src/frontend/src/components/batchHistoryPanel.tsx Formatting cleanup and removes unused categorization function.
src/frontend/src/components/bottomBar.tsx Removes unused React state import.
src/frontend/src/components/uploadButton.tsx Removes unused imports and dead handler/state.
src/frontend/src/msal-auth/apiHeaders.ts Removes unused import.
src/frontend/src/pages/batchView.tsx Removes unused state and changes summary rendering conditions.
src/frontend/src/pages/landingPage.tsx Removes unused Fluent imports and unused callback code.
src/frontend/src/pages/modernizationPage.tsx Cleans unused code/state; fixes file selection matching semantics.
src/frontend/src/pages/processPage.tsx Removes unused imports/state.
src/processor/pyproject.toml Dependency bumps, adds coverage omit config, and uv overrides.
src/processor/package.json Adds package metadata and bumps mermaid; adds dompurify/lodash-es.
src/processor/src/libs/agent_framework/agent_framework_helper.py Changes overload stubs from ... to pass (coverage-related).
src/processor/src/libs/agent_framework/azure_openai_response_retry.py Retries additional transient error signal and logs best-effort stream close failures.
src/processor/src/libs/agent_framework/qdrant_memory_store.py Logs best-effort delete failures instead of silent pass.
src/processor/src/libs/base/orchestrator_base.py Increases ResultGenerator max_tokens and adds rationale comment.
src/processor/src/libs/mcp_server/datetime/mcp_datetime.py Removes unreachable returns in error branches.
src/processor/src/libs/mcp_server/mermaid/mcp_mermaid.py Clarifies JSON decode failure comment.
src/processor/src/libs/reporting/migration_report_generator.py Logs file size retrieval failures instead of silently ignoring.
src/processor/src/services/control_api.py Logs best-effort stop/cleanup failures.
src/processor/src/services/queue_service.py Replaces silent passes with debug logging in best-effort cleanup paths.
src/processor/src/steps/migration_processor.py Adds debug logs for summary generation/telemetry failures; ensures explicit return None fallback.
src/processor/src/utils/agent_telemetry.py Removes dead commented blocks; adds explicit None return; adds debug logs for swallowed exceptions.
src/processor/src/tests/conftest.py Clarifies intentional side-effect import and suppresses unused import warning.
src/processor/src/tests/unit/steps/analysis/test_analysis_executor.py Makes monkeypatching of text2art resilient to missing import.
src/processor/src/tests/unit/libs/agent_framework/test_azure_openai_response_retry_utils.py Updates tests to reflect retry/context-length behavior changes.
src/processor/src/tests/unit/** (multiple new files) Adds broad unit test coverage across utils, orchestrators, DI/context, reporting, and agent framework helpers.
Files not reviewed (2)
  • src/frontend/package-lock.json: Language not supported
  • src/processor/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)

src/frontend/src/pages/batchView.tsx:573

  • batchSummary is typed as BatchSummary | null, but this branch now runs without checking that batchSummary is non-null and immediately accesses batchSummary.error_count. This can throw during initial render/loading. Restore the null guard (e.g., if (selectedFile.id === "summary" && batchSummary)) or use optional chaining/defaults before reading fields.

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

"value": "${AZURE_ENV_IMAGE_TAG}"
},
"tags": {
"value": "${AZURE_ENV_TAGS}"
"value": "${AZURE_ENV_VM_SIZE}"
},
"tags": {
"value": "${AZURE_ENV_TAGS}"
Comment thread src/frontend/src/components/bottomBar.tsx
Comment thread .github/workflows/test.yml
Comment thread .github/workflows/test.yml
@Shreyas-Microsoft Shreyas-Microsoft marked this pull request as ready for review May 26, 2026 09:28
@Roopan-Microsoft Roopan-Microsoft closed this pull request by merging all changes into demo in cf776ed May 26, 2026
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.

10 participants