Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mc 9631 - Branch and merge Model Data Type #223

Merged
merged 21 commits into from
Jan 25, 2022

Conversation

aaronforshaw
Copy link
Contributor

@aaronforshaw aaronforshaw commented Dec 22, 2021

  • Fix bugs in the path retrieval of VersionedFolder.
  • Add a method to the PathService to find a resource by its Path only, with no security check on the securable resource which owns the resource.
  • When branching a Versioned Folder, update Model Data Types in the branched folder so that they point to the branched model.
  • Update ModelDataType.diff so that it only returns a diff if the paths of the pointed to resource in source and target are different after ignoring differences in the branch and version. The diff returned is on 'modelResourcePath' rather than modelResourceId and modelResourceDomainType. This 'modelResourcePath' is computed as a fully qualified path by recursing up all parents of the model.
  • Add a method to DomainService which enables subclasses to state that they will provide special handling for the patching a modification into a Versioned Folder
  • In ModelDataTypeService, override the above method and use the 'modelResourcePath' provided in the diff to look up the relevant resource to point to when merging.
  • Ditto the above two points, but for merging when not in a Versioned Folder
  • Add test data
  • Add tests for (i) branching of Model Data Type in a VF (ii) merge a Model Data Type when it is pointing to a resource in the source folder (iii) merge a Model Data Type when it is pointing to a resource outside of the VF
  • Add test for branching and merging of a Data Model containing a Model Data Type when not in a VF

Copy link
Contributor

@olliefreeman olliefreeman left a comment

Choose a reason for hiding this comment

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

Looks like the methodology is right,

All the stuff in path and path node and model, can you replace it all with the use of boolean matchesIdentifier(PathNode otherPathNode, String modelIdentifierOverride = null) as thats why that method exists, you can pass in a branch name or model version number as the override and it will do everything you've coded up for you.

@aaronforshaw
Copy link
Contributor Author

@olliefreeman Please see updated description at the top of this PR.

@aaronforshaw aaronforshaw marked this pull request as draft January 18, 2022 08:25
- fix pathing of VersionedFolder
- diff of ModelDataType returns a modelResourcePath
- generic approach to handle a modification patch using a special method
- use modelResourcePath in the patch to find the relevant modelResourceId and modelResourceDomainType
@aaronforshaw aaronforshaw marked this pull request as ready for review January 20, 2022 12:38
Copy link
Contributor

@olliefreeman olliefreeman left a comment

Choose a reason for hiding this comment

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

with the changes in commit im happy with this now

* Remove the addtl methods into CreatorAware as these already exist as part of PathNode where a pathnode can be altered using a modelIdentifier, this reduces the number of places where changes need to be made if we alter anything
* Remove the coding relience on the concept of VFs, rather have one method for patch handling which uses the target to determine what happens. Allows for greater depth if we need to add any addtl handling later
* MDTs are always keyed to models so use ModelServices list rather thae DomainServices list as its less to search and therefore faster
* Make a handy method which can extract a model for a MDT or throw an exception thereby reducing the code needed
@olliefreeman
Copy link
Contributor

failing test is a known flaky test so merging

@olliefreeman olliefreeman merged commit 812e7bb into develop Jan 25, 2022
@olliefreeman olliefreeman deleted the feature/mc-9631 branch January 25, 2022 23:35
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.

None yet

2 participants