Skip to content

chore(build): add mtconnect_sysml_model as a submodule#162

Draft
ottobolyos wants to merge 1 commit into
TrakHound:masterfrom
ottobolyos:chore/sysml-model-submodule
Draft

chore(build): add mtconnect_sysml_model as a submodule#162
ottobolyos wants to merge 1 commit into
TrakHound:masterfrom
ottobolyos:chore/sysml-model-submodule

Conversation

@ottobolyos
Copy link
Copy Markdown
Contributor

Summary

Add mtconnect_sysml_model as a tracked git submodule at build/sysml-model, pinned to tag v2.7. The submodule replaces the prior documented-but-untracked external clone pattern (where contributors had to git clone https://github.com/mtconnect/mtconnect_sysml_model.git to some out-of-tree path and pass --xmi manually to MTConnect.NET-SysML-Import).

Why

The regen pipeline that builds Devices/Components/*.g.cs, Devices/DataItems/*.g.cs, the asset / events / samples / conditions hierarchies, and the organizer lists needs a pinned XMI source so the output is reproducible. A submodule makes the version explicit in-tree and ties commit history of regenerated code to a specific upstream model commit.

What changed

  • .gitmodules — new entry registering build/sysml-model against https://github.com/mtconnect/mtconnect_sysml_model.git.
  • build/sysml-model — submodule pointer at tag v2.7 (commit 25796ac59).
  • build/MTConnect.NET-SysML-Import/README.md — regen recipe rewritten to reference the in-tree submodule path; the legacy git clone … /tmp/mtconnect-sysml recipe is retained as an ad-hoc fallback for one-off regens against an unpinned commit.

Bumping the pinned model version

git -C build/sysml-model fetch --tags
git -C build/sysml-model checkout v2.8     # or later
git add build/sysml-model
git commit -m "chore(build): bump SysML model submodule to v2.8"

Then regen against the new tip and commit the .g.cs changes in a follow-up commit. Older versions (v2.5, v2.6, v2.0) work the same way for backports.

Worktree usage

The commit body includes a longer note on git worktree interactions: in short, the submodule's gitdir lives under the primary repo's .git/modules/build/sysml-model/, so per-worktree checkouts must each run git submodule update --init build/sysml-model once, and multi-version parallel regen can use git -C build/sysml-model worktree add … to spin a sibling working tree without disturbing the primary checkout.

Test plan

  • git submodule update --init build/sysml-model populates the path.
  • MTConnect.NET-SysML-Import consumes --xmi build/sysml-model/MTConnectSysMLModel.xml cleanly.
  • Regen output diff against current *.g.cs is whitespace + four v2.6 / v2.7 components losing the spurious Name back-fill — verified separately on fix/issue-136-137 (PR fix(common): drop default values from Device and Component constructors #148).
  • CI clones the submodule on checkout (workflow update lands with the first PR that depends on the submodule path).

🤖 Generated with Claude Code

…-model

Pins the SysML XMI source of truth as a tracked submodule rather than a
documented-but-untracked external clone. The submodule's default tip
tracks `v2.7` (the latest published spec version); switching to a prior
version is `git -C build/sysml-model checkout v2.5` (or `v2.6`, `v2.0`,
etc.) followed by a regen.

Worktree usage:

* In the main checkout: `git submodule update --init build/sysml-model`
  once after pulling, then the path is populated and the importer can
  consume `--xmi build/sysml-model/MTConnectSysMLModel.xml` directly.
* In a `git worktree`-created tree: the submodule must be initialised
  per-worktree (`git -C <worktree> submodule update --init
  build/sysml-model`). The submodule's own `.git` lives under the
  primary repository's `.git/modules/build/sysml-model/`; per-worktree
  trees share the gitdir and only differ in their working-tree
  checkout.
* For multi-version regen in parallel: the submodule's gitdir is
  shared, so `git -C build/sysml-model worktree add /tmp/sysml-v2.6
  v2.6` creates a v2.6 working tree without disturbing the primary
  v2.7 checkout. The importer can then be pointed at
  `/tmp/sysml-v2.6/MTConnectSysMLModel.xml` while the main tree
  retains the v2.7 model.

Updated `build/MTConnect.NET-SysML-Import/README.md` regen recipe to
reference the submodule path; the prior recipe instructed contributors
to clone the model into `/tmp/mtconnect-sysml` which is now replaced
by the in-tree submodule. The clone option remains documented as the
fallback for ad-hoc one-off regens against an unpinned commit.
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