Repository navigation
fix(migrate): an untyped property follows its tool's kind marker; unmarked, it is an attribute, or a part when composite - #1035
Merged
Conversation
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…arked, it is an attribute, or a part when composite Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…stead of crashing Co-Authored-By: jason.han <hanhuijun@gmail.com>
…he part inherits by redefinition, subsetting or name Co-Authored-By: jason.han <hanhuijun@gmail.com>
… the part inherits by redefinition, subsetting or name Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ty-kind Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/sysml-v1-transformation-census-baseline.json # docs/project/sysml-v1-transformation-census.md
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The SysML v1 migrator wrote every property without a type as
ref x;(featureKeywordreturnedrefwhenevert == nil). That ignored MagicDraw's property-kind markers — a «ValueProperty» with no type came out asref x { /* applied stereotype «ValueProperty» */ }, the marker written as an applied stereotype because the generated keyword did not represent it — and it made plain classes whose attributes carry no type (afilename, acapture date) look like reference parts in a Cameo/CATIA model browser.An untyped property is now written by
untypedKeyword:attribute, «PartProperty»part, «SharedProperty»/«ReferenceProperty»ref, «ConstraintProperty»constraint— with the marker omitted, as it already is on typed properties (markedPropertyKindandisPropertyKindMarkershare onepropertyKindMarkerreading);reftyped by its default individual, as before;partwhen its aggregation is composite and anattributeotherwise, each reported approximated with a note saying so.Typed properties are unchanged.
Specification basis
OMG SysML v1 to v2 Transformation mapping model,
PropertyUntyped_Mapping(UML4SysML::Classification), which maps an untyped property to aReferenceUsage. This change deliberately departs from it, so the census row moves from faithful to approximate with the reason recorded indocs/project/sysml-v1-transformation-census-baseline.json;docs/reference/sysml-v1-migration.mdgains the two rows (marked / unmarked untyped property).How it was verified
tests/migrate/testdata/xmi/property_markers.xmigains seven untyped properties (one per marker, one unmarked scalar, one unmarked composite);TestPropertyKindMarkersAreNotWrittenpinsattribute load;,part trailer;,ref depot;,ref driver;,constraint rule;,attribute color;,part chassis;, the marked ones mapped and the unmarked ones approximated with their notes, and that no marker is written as a stereotype.TestUntypedPropertiesAreAttributesInAndOutsideConstraintDefinitions(renamed) and the existing individual-default tests (ref angles : usual;kept) pin the unmarked and individual paths; expectations inrelations_test.go,behavior_members_internal_test.goanddiagrams_internal_test.gothat encoded the oldrefmoved toattribute; goldens forproperty_markers,collectorsandtool_profilesregenerated and reviewed.go build ./...,go vet ./...,gofmt -l .(empty),go test ./...green;go run -C tools ./cmd/transformation-census -checkandpython3 scripts/changelog.py checkpass.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/dbff7ccc1454416fb497412e51cf5513
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/dbff7ccc1454416fb497412e51cf5513?variant=devin
Requested by: @HuiJun