Skip to content

Conversation

fernandosantos-br
Copy link
Collaborator

No description provided.

@Copilot Copilot AI review requested due to automatic review settings July 8, 2025 22:16
Copilot

This comment was marked as outdated.

@fernandosantos-br fernandosantos-br requested a review from Perdiga July 8, 2025 22:18
@Perdiga Perdiga requested a review from Copilot July 8, 2025 23:04
Copy link

@Copilot 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 adds support for scanning each first-level project in a monorepo.

  • Introduces a monorepo flag in the request entity and CLI.
  • Implements _execute_monorepo_analysis in the use case to iterate over subdirectories and aggregate results.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/codeql_wrapper/domain/use_cases/codeql_analysis_use_case.py Added execute branch and _execute_monorepo_analysis.
src/codeql_wrapper/domain/entities/codeql_analysis.py Introduced monorepo: bool field on CodeQLAnalysisRequest.
src/codeql_wrapper/cli.py Passed monorepo flag into CodeQLAnalysisRequest.
Comments suppressed due to low confidence (3)

src/codeql_wrapper/domain/entities/codeql_analysis.py:69

  • Consider updating the class docstring to mention the new monorepo parameter and its effect on analysis behavior.
    monorepo: bool = False

src/codeql_wrapper/domain/use_cases/codeql_analysis_use_case.py:54

  • Add unit tests for the _execute_monorepo_analysis method to cover cases with multiple subprojects, no detected subprojects, and failure scenarios.
    def _execute_monorepo_analysis(

src/codeql_wrapper/cli.py:201

  • Verify that the CLI parser defines a --monorepo option and sets the monorepo variable; otherwise this variable may be undefined at runtime.
            monorepo=monorepo,

all_analysis_results.extend(summary.analysis_results)
except Exception as e:
self._logger.error(f"Analysis failed for {sub_path}: {e}")

Copy link

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a monorepo subproject analysis fails, no result is added to all_analysis_results, causing the summary to underreport failures; consider appending a failure result entry for consistency.

Suggested change
failure_result = CodeQLAnalysisResult(
project_path=sub_path,
status=AnalysisStatus.FAILED,
error_message=str(e),
)
all_analysis_results.append(failure_result)

Copilot uses AI. Check for mistakes.

@Perdiga Perdiga merged commit 6648593 into main Jul 8, 2025
7 checks passed
@Perdiga Perdiga changed the title add monorepo scan Add monorepo flag (Beta) Jul 8, 2025
@fernandosantos-br fernandosantos-br deleted the develop-monorepo branch July 9, 2025 05:33
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.

3 participants