Skip to content

Integrate the Flow Analyzer engine into the Code Analyzer CLI - #2105

Open
antoinesfdc wants to merge 2 commits into
forcedotcom:devfrom
antoinesfdc:flowanalyzer-engine
Open

antoinesfdc wants to merge 2 commits into
forcedotcom:devfrom
antoinesfdc:flowanalyzer-engine

Conversation

@antoinesfdc

Copy link
Copy Markdown

Summary
Registers the new @salesforce/code-analyzer-flowanalyzer-engine in the CLI and makes it usable from the command line. The engine sends targeted Flow metadata to a Salesforce org for remote analysis. It lives in code-analyzer-core (packages/code-analyzer-flowanalyzer-engine, on the matching flowanalyzer-engine branch).
Changes
Engine registration
- package.json and package-lock.json add the code-analyzer-flowanalyzer-engine dependency.
EnginePluginsFactory adds the engine to the plugin list.
--target-org / -o flag on code-analyzer rules

  • rules previously had no org flag. Listing Flow Analyzer rules needs an authenticated org, because the catalog comes from the remote service.
  • RulesAction passes the value to the config factory as a CLI override.
  • Config override
  • CodeAnalyzerConfigFactory now applies
    -target-org to engines.flowAnalyzer.target_org as well as engines.apexguru.target_org.
  • This also covers the case where no confia file is given.
  • Help text
  • rules-command.md and run-command.md have new --target-org docs and examples.
  • The examples show listing rules, and running against specific flows by path or glob. Only targeted flows are sent to the org.
    Tests
  • Updated rules, RulesAction, CodeAnalyzerConfigFactory and EnginePluginsFactory tests cover the new flag, the override and the engine registration.
    Notes for reviewers
  • The engine dependency is a local file:../code-analyzer-core/packages/code-analyzer-flowanalyzer-engine reference. It must change to a published version before release.
  • Flow Analyzer needs a target org, from --target-org or engines.flowAnalyzer.target_org in code-analyzer.yml. Other engines ignore the flag.

Adds @salesforce/code-analyzer-flowanalyzer-engine as a dependency, registers it
in EnginePluginsFactory, and updates CodeAnalyzerConfigFactory, RulesAction and
the rules command accordingly. Updates the rules/run command messages, adds a
sample code-analyzer.yml that toggles engines, and updates the related tests.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant