-
Notifications
You must be signed in to change notification settings - Fork 0
CodeQL instalation improvement, calculate optimal workers number and output project name #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/codeql_wrapper/domain/use_cases/codeql_analysis_use_case.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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 adds a new SystemResourceManager to detect available memory and calculate an adaptive worker count for CodeQL analysis, integrates manual and adaptive worker settings into the use case and CLI, and updates tests to cover the new behaviors.
- Introduce
SystemResourceManagerto measure system memory and compute optimal worker count. - Wire adaptive/manual
max_workersintoCodeQLAnalysisUseCaseand expose via CLI. - Update and simplify tests for system resource management and monorepo filtering.
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_system_resource_manager.py | New tests for memory detection and worker calculation |
| tests/test_codeql_analysis.py | Refactored CodeQL installation mocking, simplified monorepo filter test |
| src/codeql_wrapper/infrastructure/system_resource_manager.py | New class for memory and worker calculation |
| src/codeql_wrapper/domain/use_cases/codeql_analysis_use_case.py | Integrated adaptive/manual max_workers, updated executor settings |
| src/codeql_wrapper/domain/entities/codeql_analysis.py | Added max_workers field to analysis request entity |
| src/codeql_wrapper/cli.py | Added --max-workers CLI option |
| pyproject.toml | Added psutil and its typing dependency |
Comments suppressed due to low confidence (2)
tests/test_codeql_analysis.py:893
- The variable
requestis not defined in this test, causing aNameError. You should create or import a validCodeQLAnalysisRequestinstance before usingrequest.repository_path.
for p in request.repository_path.iterdir()
tests/test_codeql_analysis.py:878
mock_iterdirisn’t configured to return the mocked directories, soiterdir()won’t yield yourmock_hidden_dirandmock_regular_dir. Addmock_iterdir.return_value = [mock_hidden_dir, mock_regular_dir]before running the list comprehension.
) as mock_exists, patch("pathlib.Path.is_dir") as mock_is_dir:
CodeQL instalation improvement, calculate optimal workers number and output project name