For completeness object deletion needs to be built in. Given the state of Alpha_2 deletion will focus on Interaction and Company objects only. Deletion of Study objects is out of scope for Alpha_2 and deletion of User objects is completely out of scope since that is the domain of the GitHub admin.
Implementation progress
The following steps are captured based upon the implementation notes to help drive towards conclusion.
General
This will cover the simple use cases for Interactions and Companies plus prepare the way for Studies in the future.
[x] Follow update in structure and implement a general delete for Interactions and in the future Studies. Additionally, this will be used for simple Company deletes that leave orphaned Interactions which are unlinked.
[x] Simple deletion should be smart enough to delete an object and not unlink if there are no linked objects.
[x] We should prompt the user with the steps about to be taken and confirm they are ok with the process.
[x] A complete report of the actions performed should be surfaced to the user so they know the operation was successful.
[x] The --delete switch should take an object name
Companies
An implementation specific to Companies in gitHubServer.js.
[x] In mrcli-company.js we need to convert it to a similar structure as mrcli-user.js to add specific command line switches. Specifically a new option called --allow_orphans which will enable simple deletion will be created.
[x] When orphans are not allowed, the more complex deletion will be used that first deletes the Company and then follows up by deleting the associated Interactions.
[x] Interaction deletion should cleanup the actual content in the repository leaving no trace of the Interaction. This means if the user wants to maintain the interaction they must specify the --allow_orphans command line switch.
[x] We should prompt the user with the steps about to be taken and confirm they are ok with the process.
[x] A complete report of the actions performed should be surfaced to the user so they know the operation was successful.
[x] The --delete switch should take an object name
Interactions
The following are needed to completely remove an interaction.
[x] Implement a removeBlob function to completely remove the interaction contents.
Implementation notes
Objects can only be deleted one by one, batch deletes will not be supported.
When an Interaction object is deleted the link in the company for that object must be deleted and the modification time of the Company must be updated.
For Company objects the situation is more complex. Essentially the decision is to delete all associated interactions when a company is deleted unless the user wants to maintain the actual orphaned interactions. There could be a use case for this where a company is acquired and then the interactions will be relinked to another as yet to be created or existing company. For clarity Mass reassignment of Interactions to an alternative company won't be supported at this stage.
Since Study objects will need to also be supported in the future a generic version of this will be implemented in github.js while a specific version for Companies will be implemented in gitHubServer.js.
Introduction
For completeness object deletion needs to be built in. Given the state of Alpha_2 deletion will focus on Interaction and Company objects only. Deletion of Study objects is out of scope for Alpha_2 and deletion of User objects is completely out of scope since that is the domain of the GitHub admin.
Implementation progress
The following steps are captured based upon the implementation notes to help drive towards conclusion.
General
This will cover the simple use cases for Interactions and Companies plus prepare the way for Studies in the future.
--delete
switch should take an object nameCompanies
An implementation specific to Companies in
gitHubServer.js
.mrcli-company.js
we need to convert it to a similar structure asmrcli-user.js
to add specific command line switches. Specifically a new option called--allow_orphans
which will enable simple deletion will be created.--allow_orphans
command line switch.--delete
switch should take an object nameInteractions
The following are needed to completely remove an interaction.
removeBlob
function to completely remove the interaction contents.Implementation notes
github.js
while a specific version for Companies will be implemented ingitHubServer.js
.