Exercise 6.1 SysML GitHub Reference Connection

Objectives

The new learning objectives of this exercise are

  • to create a reference connection between an existing SysML element in MagicDraw and an existing element in GitHub,\

  • to use it to open the GitHub repository from the connected element in MagicDraw,

  • to compare across the connection to see whether a later version of the GitHub element is available. 

Preparation

This exercise assumes the student has

  • Cameo System Modeler 18.0 - 19.0 (or MagicDraw with SysML plug-in) installed correctly on his or her machine with a valid license for use, and

  • Syndeia 3.4 installed as a plugin for Cameo/MagicDraw with a valid license for use

  • Syndeia GitHub interface, correctly installed with a valid license for user.

  • A Github repository network connection in the Syndeia Repository Manager

The user can use any GitHub repository network connection they have available, with access to at least on Git repository, with at least one branch with one or more files and one or more commits. It is generally advisable to carry out these exercises in a non-production repository, a "sandbox", set up for training and practice purposes.

Exercise

  1. GitHub is a Git-based software configuration management system (also called application lifecycle manager or ALM). The Syndeia 3.4 interface allows the user to create a Reference Connection between a MagicDraw element and GitHub branch, commit, tag or file.

    Figure 1 Syndeia dashboard, Connection Manager tab, for creating Reference connection to Commit

  2. Open the Syndeia Tutorial Testbed.mdzip (get it here - https://intercax.atlassian.net/wiki/spaces/SYN34/pages/2407364009) model provided in MagicDraw. Open the Syndeia dashboard by right-clicking the Git Tutorial package and selecting Syndeia → Dashboard. Select a Syndeia Cloud project for the exercise, if necessary.

  3. Switch to the Connection Manager tab, open the SysML model in the left column and your GitHub repository in the right. It should be expanded to show the repositories for which you have access, and some of the projects, branches, commits, folders, files, tags, and issues. The final result should look something like Figure 1.

  4. Create a Reference connection between the SysML element Git Test Block and a commit in the Master branch of a project by selecting Reference Connection in the center panel and dragging Git Test Block onto the desired GitHub Commit (or vice versa), as shown by the arrow in Figure 1. In our example, we connect to a commit labeled 77180…

  5. Check the connection created in the Connection Browser or Connection Search tab (be sure to Refresh/Get All to see the latest). See Figure 2.

    Figure 2 Syndeia dashboard, Connection Browser tab, after completing reference connection

  6. In MagicDraw, right-click Git Test Block in the containment browser and select Syndeia → Open Connected Artifacts. This should open GitHub in your default web browser to the Commit the block has been connected to, as in Figure 3. GitHub may require you to sign in, first, before showing the Commit.

    Figure 3 GitHub web interface opened to Initial Commit via Open Connected Artifacts command

  7. The same functionality is available for creating reference connections from SysML elements to files managed in GitHub. In Figure 4, we will drag Git Test Block to the README file under Files in the Master branch under Dirk-Sandbox.

    Figure 4 Syndeia dashboard, Connection Manager tab, for creating Reference connection to file

  8. On the Syndeia dashboard, Connection Browser, refresh and see that a second connection has been created from Git Test Block, this one to a GitHub file. Right-click it and select Compare Source & Target (see Figure 5).

    Figure 5 Syndeia dashboard, Connection Browser tab, showing Sync command

  9. The Comparison Result tab should show something like Figure 6. The result is red, showing a difference. Git Test Block is connected to a file (starting 0e7a9…), which has been modified in a later commit on the Master branch. The Latest Target column points to the newest version on the same branch (starting fd4ee…). The Compare Source & Target operation in the case of a Reference connection does not look at the contents of the two models, only whether there is a later version of the same target element in a configuration-managed repository.

    Figure 6 Syndeia dashboard, Comparison Results tab, after completing Compare operation

  10. To change the Reference connection from Git Test Block to the latest version of the file on the same branch, go to the Syndeia dashboard, Connection Browser, right-click the connection from Git Test Block and select Sync SysML → Target. Now use Compare Source & Target to check that the SysML block is connected to the latest version of this file on this branch.
    Note: Compare Source & Target will not act in the same way for the connection to a GitHub Commit. Commit is not a versioned artifact; effectively it is a version of a Branch.