Skip to content

Recognize user-defined types in 'type:' attribute definition#3432

Merged
ipspace merged 3 commits into
devfrom
udt-in-type
Jun 4, 2026
Merged

Recognize user-defined types in 'type:' attribute definition#3432
ipspace merged 3 commits into
devfrom
udt-in-type

Conversation

@ipspace
Copy link
Copy Markdown
Owner

@ipspace ipspace commented Jun 3, 2026

Fixes the original complaint from #3431

Also:

  • Update documentation
  • Explain how to create new boxes in AGENTS.md
  • Add a code coverage test

Fixes the original complaint from #3431

Also:
* Update documentation
* Explain how to create new boxes in AGENTS.md
* Add a code coverage test
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Extends the topology data validator to resolve and merge user-defined data types when they are referenced via a type: key inside a dictionary-based type definition (addressing #3431), and updates related documentation and coverage tests.

Changes:

  • Resolve user-defined types referenced in type: inside Box/dict type definitions by merging the referenced user type definition into the local type definition.
  • Update developer validation documentation to describe the new merging behavior and remove outdated “won’t work” guidance.
  • Add a coverage test (YAML + expected log) and update AGENTS.md guidance on creating Box objects correctly.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/coverage/errors/user-data-types.yml New coverage topology exercising user-defined types in type: and related error cases
tests/coverage/errors/user-data-types.log Expected error output for the new coverage topology
netsim/data/validate.py Implements user-defined type resolution/merge when type: references a user-defined type
docs/dev/validation.md Updates validation docs to mention user-defined types and type:-merge behavior
AGENTS.md Adds guidance to use data.get_box() / data.get_empty_box() when creating Box objects

Comment thread netsim/data/validate.py
Comment thread docs/dev/validation.md
@ipspace ipspace requested a review from jbemmel June 3, 2026 06:15
Comment thread tests/coverage/errors/user-data-types.yml
Copy link
Copy Markdown
Collaborator

@jbemmel jbemmel left a comment

Choose a reason for hiding this comment

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

Minor inconsistency in the test comment

Would be nice if user defined types could be used in _alt_types, rather than documenting you can't - is that hard to add?

@ipspace
Copy link
Copy Markdown
Owner Author

ipspace commented Jun 4, 2026

Would be nice if user defined types could be used in _alt_types, rather than documenting you can't - is that hard to add?

Coming in a few minutes ;)

@ipspace ipspace merged commit 4611c54 into dev Jun 4, 2026
13 checks passed
@ipspace ipspace deleted the udt-in-type branch June 4, 2026 05:16
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.

3 participants