Export/import of comments (#1760)#2413
Conversation
|
Latest commit adds support for excluding export of Using the flag The same flag is added to The default is to include |
sphuber
left a comment
There was a problem hiding this comment.
Some minor changes, but otherwise looks good
|
This has gone through review and after other blocking PRs are resolved I will rebase and merge |
szoupanos
left a comment
There was a problem hiding this comment.
Just modify a bit the test to make sure that you export also users that did a comment on a node that was not created by them (the user that created a node will be exported anyway).
|
I would not merge provenance_redesign' into your branch but rebase your branch to accommodate the changes of provenance_redesign. |
Sure. I 'accidentally' pressed the "Update branch" button :) |
|
@CasperWA In this case it still is less convenient because there are merge conflicts that I had to resolve locally. Due to the merges I couldn't simply squash your commits and then do a single rebase. Instead I had to merge it. I hope when we squash merge it will still be attributed to you, but I am not sure what will happen since the last commit is now mine, despite it being just a merge commit. |
088b3da to
4c2f591
Compare
To make the export of `Comment` entities possible, the `QueryBuilder` had to be extended to support retrieving comments for a given `Node`. The following changes were applied: * Added support to join user to comment (`with_user`) * Added support to join comment to user (`with_comment`) The `verdi export create` has a new flag to include or exclude the export of comments for nodes that are to be exported, defaulting to include: `--include-comments/--exclude-comments` Documentation has been updated to include new `QueryBuilder` join args in table and the `metadata.json` example has been updated in documentation to include correct Comment info.
4c2f591 to
dfa7ccc
Compare
|
Great success, thanks a lot for the great work @CasperWA ! |
This fixes #1760.
Comments can now be exported/imported using export-version 0.4.
At this stage of the implementation, all comments pertaining to a node chosen for export will be exported.
Comments cannot be exported by themselves, nor is a
Commenta valid entity to export directly, i.e. comments can only be exported indirectly through nodes.There is a suggestion to add a flag to ex-/include comments when exporting.
If multiple users add comments to a node, all users will be exported recursively.
Examples of how data.json and metadata.json might look have been updated with
Commentin the documentation.An additional pair of joins has been added to QueryBuilder:
with_commentto join aCommentto aUserwith_userto join aUserto aCommentThese, along with a similar pair of joins for
Node, has been added to the table of Joining entities in the documentation.Lastly,
Commentcan now be imported directly fromaiida.orm.