Skip to content

Conversation

@Perdiga
Copy link
Collaborator

@Perdiga Perdiga commented Jul 9, 2025

No description provided.

Perdiga added 2 commits July 8, 2025 22:56
…dling

- Added input validation for repository paths in CodeQLAnalysisUseCase.
- Improved error messages for invalid SARIF file uploads in SarifUploadUseCase.
- Updated CodeQLInstaller to validate installation directory.
- Refactored CodeQLRunner to include customizable command timeout.
- Documented DirectoryManager's current test-only status.
- Added is_git_repository method to GitUtils for repository checks.
- Cleaned up LanguageDetector by removing redundant methods.
- Fixed logger documentation to accurately reflect application context.
…er, and logging

- Updated `TestCodeQLAnalysisUseCase` to improve path validation and exception handling during execution.
- Added tests for handling empty directories and hidden directories in monorepo analysis.
- Enhanced `TestCodeQLInstaller` with additional checks for installation status and version retrieval.
- Refined `TestCodeQLRunner` to include timeout handling and improved database analysis tests.
- Improved `TestDirectoryManager` to handle Git command errors and ensure proper initialization state.
- Expanded `TestGitUtils` to gracefully handle invalid paths and subprocess exceptions.
- Cleaned up `TestLanguageDetector` by removing redundant tests and focusing on essential functionality.
- Added comprehensive tests for `SarifUploadUseCase`, including request validation and upload failure handling.
- Introduced a new test suite for the logger infrastructure, ensuring proper logging behavior and configuration.
Copilot AI review requested due to automatic review settings July 9, 2025 15:08
@Perdiga Perdiga changed the title Improve Tests Improve Tests and code base Jul 9, 2025
Copy link

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 enhances test coverage and refines core infrastructure for more robust validation, error handling, and configurability.

  • Adds missing-field and error-path validation tests for SARIF uploads
  • Refactors code to remove deprecated methods, enforce timeouts, and reorganize private/public methods
  • Updates CoreCLI runner and installer with configurable timeouts and stricter input validation

Reviewed Changes

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

Show a summary per file
File Description
tests/test_sarif_upload_use_case.py Added tests for missing fields and invalid SARIF file handling
src/codeql_wrapper/domain/use_cases/sarif_upload_use_case.py Introduced request validation and timeout handling for uploads
src/codeql_wrapper/infrastructure/codeql_runner.py Made _run_command private, added timeout parameter and use
tests/test_codeql_analysis.py Expanded tests for request validation and exception flows
src/codeql_wrapper/infrastructure/logger.py Updated module docstring to reflect CodeQL wrapper context

@Perdiga Perdiga merged commit 99c7cf5 into main Jul 9, 2025
7 checks passed
@fernandosantos-br fernandosantos-br deleted the develop-clean-code branch July 21, 2025 21:46
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.

2 participants