CLI duplicate command#4574
Conversation
There was a problem hiding this comment.
At least that is in my code and not @pwalczysko's! I noticed it when copying it to the PR description but thought I could sneak it through/leave it in case there are other changes.
|
Probably the only other question from my side is whether or not to include this in 5.2.3 and/or hide it via |
beeea1e to
293bb92
Compare
|
Reopening with @pwalczysko being identified as a contributor. |
|
@joshmoore re #4574 (comment) I'd say it works as a stand-alone command even though it may be that another command eventually subsumes it. However, at the moment it is limited by being an all or nothing duplicate. I'd vote for allowing it in to 5.2.3 as a useful utility but, for now, hiding it from non-developers. |
| self.ctx.out(" %s:%s" % (k, objIds[k])) | ||
|
|
||
| try: | ||
| register("duplicate", DuplicateControl, HELP) |
There was a problem hiding this comment.
I will add today - I hadn't realised you had 👍ed my comment as I don't seem to get notifications of reactions.
|
|
|
Have you added |
|
No. What value do I put in it? (Is this documented anywhere?) |
|
No value, just |
|
Goodness, so it does, thank you! |
|
I don't think there is any documentation yet other than its use in /cc @joshmoore |
|
It's for dev/internal use, so we probably don't want to document it. |
|
Tested using the daily DEV merge build. All worked as expected both with and without On the |
This is beyond this PR but as described in https://trello.com/c/tVSjHnee/55-add-warnings-for-windows-end-of-support there are several plugins (perf, testengine, submit) which should be deprecated and removed. In comparison, childre, duplicate, render, are "experimental" and the API will be decided on soon for inclusion. (Another way of doing this would be to have them in a separate repo and versioned low, e.g. 0.1.0, and then install them via pip in a virtualenv.) |
The alternative is to not include these plugins in the mainline, so I think it's best to treat them as non-existent. Originally they were only in the |
…ication, clean up
👍 Minimally that should help the team remember what the secret invocation was. (Can be external to this PR) |
Add tests for hierarchy and skiphead duplication
| params.addId(did) | ||
| query = ("select p from Project as p where exists" | ||
| "(select l from ProjectDatasetLink as l where " | ||
| "l.child.id=:id and l.parent=p.id)") |
There was a problem hiding this comment.
this might simply be something like,
SELECT DISTINCT parent FROM ProjectDatasetLink WHERE child.id = :id
There was a problem hiding this comment.
Thanks for the suggestion @mtbc, @pwalczysko may have adapted his query from elsewhere in our codebase?
There was a problem hiding this comment.
As @ximenesuk suggested, I indeed did adapt this code from the import test https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroPy/test/integration/clitest/test_import.py#L189.
@mtbc : Would it be okay to merge this as it is and return to the cleanup of the queries in the tests later ?
There was a problem hiding this comment.
Sure, not blocking, just commenting. Be warned that there are some quite exciting examples of HQL around our codebase. 😃
|
Reading the comments, especially #4574 (comment) Better to hold off for 5.2.3 |
|
What more needs doing here -- review tests? |
|
My understanding is that this was just waiting for 5.2.3 to be released. |
|
Yes, that was my understanding too. If any further tests were to be needed @pwalczysko would open a PR directly against develop once this is merged, |
|
So should this be relisted ? Would give me a boost if this could go in really :) |
|
Well in that case .... merging. I will organize a general discussion on the de-DEV-PLUGIN-ification in the summer as we try to get the IDR work back on the mainline. Thanks all! |
This PR adds a basic duplicate command to the CLI, this should duplicate simple objects and hierarchies. It includes integration tests for simple objects.
Testing
See:
Multiple IDs and objects should also work:
In addition hierarchies (P/D/I for example) and other complex objects should be duplicated. Create a simple P/D/I structure or import a Screen, then:
the
--reportoption is useful here to check the graph duplication.To do
Once this PR is merged @pwalczysko plans to add further tests for multiple arguments, simple hierarchies (P/D/I) and complex objects (Screen).
The command itself needs improving to deal with the options in @mtbc's underlying command.