MauroDataMapper-NHSD / mdm-plugin-nhs-data-dictionary

Mauro Core Plugin for the NHS Data Dictionary
Apache License 2.0
0 stars 0 forks source link

Add additional graph interceptors for branch operations #51

Open pjmonks opened 2 months ago

pjmonks commented 2 months ago

Depends on

This PR being completed:

Overview

The graph operations added to trace all data dictionary items currently only work on create/edit/delete operations for single items.

The following additional custom Grails interceptors need to be added to complete the set.

Branch created

Intercept when a controller: versionedFolder and action: newBranchModelVersion is called.

In the after() method, build all graph nodes for every item in the data dictionary. This must be done in an async job to not hold up the HTTP response.

Copy endpoints

Intercept when the following are copied:

The controllers/actions will vary depending on which of these happen, so match against multiple sets.

In the after() method, build the graph node for the new item and possibly sub-items. This should be similar to the DataDictionaryItemCreatedInterceptor. The only difference is that if a model was copied, then all sub-items e.g. Data Classes/Elements/Terms, should also have graph nodes built.

Merge a versioned folder branch

Intercept when a controller: versionedFolder and action: mergeInto is called.

For simplicity, it may just be easier to rebuild the graph nodes of all items in the target branch instead of tracking every possible change. In which case, the after() method should build all graph nodes for every item in the target versioned folder. This must be done in an async job to not hold up the HTTP response.

pjmonks commented 1 month ago

Putting this on hold - the graph features are too complex to complete on time so we're using another solution. This therefore is not part of that new solution.