forcedotcom / forcedotcom/code-analyzer

[BUG][code-analyzer] <Unexpected Flow Engine Failure on metadata retrieved using API v68>

Ouverte
#2,098 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
TypeScript
Étoiles
240
Forks
52
Merge moyen
1 j 23 h
PR mergées (30 j)
5

Description

### Have you tried to resolve this issue yourself first?

- [x] I confirm I have gone through the above steps and still have an issue to report.

### Bug Description

1. Flow metadata is retrieved using API v68.0
2. As per Winter'27 release, End Elements are stored in metadata now. [Here](https://help.salesforce.com/s/articleView?id=release-notes.rn_automate_flow_builder_end_elements_saved_to_metadata_264.htm&release=264&type=5).
3. Metadata contains tags
4. sf code analyzer execution fails with a critical warning The engine with name 'flow' threw an unexpected error: Error: ENOENT:

### Output / Logs

```shell
The engine with name 'flow' threw an unexpected error: Error: ENOENT: no such file or directory, open '.../flow/flowScannerResultsFile.json'
at async open (node:internal/fs/promises:638:25)
at async Object.readFile (node:internal/fs/promises:1242:14)
at async RunTimeFlowScannerCommandWrapper.runFlowScannerRules (.../code-analyzer-flow-engine/dist/python/FlowScannerCommandWrapper.js:52:36)
...
The engine's own debug log (sfca-flow-*.log, only written when log_folder is set) shows the actual root cause:
flow_parser.parse | CRITICAL | Variable type cannot find match for elem with tag ends
flow_parser.parse | CRITICAL | non-traversable element in flow
```

### Steps To Reproduce

1. Take a sample flow which is extracted using v68.0 API (Attached a sample)
2. Run sf code-analyzer run --workspace --rule-selector flow
3. crashes with UnexpectedEngineError as above.
4. Delete the block and the referencing it (leave the assignment's path unconnected — functionally identical, implicit end) → scan succeeds normally

Also reproduced on a real-world flow (happy to attach if useful) with two independent paths converging on a single named End element (END_ELEMENT_2) — same crash, same fix by removing the End element.

[Minimal_Test.flow-meta.xml](https://github.com/user-attachments/files/32262748/Minimal_Test.flow-meta.xml)

### Expected Behavior

The flow engine should be able to parse and analyze Flows containing explicit elements without crashing, and any per-file engine failure during a multi-file scan should be surfaced as a visible error/violation rather than silently dropped.

### Operating System

Windows 11

### Salesforce CLI Version

2.75.5

### Code Analyzer Plugin (code-analyzer) Version

5.16.0

### Node Version

_No response_

### Java Version

_No response_

### Python Version

3.12.10

### Additional Context (Screenshots, Files, etc)

_No response_

### Workaround

Extract metadata using v67.0 API

### Urgency

Moderate

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Exécutez sf code-analyzer avec le Minimal_Test.flow-meta.xml joint et le sélecteur de règles de flow pour reproduire l’échec. Lisez code-analyzer-flow-engine/dist/python/FlowScannerCommandWrapper.js et la sortie de débogage de flow_parser.parse ; c’est terminé lorsque les éléments explicites sont analysés correctement et que les échecs du moteur par fichier sont signalés lors des analyses de plusieurs fichiers.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python, typescript
Domaine
tooling
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
52/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.