uipath-python icon indicating copy to clipboard operation
uipath-python copied to clipboard

[DX] GAP-15: Auto-generated .mermaid files have no explanation and are mistaken for debug artifacts

Open AlexBizon opened this issue 8 months ago • 1 comments

Summary

uipath init generates one .mermaid file per function containing a static call graph. These files are ~550 lines each, not explained anywhere, and can be mistaken for error output or debug artifacts. There is no indication they are intentional generated metadata.

Root Cause

uipath init uses Python's ast module (graph_builder.py) to build a static call graph for each function and writes it as a .mermaid file. The intended purpose is debugging/visualization within the UiPath platform.

There is no:

  • Comment or header in the generated files explaining what they are
  • Documentation mentioning that these files are generated
  • Indication that they are auto-regenerated on every uipath init and should not be manually edited

What the Files Look Like

# check_vendor_risk.mermaid (551 lines)
flowchart TB
  vendor.py:52(check_vendor_risk)
  vendor.py:110(_resolve_instance_url)
  vendor.py:52 --> vendor.py:110
  ...

Note: the generated Mermaid syntax is also invalid — . and : in node IDs are special characters in Mermaid's flowchart syntax, causing these diagrams to fail in all standard Mermaid viewers (see GAP-17).

Suggested Fix

  1. Add an auto-generated header comment to each .mermaid file:
    # AUTO-GENERATED by uipath init — do not edit manually
    # This file contains a static call graph for use by UiPath platform tooling.
    # Re-generated on every 'uipath init' run.
    
  2. Add *.mermaid to the .gitignore generated by uipath init (or document that these files should be gitignored).
  3. Mention the files in the uipath init output: Generated call graph: check_vendor_risk.mermaid
  4. If these files are not consumed by any UiPath tooling, consider not generating them at all.

Impact

  • Severity: Low (confusion/noise)
  • Developers who encounter these files for the first time have no idea what they are or whether they should be committed to git

AlexBizon avatar Mar 26 '26 15:03 AlexBizon

hi @AlexBizon

the mermaid diagram is visible in Orchestrator UI (grouped by entrypoint), so this file should exist in the project and ideally be versioned.

Image

We'll add some clarifying comments at the begining of the file

radu-mocanu avatar Apr 21 '26 07:04 radu-mocanu