[W-22393672] Expose ApexGuru engine in CLI with --target-org flag#2051
Open
nikhil-mittal-165 wants to merge 3 commits into
Open
[W-22393672] Expose ApexGuru engine in CLI with --target-org flag#2051nikhil-mittal-165 wants to merge 3 commits into
nikhil-mittal-165 wants to merge 3 commits into
Conversation
Add --target-org/-o flag to code-analyzer run command to specify target Salesforce org for remote analysis engines like ApexGuru. Changes: - Add target-org flag to RunCommand with char 'o' - Update RunInput type to include optional target-org field - Add ApexGuru engine dependency from feature branch - Register ApexGuru engine in EnginePluginsFactory - Wire target-org through CliOverrides to engine config - Add unit tests for flag parsing and config wiring The flag value is passed to the ApexGuru engine via engine_overrides config as target_org field, following the engine's config schema.
Add E2E tests verifying --target-org and -o shorthand are accepted and parsed without errors. Tests use try-catch since ApexGuru may fail in test environment without authenticated org.
Test stubs were missing getInsights and getEngineInsights methods added to RunResults interface in core. Also disable lint warning for target-org -o shorthand which is the correct convention.
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
Integrates the ApexGuru engine into the Code Analyzer CLI. Adds a
--target-orgflag tosf code-analyzer runso users can run Apex anti-pattern analysis against an authenticated org.GUS Ticket
W-22393672 — code-analyzer | Expose ApexGuru engine in CLI with --target-org flag
Changes
--target-orgflag tosf code-analyzer runcommand (standard SF CLI org flag pattern)EnginePluginsFactory@salesforce/core)--target-orgflaggetInsightsandgetEngineInsightsDependencies
Test Evidence
sf code-analyzer runfinds 1224 violations on dreamhouseTest Status: PASS
Findings Doc
https://docs.google.com/document/d/1zNU-LaHOZIEfGDVHlk5-9MpuCucKEEAseQglyF0bDWk/edit