Skip to content

Feature/build tool connector parity#97

Closed
MatthiasBurger-Coder wants to merge 2 commits into
mainfrom
feature/build-tool-connector-parity
Closed

Feature/build tool connector parity#97
MatthiasBurger-Coder wants to merge 2 commits into
mainfrom
feature/build-tool-connector-parity

Conversation

@MatthiasBurger-Coder
Copy link
Copy Markdown
Owner

No description provided.

What:
- Add build-tool connector capability catalog and parity documentation in AGENTS.md, QUALITY.md, and README.md.
- Extend Gradle and Maven connector mappings for excludes, test source roots, Analysis Store artifacts, Joern semantic enrichment, cleanup, and reactor aggregation.
- Add shared semantic enrichment orchestration for build-tool-neutral Joern import behavior.

Why:
- Maven needed the same forensic analysis capabilities exposed by the Gradle connector.
- The quality gate now documents and verifies connector parity explicitly.

Changes:
- Update GenerationRequest and GenerateRulesUseCase to support exclude package prefixes.
- Extend BtmGenExtension, GenerateBtmTask, BtmGenMojo, and MavenBtmGenParameters mapping.
- Add Maven goals for btmgen-aggregate, analyze, analyze-aggregate, analyze-semantics, import-semantics, and clean-analysis.
- Move Gradle semantic analysis task orchestration onto the shared SemanticEnrichmentRunner.
- Add Maven reactor source-root collection with deterministic root ordering.
- Add parity, Maven Analysis Store, Joern configuration, reactor aggregation, and coverage-focused tests.

Impact:
- New Maven connector features are behavior-relevant and align Maven output with Gradle under target/forensics.
- Existing Gradle defaults remain compatible while adding excludes and includeTests configuration.
- Dependency-aware scan-cache invalidation now conservatively rebuilds the H2 cache instead of failing.

Testing:
- .\\gradlew.bat test --dependency-verification strict --console=plain --stacktrace
- .\\gradlew.bat clean test jacocoTestReport jacocoTestCoverageVerification checkPackageCoverage --dependency-verification strict --console=plain --stacktrace
- .\\gradlew.bat validatePlugins --dependency-verification strict --no-daemon --console=plain --stacktrace
- .\\gradlew.bat test --tests '*BtmGenerationAdapterValidationTest' --tests '*BuildToolConnectorParityTest' --tests '*MavenReactorAggregationTest' --tests '*HexagonRulesTest' --dependency-verification strict --console=plain --stacktrace
What:
- Extract shared Maven BTM parameter mapping into common Mojo base classes.
- Keep combined Maven analyze goals from deleting the Analysis Store before semantic enrichment.
- Centralize repeated Maven test setup for project, session, source, log, and reflection helpers.

Why:
- SonarCloud reported excessive new-code duplication on PR #96.
- The combined analyze flow must keep generated Analysis Store content available for Joern import.

Changes:
- Add AbstractBtmGenerationMojo and AbstractAggregateBtmGenerationMojo for shared Maven parameters and reactor roots.
- Refactor BtmGenMojo, BtmGenAggregateMojo, AnalyzeMojo, and AnalyzeAggregateMojo onto the shared mapping.
- Add shared analysis-store validation support and cleanup-policy regression coverage.
- Update Maven parity tests to handle inherited Mojo fields.

Impact:
- Fixes behavior where forensics:analyze and forensics:analyze-aggregate could honor DELETE_ON_SUCCESS before semantic enrichment.
- No public Gradle or Maven goal names were changed.
- No dependency, Java, Gradle, JaCoCo, or Sonar configuration changes were introduced.

Testing:
- .\gradlew.bat test --tests '*MavenAnalysisGoalsTest' --tests '*MavenReactorAggregationTest' --tests '*MavenBtmGenParametersTest' --tests '*BtmGenMojoTest' --tests '*MavenAnalysisStoreParityTest' --tests '*MavenJoernConfigurationParityTest' --dependency-verification strict --console=plain --stacktrace
- .\gradlew.bat test --tests '*BtmGenerationAdapterValidationTest' --dependency-verification strict --console=plain --stacktrace
- .\gradlew.bat clean test jacocoTestReport jacocoTestCoverageVerification checkPackageCoverage --dependency-verification strict --console=plain --stacktrace
- .\gradlew.bat validatePlugins --dependency-verification strict --no-daemon --console=plain --stacktrace
- .\gradlew.bat test --tests '*BtmGenerationAdapterValidationTest' --tests '*BuildToolConnectorParityTest' --tests '*MavenReactorAggregationTest' --tests '*HexagonRulesTest' --dependency-verification strict --console=plain --stacktrace
- .\gradlew.bat test --dependency-verification strict --console=plain --stacktrace
- .\gradlew.bat generateMavenPluginDescriptor --dependency-verification strict --console=plain --stacktrace
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 9, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
5.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 02b701913c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +83 to +85
return configuredFile == null
? Path.of(defaultPath).toAbsolutePath().normalize()
: configuredFile.toPath().toAbsolutePath().normalize();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve PATH-based Joern executable resolution

filePath currently normalizes every configured executable to an absolute filesystem path. With the documented defaults (joern, joern-parse, joern-slice), that turns command names into paths like <project>/joern, so the semantic goals invoke non-existent files instead of resolving binaries from PATH. This breaks forensics:analyze, forensics:analyze-aggregate, and forensics:analyze-semantics unless users manually provide absolute executable paths.

Useful? React with 👍 / 👎.

@MatthiasBurger-Coder MatthiasBurger-Coder deleted the feature/build-tool-connector-parity branch May 9, 2026 16:15
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.

1 participant