Skip to content

Conversation

@Aryan-SINGH-GIT
Copy link
Contributor

Fixes issue #1850 ,

Solution:
Added a mapping function that extracts a base name from protobuf-generated filenames and matches it to .proto files.
Changes:

  • New function: map_python_protobuf_files() in scanpipe/pipes/d2d.py
  • Extracts base names from *_pb2.py and *_pb3.py via regex
  • Builds an index of .proto files by base name
  • Creates CodebaseRelation with map_type="protobuf_mapping"
  • integrated into: map_python step in DeployToDevelop pipeline
  • Configuration update: Extended Python ecosystem in d2d_config.py to include .py and .pyi as matchable extensions

Tests: Added unit tests covering extraction, mapping, and edge cases
Testing:

  • Unit tests pass
  • Tested manually with the test data (6 mappings created)
image

Signed-off-by: Aryan Singh [email protected]

@Aryan-SINGH-GIT Aryan-SINGH-GIT force-pushed the improving-source-mapping-py-pyi branch 2 times, most recently from 1577741 to f6cdeb1 Compare October 27, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant