Repository navigation
fix: support API v68 <ends> elements in the Flow engine - #515
nikhil-mittal-165 wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Git2Gus App is installed but the |
|
Self-review using the refreshed Code Analyzer regression-review skill. Finding[P2] Preserve non-ENOENT results-file read failures The new catch converts every Manual validation before mergeRequired:
Recommended:
Evidence checked: linked issue #2098, parser/control-flow call paths, changed tests, packaged wrapper path, and green Linux/macOS/Windows CI. The functional run in the PR description is author-supplied evidence, not independently reproduced here. |
Previously every readFile failure on the results file was reported as "the Flow Scanner did not produce a results file". Now only ENOENT gets that message; any other failure (permissions, directory, etc.) is reported with a new ResultsFileNotReadable message and keeps the original error as the cause. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Addressed the P2 finding in ef8a7f5: only 🤖 Generated with Claude Code |
API v68 flows can declare <runInMode>UserMode</runInMode>, which was missing from the RunMode enum, so RunMode[...] raised KeyError and the scan crashed (even for flows with no <ends> element). Add UserMode (treated like DefaultMode, i.e. user context), and make unrecognized runInMode values log a warning and fall back to DefaultMode instead of crashing the whole scan. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Also fixes the second API v68 crash reported alongside this issue:
🤖 Generated with Claude Code |
Summary
Triage of code-analyzer issue 2098: the Flow engine crashes on flows retrieved with API v68.0, which now store End elements as top-level
<ends>tags (Winter '27).Root Cause
The Flow engine's Python parser does not recognize the API v68 top-level
<ends>element.endsis missing fromCTRL_FLOW_ELEMinpublic/parse_utils.py, so connectors that target an End element are reported as "non-traversable". The element-type switch inflow_parser/parse.pyalso has noendsbranch, so it logs "Variable type cannot find match ... with tag ends". The flow scan then exits without writingflowScannerResultsFile.json, andFlowScannerCommandWrapper.tsthrows a rawENOENTthat surfaces as an unexpected engine error.Fix
endsas a control-flow element inparse_utils.pyand handle it inparse.py.test_parse_utils.py.messages.ts) instead of a rawENOENT.Testing
<ends>element, run throughbin/run.js code-analyzer run --rule-selector flow:UnexpectedEngineError(ENOENT flowScannerResultsFile.json), bug reproduced.Found 4 violation(s) across 1 file(s)(flow:MissingDescription), no engine error.Files Changed
packages/code-analyzer-flow-engine/FlowScanner/public/parse_utils.pypackages/code-analyzer-flow-engine/FlowScanner/flow_parser/parse.pypackages/code-analyzer-flow-engine/FlowScanner/tests/test_parse_utils.pypackages/code-analyzer-flow-engine/src/messages.tspackages/code-analyzer-flow-engine/src/python/FlowScannerCommandWrapper.ts