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

Changing the name of a Versioned Folder branch does not change the branch name of all models below it #477

Open
pjmonks opened this issue Jul 15, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@pjmonks
Copy link
Contributor

pjmonks commented Jul 15, 2024

Description

Editing the branch name of a versioned folder will work, but all descendent models do not share the new branch name. This then means all paths are incorrect, despite the fact that they still work - but they are inconsistent.

Steps to reproduce

  1. Create a Versioned Folder main branch, then a branched copy called something different e.g. anotherBranch
  2. In MDM UI, edit the branch name to differentBranch b. Or send this HTTP request:
PUT /api/versionedFolders/{versionedFolderId}

{
    "id":"a15d8603-6cf6-4675-9d6b-338f9b720589", 
    "domainType":"VersionedFolder",
    "label":"Test Versioned Folder",
    "branchName":"differentBranch"
}
  1. Notice that 200 OK is returned.
  2. Now check a model below that versioned folder and notice the branch name is still anotherBranch

Expected behavior

All model branch names below the versioned folder should also be updated.

Related

@pjmonks pjmonks added the bug Something isn't working label Jul 15, 2024
@mhocc mhocc self-assigned this Jul 22, 2024
@pjmonks
Copy link
Contributor Author

pjmonks commented Jul 25, 2024

I'm going to put this issue on hold due to the complexity I've discovered in trying to fix this.

@jamesrwelch pointed out the ModelService.updateModelItemPathsAfterFinalisationOfModel() methods as an example of what to do, which involve something similar with finalisation and updating related paths after a change in path model identifier (which would be similar in this case). What happens here is:

  1. Provide a list of database tables per model service to bulk update
  2. Perform a custom SQL UPDATE query which directly modifies the database. In this case, the path column is altered.

So for this bug to be fixed, a similar approach would theoretically work, but the UPDATE query would alter the branch name of models, the paths of models (because the branch name is included in the paths), and all the paths of model items too , because their paths also include the branch name.

But this raises the complexity, because:

  1. We need to identify all the models under the VersionedFolder being changed - changing the branch name and path.
  2. We also need to identify all the sub-folders under the VersionedFolder, then repeat step 1 for every sub-folder found.
  3. We then also need to update every possible model item under every model under the VersionedFolder - changing the path of each record.

For the data dictionary, that is a huge amount of items to update, which will no doubt negatively affect performance. Plus the scope of work will touch every model domain under mdm-core.

We do not have the capacity to build and test this at the moment, so it must be an improvement planned for the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants