NEW @W-22393691@ - ApexGuru Engine: Define Insights data model for SFAP scan metadata#468
Open
nikhil-mittal-165 wants to merge 5 commits into
Open
NEW @W-22393691@ - ApexGuru Engine: Define Insights data model for SFAP scan metadata#468nikhil-mittal-165 wants to merge 5 commits into
nikhil-mittal-165 wants to merge 5 commits into
Conversation
- Add insights?: Record<string,unknown> field to EngineRunResults type - Add test verifying insights field is optional and accepts metadata - Supports engines providing analysis metadata beyond violations - Bump all affected package versions with -SNAPSHOT suffix - Fix interdependency versions
… API contract - Add ApexGuruScanMetadata type with analysis_mode, files_scanned, violation_breakdown, violation_count, report_generated_ms fields - Add test validating type structure matches SFAP contract - Supports both 'full' and 'static' analysis modes
…n scanMetadata
- Extend ApexGuruQueryResponse type to include scanMetadata field
- Update ApexGuruService.analyzeApexClass return type to {violations, scanMetadata}
- Update pollForResults to extract scanMetadata from API response
- Update ApexGuruEngine.runRules to collect and return scanMetadata as insights
- Update all test mocks to match new return type
- Add test verifying scanMetadata extraction from API response
…interfaces - Add getInsights() method to EngineRunResults interface - Implement getInsights() in EngineRunResultsImpl, AbstractErroneousEngineRunResults, and FilteredEngineRunResults - Add getEngineInsights(engineName) method to RunResults interface - Implement getEngineInsights() in RunResultsImpl - Add comprehensive tests for both methods - Enables formatters to access engine-provided insights metadata
- Add optional insights field to JsonResultsOutput type keyed by engine name - Update toJsonResultsOutput to include insights when engines provide them - Update toSarifRun to include insights in run.properties when present - Add integration tests verifying insights flow through JSON and SARIF output
|
Git2Gus App is installed but the |
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.
Summary
Implements the Insights data model for ApexGuru SFAP scan-level metadata as specified in GUS ticket W-22393691.
Changes
code-analyzer-engine-api: Added optionalinsightsfield toEngineRunResultstype, allowing engines to return scan-level metadata alongside violations.code-analyzer-apexguru-engine:ApexGuruScanMetadatatype matching SFAP API contract (analysis_mode,files_scanned,violation_breakdown,violation_count,report_generated_ms).ApexGuruQueryResponseto includescanMetadatafield.ApexGuruService.parseReport()andanalyzeApexClass()to extract and return scan metadata from SFAP API responses.ApexGuruEngine.runRules()to populateinsightsinEngineRunResults.code-analyzer-core:getInsights()toEngineRunResultsinterface andgetEngineInsights(engineName)toRunResultsinterface.insightsobject with per-engine metadata.insightsinrun.properties.Acceptance Criteria
getInsights()/getEngineInsights()API exposed from Core results interfacesTest plan
npx jest "packages/code-analyzer-engine-api/test/results|packages/code-analyzer-apexguru-engine/test|packages/code-analyzer-core/test/results|packages/code-analyzer-core/test/output-format"— all 98 tests should passRunResults.toJsonResults()includesinsights.apexguruwith SFAP scanMetadata fieldsruns[].properties.insightscontains engine insightsEngineRunResults.insightsis optional — existing engines unaffected