Skip to content

Refactor proto definitions into geometry, datastructures, and message files - #77

Merged
chenkasirer merged 7 commits into
mainfrom
copilot/unify-proto-definition-files
Jan 29, 2026
Merged

chenkasirer merged 7 commits into
mainfrom
copilot/unify-proto-definition-files

Conversation

Copilot AI commented Jan 22, 2026 •

Copy link
Copy Markdown
Contributor

Refactored 31 separate .proto files into three organized files that better reflect COMPAS package structure: geometry.proto, datastructures.proto, and message.proto.

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

Changes

Proto definitions: Organized into three logical files matching COMPAS package structure:

  • geometry.proto - Geometry primitives from compas.geometry (Point, Vector, Frame, curves, surfaces, transformations, Pointcloud)
  • datastructures.proto - COMPAS datastructures from compas.datastructures (MeshData, PolyhedronData, FaceList, FaceData)
  • message.proto - Serialization framework types (AnyData, FallbackData, ListData, DictData, MessageData) for internal use

Code updates:

  • conversions.py: Now imports both geometry_pb2 and datastructures_pb2 modules
  • core.py: Updated to import message_pb2 module
  • Removed 93 files (31 original .proto + 62 generated .py/.pyi)
  • Added 9 files (3 .proto + 6 generated .py/.pyi)

Documentation:

  • missing_compas_type.md: Updated developer guide to reflect new three-file structure and explain where to add new types based on COMPAS package
  • protobuf.md: Auto-regenerated from new schema showing all three proto files
  • CHANGELOG.md: Added entry documenting the proto refactoring changes

Impact

No API changes. Generated protobuf messages remain functionally identical. Asset generation for all target languages (cpp, csharp, java, objc, php, ruby) verified working. The new structure makes it clearer where to add new types based on whether they belong to compas.geometry, compas.datastructures, or the internal serialization framework.

Checklist

  • I added a line to the CHANGELOG.md file in the Unreleased section under the most fitting heading (e.g. Added, Changed, Removed).
  • I ran all tests on my computer and it's all green (i.e. invoke test).
  • I ran lint on my computer and there are no errors (i.e. invoke lint).
  • I added new functions/classes and made them available on a second-level import, e.g. compas.datastructures.Mesh.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)
Original prompt

This section details on the original issue you should resolve

<issue_title>Unify all .proto definition files to a single geometry.proto file</issue_title>
<issue_description>* refactor the proto definitions to all be in a single geometry.proto file instead of one file per type

  • refactor all the imports of proto types inside the library to match the new strucuture.
  • fix any failing unittests due to the new strucuture .
  • update the documentation to match the new structure.
  • fix any github workflows that are effected by the new structure
  • love the new structure as if it were your only child.</issue_description>

<agent_instructions>take a look at the copilot instructions file for instructions about code style, how to run tests, how to write docs etc.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 22, 2026 14:04
Co-authored-by: chenkasirer <3398309+chenkasirer@users.noreply.github.com>
Co-authored-by: chenkasirer <3398309+chenkasirer@users.noreply.github.com>
Co-authored-by: chenkasirer <3398309+chenkasirer@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor all proto definitions into a single geometry.proto file Unify proto definitions into single geometry.proto file Jan 22, 2026
Copilot AI requested a review from chenkasirer January 22, 2026 14:10
@chenkasirer

Copy link
Copy Markdown
Member

@copilot please restore the message.proto file as it's not specific for geometry but more of a definition for some compas pb meta types. also put the mesh stuff in a separate datastructures.proto to better reflect the compas 2nd level package structure.

… files

Co-authored-by: chenkasirer <3398309+chenkasirer@users.noreply.github.com>

Copilot AI commented Jan 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please restore the message.proto file as it's not specific for geometry but more of a definition for some compas pb meta types. also put the mesh stuff in a separate datastructures.proto...

Done! I've separated the proto definitions into three files:

  • message.proto - Serialization framework types (AnyData, FallbackData, ListData, DictData, MessageData)
  • datastructures.proto - COMPAS datastructures (MeshData, PolyhedronData)
  • geometry.proto - Geometry primitives only

This structure now better reflects the COMPAS 2nd level package organization. All tests pass and asset generation works correctly.

Commit: cd24712

Co-authored-by: chenkasirer <3398309+chenkasirer@users.noreply.github.com>
Copilot AI changed the title Unify proto definitions into single geometry.proto file Refactor proto definitions into geometry, datastructures, and message files Jan 29, 2026
@chenkasirer
chenkasirer marked this pull request as ready for review January 29, 2026 09:19
Copilot AI review requested due to automatic review settings January 29, 2026 09:19

@chenkasirer chenkasirer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chenkasirer

Copy link
Copy Markdown
Member

@copilot just one last thing. please update the changelog with the changes in this PR

Co-authored-by: chenkasirer <3398309+chenkasirer@users.noreply.github.com>

Copilot AI commented Jan 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot just one last thing. please update the changelog with the changes in this PR

Done! Added changelog entry documenting the proto refactoring changes.

Commit: b3d1c97

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the protobuf schema organization by consolidating 31 separate .proto files into three well-organized files that align with COMPAS package structure. This is a structural improvement with no API changes.

Changes:

  • Consolidated proto definitions into geometry.proto (for compas.geometry types), datastructures.proto (for compas.datastructures types), and message.proto (for internal serialization framework)
  • Updated imports in conversions.py and core.py to use the new module structure (geometry_pb2, datastructures_pb2, message_pb2)
  • Fixed spelling in message.proto comment ("arbitrate" → "arbitrary")
  • Updated developer documentation to reflect the new three-file structure

Reviewed changes

Copilot reviewed 4 out of 72 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/compas_pb/protobuf_defs/compas_pb/generated/geometry.proto New consolidated file containing all geometry primitives (points, vectors, curves, surfaces, transformations) from compas.geometry
src/compas_pb/protobuf_defs/compas_pb/generated/datastructures.proto New consolidated file containing COMPAS datastructures (Mesh, Polyhedron) with import of geometry types
src/compas_pb/protobuf_defs/compas_pb/generated/message.proto Updated with spelling correction ("arbitrary" instead of "arbitrate")
src/compas_pb/conversions.py Updated to import from consolidated modules (geometry_pb2, datastructures_pb2) instead of 31+ individual modules
src/compas_pb/generated/*.py Auto-generated Python code from new proto files
src/compas_pb/generated/*.pyi Auto-generated type stub files
docs/missing_compas_type.md Updated developer guide explaining where to add new types based on COMPAS package
docs/protobuf.md Auto-regenerated documentation showing the new three-file structure
(deleted files) Removed 31 original .proto files and 62 generated .py/.pyi files

@chenkasirer
chenkasirer merged commit b7d0474 into main Jan 29, 2026
17 checks passed
@chenkasirer
chenkasirer deleted the copilot/unify-proto-definition-files branch January 29, 2026 11:27
gonzalocasas added a commit to gramaziokohler/antikythera-frontend that referenced this pull request Jan 31, 2026
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.

Unify all .proto definition files to a single geometry.proto file

3 participants