chore: Dev merge to Main#242
Open
Shreyas-Microsoft wants to merge 35 commits into
Open
Conversation
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>
Generate a text-format summary with only the TOTAL line from coverage.xml. Use pytest-coverage-path instead of pytest-xml-coverage-path so the Coverage Report dropdown shows only TOTAL row without per-file listing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix test_returns_false_for_none to call is_valid_uuid directly - Fix inaccurate comment about non-existent env file path - Make test_get_service_status_not_initialized deterministic with mock - Exclude test files from processor coverage (tool.coverage.run.omit) - Regenerate uv.lock with pytest-asyncio Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use pytest-xml-coverage-path with coverage-path-prefix so the action correctly resolves XML paths (relative to subdir) against PR diff paths. Combined with report-only-changed-files: true, when no source files are in the diff this shows: badge + Coverage Report dropdown with TOTAL row + 'No files were changed' note + test summary table. Matches the format used in Multi-Agent-Custom-Automation-Engine PR #961. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Processor: 75% -> 87.44% (+199 tests across 5 files) - queue_service.py: 35% -> 86% - groupchat_orchestrator.py: 25% -> ~70%+ (helpers fully covered) - mcp_mermaid.py: 52% -> 99% - application_base.py: 0% -> 100% - main.py: 0% -> 94% Backend-api: 82.27% -> 93.28% (+125 tests across 7 files) - SKLogicBase.py: 0% -> 93% - blob/helper.py: 68% -> 99% - blob/async_helper.py: 72% -> 97% - blob/config.py: 70% -> 100% - shared_config.py: 67% -> 100% - services/interfaces.py: 74% -> 100% - file_repository.py / process_repository.py: 67% -> 100% CI: add --cov-fail-under=82 to both backend and processor jobs in .github/workflows/test.yml so the pipeline fails when coverage drops below 82%. Backend pyproject.toml: add [tool.coverage.run] omit list for parity with processor so local pytest runs (which use pytest.ini's --cov=src) do not inflate coverage with test-file lines. No production code modified, no coverage exclusions added beyond the test directory, all 1077 prior + new tests pass on both services. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve unresolved Copilot review threads on PR #211, scoped strictly to test files and CI workflow config (no production source changes per reviewer-imposed scope). Test fixes: - src/processor/src/tests/unit/libs/agent_framework/test_agent_speaking_capture.py Remove dead-code branch from `_run` helper (`...if False else asyncio.run`) and simplify to a single `asyncio.run(coro)` call. - src/processor/src/tests/unit/utils/test_credential_util.py Replace `cred.__class__.__name__ = "AzureCliCredential"` mutation on a MagicMock (which leaks the mutated class name globally and can affect other tests) with an instance of a small dummy class named `AzureCliCredential` defined inside the test. - src/backend-api/src/tests/base/test_kernel_agent.py Expand the rationale comment around the `SKBaseModel` test-only shim, drop any pre-cached `libs.base.kernel_agent` module from sys.modules so the shim is picked up on first import, and document that fixing the empty `libs/base/SKBase.py` source file is intentionally out of scope for this PR (the file and `kernel_agent.py` are orphan modules with no production importers, so the missing symbol does not surface at runtime today). Workflow alignment (.github/workflows/test.yml): - actions/checkout@v5 -> @v4 (matches every other workflow in the repo) - actions/setup-python@v6 -> @v5 (matches pylint.yml, validate-bicep-params.yml) False positives (replied on the threads, not changed): - Coverage-XML filename rewrite for both jobs is correct as-is. coverage.py emits filenames relative to the `--cov=PATH` source root, not the cwd: backend XML uses paths like `libs/base/kernel_agent.py` (relative to src/app), processor XML uses `libs/__init__.py` (relative to src), so prefixing with `src/backend-api/src/app/` and `src/processor/src/` respectively produces correct repo-root paths with no duplication. Verification: - backend-api: 588 tests passing, 93.28% coverage (gate 82%). - processor: 812 tests passing, 87.44% coverage (gate 82%). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- test_migration_processor_extras.py: replace MagicMock() + `del obj.dict` with a small dummy class exposing only `model_dump` so the v2 branch is exercised without depending on Mock's deletion semantics. - test_sk_logic_base.py: capture the original `libs.base.SKBase.SKBaseModel` before patching with our extra-allow stub and restore it in `teardown_module` so the patch no longer leaks across test modules. Both fixes are confined to test files. Coverage remains above the 82% gate (backend 93.28%, processor 87.44%). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the missing second blank line after `teardown_module` so the next module-level `import` statement satisfies E305 (expected 2 blank lines after class or function definition). Caught by the repo's flake8 job. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…lib, mermaid, uuid) - urllib3: 2.6.3 → 2.7.0 (High - header forwarding & decompression-bomb bypass) - python-multipart: 0.0.26/0.0.22 → 0.0.27 (High - DoS via unbounded headers) - authlib: 1.7.0 → 1.7.2 (Medium - OIDC open redirect) - mermaid: 11.13.0/11.14.0 → 11.15.0 (Medium - CSS/HTML injection) - uuid: 11.0.x → 11.1.1+ (Medium - buffer bounds check) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
test: Add unit tests for backend-api
The previous commit accidentally regenerated infra/main.json with bicep 0.42.1 because the local CLI was out of date. Re-built with bicep 0.43.8.12551 to match the version on main while keeping the cosmos enableAnalyticalStorage fix intact. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…torage fix: remove enableAnalyticalStorage on Cosmos DB account creation
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 68 out of 79 changed files in this pull request and generated 2 comments.
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 (2)
.github/workflows/test.yml:29
- Same as the push trigger:
pull_request.pathsshould includesrc/backend-api/uv.lockandsrc/processor/uv.lockso dependency-only changes still execute the test workflow.
- 'src/backend-api/**/*.py'
- 'src/backend-api/pyproject.toml'
- 'src/backend-api/pytest.ini'
- 'src/processor/**/*.py'
- 'src/processor/pyproject.toml'
.github/workflows/test.yml:132
- Same issue as the backend job:
pip install -e .will likely fail forsrc/processorbecause itspyproject.tomlalso lacks[build-system]and there’s nosetup.py. Useuv sync --frozen(as in the processor Dockerfile) or add a build backend to make editable installs valid.
run: |
python -m pip install --upgrade pip
cd src/processor
pip install -e .
pip install pytest pytest-cov pytest-asyncio
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>
4 tasks
refactor: Updated Foundry Roles name
chore: resolve remaining PR #242 review feedback (unused imports + uv.lock triggers)
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 70 out of 81 changed files in this pull request and generated 1 comment.
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)
.github/workflows/test.yml:174
- Same issue in the processor coverage XML rewrite: if coverage filenames are already
src/...(expected with--cov=srcwhen running fromsrc/processor), prefixing withsrc/processor/src/yieldssrc/processor/src/src/.... Prefer prefixing withsrc/processor/for filenames that already begin withsrc/, and reservesrc/processor/src/only for bare module-relative filenames.
python <<'PY'
import xml.etree.ElementTree as ET
path = "src/processor/reports/coverage.xml"
prefix = "src/processor/src/"
tree = ET.parse(path)
root = tree.getroot()
for cls in root.iter("class"):
fname = cls.attrib.get("filename", "")
if fname and not fname.startswith(prefix):
cls.attrib["filename"] = prefix + fname
tree.write(path, xml_declaration=True, encoding="utf-8")
…05-20 chore: sync main hotfix (v2.0.4) into dev
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request expands and improves the testing and CI infrastructure for both the backend API and the new processor component. It introduces new tests, updates dependencies, and enhances the GitHub Actions workflow to provide better coverage reporting and support for asynchronous tests.
CI/CD Workflow Improvements:
src/processor/**/*.pyandsrc/processor/pyproject.tomlto the paths that trigger the test workflow, ensuring processor code changes are properly tested. [1] [2]processor_testsjob in.github/workflows/test.ymlto run tests and coverage for the processor, including logic to skip tests if no test files are found.actions/checkoutandactions/setup-pythonto v4 and v5 respectively for improved stability and compatibility.pytest-asyncioto support async tests, and ensured it's included in both backend and processor test environments. [1] [2]--cov-fail-under=82) and logic to prefix coverage XML filenames with repo-root paths for more accurate reporting in both backend and processor jobs. [1] [2]Testing Enhancements:
test_application.py: Verifies application bootstrap, service registration, and router inclusion.test_application_context_extra.py: Thoroughly tests service lifetimes, async/sync service registration, scoping, and shutdown logic in the application context.test_app_configuration_helper.py: Tests Azure App Configuration helper initialization, environment variable population, and client delegation.Backend and Infra Configuration:
pytest-asyncioand configured coverage to omit test files from reports.infra/main.jsonand reordered dependencies for private DNS zones for clarity. [1] [2]enableAnalyticalStorage: truefrom Cosmos DB Bicep module to align with new requirements or defaults.These changes collectively improve code quality, test coverage, and reliability of the CI pipeline for both backend and processor components.
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information