-
Notifications
You must be signed in to change notification settings - Fork 189
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
Export/import of comments (#1760) #2413
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes, but otherwise looks good
This has gone through review and after other blocking PRs are resolved I will rebase and merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Comment
a 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
Comment
in the documentation.An additional pair of joins has been added to QueryBuilder:
with_comment
to join aComment
to aUser
with_user
to join aUser
to aComment
These, along with a similar pair of joins for
Node
, has been added to the table of Joining entities in the documentation.Lastly,
Comment
can now be imported directly fromaiida.orm
.