{"action":"created","issue":{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/4603","repository_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy","labels_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/4603/labels{/name}","comments_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/4603/comments","events_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/4603/events","html_url":"https://github.com/openmicroscopy/openmicroscopy/pull/4603","id":150428359,"number":4603,"title":"CLI command to remove a pyramid file","user":{"login":"ximenesuk","id":1065145,"avatar_url":"https://avatars.githubusercontent.com/u/1065145?v=3","gravatar_id":"","url":"https://api.github.com/users/ximenesuk","html_url":"https://github.com/ximenesuk","followers_url":"https://api.github.com/users/ximenesuk/followers","following_url":"https://api.github.com/users/ximenesuk/following{/other_user}","gists_url":"https://api.github.com/users/ximenesuk/gists{/gist_id}","starred_url":"https://api.github.com/users/ximenesuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ximenesuk/subscriptions","organizations_url":"https://api.github.com/users/ximenesuk/orgs","repos_url":"https://api.github.com/users/ximenesuk/repos","events_url":"https://api.github.com/users/ximenesuk/events{/privacy}","received_events_url":"https://api.github.com/users/ximenesuk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/labels/develop","name":"develop","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-22T17:33:27Z","updated_at":"2016-04-25T11:43:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/4603","html_url":"https://github.com/openmicroscopy/openmicroscopy/pull/4603","diff_url":"https://github.com/openmicroscopy/openmicroscopy/pull/4603.diff","patch_url":"https://github.com/openmicroscopy/openmicroscopy/pull/4603.patch"},"body":"This `fs` subcommand allows a specific pyramid file to be removed given its Image ID, this is regardless of whether it is empty or not. See: https://trello.com/c/TM1Si3UN/38-pyramids This doesn't provide an end to end workflow but it does allow an admin to develop a CLI workflow for dealing with problem pyramids. The command is admin-only currently but it could be relaxed if necessary. There is no test but I will add a basic test.\r\n\r\nTesting\r\n-------\r\n\r\nOn a fresh local system without significant imports one possible test is to import and image and record its ID, then create an artificial pyramid file:\r\n\r\n```\r\ntouch OMERO/Pixels/X_pyramid\r\n```\r\nwhere X is the Image ID. Then:\r\n\r\n```\r\n$ bin/omero fs fixpyramid Image:X\r\n```\r\nshould remove the pyramid file with a confirmation message.\r\n\r\nAlternatively import an image that will produce a pyramid file, note its ID, check that the pyramid file has generated and then run the above command. The pyramid file should be deleted. Using a client it should then be possible to force the regeneration of the pyramid file by trying to view the image.\r\n"},"comment":{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/comments/214278177","html_url":"https://github.com/openmicroscopy/openmicroscopy/pull/4603#issuecomment-214278177","issue_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/4603","id":214278177,"user":{"login":"ximenesuk","id":1065145,"avatar_url":"https://avatars.githubusercontent.com/u/1065145?v=3","gravatar_id":"","url":"https://api.github.com/users/ximenesuk","html_url":"https://github.com/ximenesuk","followers_url":"https://api.github.com/users/ximenesuk/followers","following_url":"https://api.github.com/users/ximenesuk/following{/other_user}","gists_url":"https://api.github.com/users/ximenesuk/gists{/gist_id}","starred_url":"https://api.github.com/users/ximenesuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ximenesuk/subscriptions","organizations_url":"https://api.github.com/users/ximenesuk/orgs","repos_url":"https://api.github.com/users/ximenesuk/repos","events_url":"https://api.github.com/users/ximenesuk/events{/privacy}","received_events_url":"https://api.github.com/users/ximenesuk/received_events","type":"User","site_admin":false},"created_at":"2016-04-25T11:43:57Z","updated_at":"2016-04-25T11:43:57Z","body":"Answering @mtbc's observations.\r\n\r\n1. The name is intended to match an `admin` subcommand which removes empty pyramids. While it only removes at present it could have an option added to trigger a regeneration, `--regenerate`, say; it might then live up to its name.\r\n1.  The success message has now been suppressed in line with some other commands that succeed silently. This may or may not be reasonable.\r\n\r\nThe method underlying the CLI argument  `ProxyStringType` was not checking that the class name in `Class:ID` matched the default, if bother were provided. A commit fixes this and a test has been added. However it is **strict**, thus:\r\n```\r\n$omero fs fixpyramid ImageI:1\r\n```\r\nwill fail as the default is `Image`. This change affects the `fs` and `metadata` commands. Relevant tests pass but further testing should, at least, check the use of `fs rename Fileset:XX`.\r\n"}}