Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • A AF3
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 229
    • Issues 229
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • af3
  • AF3
  • Issues
  • #2845
Closed
Open
Created Dec 05, 2020 by Simon Barner@barnerOwner

Copy/paste between projects may break cross-references

Steps to reproduce (see attached model!):

  • Create source model in a new project Source
    • Create Component Architecture CA with one Component C
    • Create Platform Architecture PA with one Execution Unit E
    • Create Deployment D that maps C to E
  • Create an empty Target project
  • Save all projects
  • Perform non-atomic copy operation
    • Copy CA from Source to Target
    • Copy PA from Source to Target
    • Copy D from from Source to Target
  • Observe (e.g., by opening Target model in a text editor), that the ComponentAllocation in the deployment contained in Target erroneously references C and E contained in Source (Source.af3_23#10 in below example!)
 <rootElements xsi:type="org-fortiss-af3-deployment:Deployment" xmi:id="24" id="24" name="Deployment">
    <componentArchitectureReference/>
    <platformArchitectureReference/>
    <componentAllocations xmi:id="25" id="25">
      <layoutData xsi:type="org-fortiss-tooling-base-model-layout:Points" key="points"/>
      <component href="Source.af3_23#10"/>
      <executionUnit href="Source.af3_23#20"/>
    </componentAllocations>

Analysis:

  • If all three artifacts (CA, PA and Deployment) are copied atomically at once, the resulting Deployment in Target is valid (i.e., it does not reference an model element in Source
  • The current logic (presumably the deployment’s compositors) prevents to copy the deployment to Target in case it does not contain both a Component Architecture and Platform Architecture. However, it does not check if the the CA and/or the PA contained in the target match the Deployment to be copied (which would be very difficult if not impossible to implement)
  • #877 first introduced cross-project copy-and-paste

Proposed fix:

  • If a top-level element to be copied contains references (here: Deployment) to model elements contained in other top-level elements (here: CA, PA), enable the copy operation only if the top-level elements containing all referenced model elements are copied in the same copy operation

Work-around:

  • Copy all top-level elements that you indent to copy from one model to another in one operation. This will ensure that cross-references in the copy point to model elements in the copy (as expected).

(from redmine: issue id 2845, created on 2017-02-17, closed on 2018-06-12)

  • Relations:
    • relates #2981 (closed)
    • relates #2874 (closed)
  • Uploads:
    • Source.af3_23 Source model from "steps-to-reproduce"
    • copyError
Assignee
Assign to
Time tracking