{"action":"created","issue":{"url":"https://api.github.com/repos/picoCTF/picoCTF-shell-manager/issues/60","labels_url":"https://api.github.com/repos/picoCTF/picoCTF-shell-manager/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/picoCTF/picoCTF-shell-manager/issues/60/comments","events_url":"https://api.github.com/repos/picoCTF/picoCTF-shell-manager/issues/60/events","html_url":"https://github.com/picoCTF/picoCTF-shell-manager/issues/60","id":117420488,"number":60,"title":"Undeploy","user":{"login":"Dreadwall","id":15894623,"avatar_url":"https://avatars.githubusercontent.com/u/15894623?v=3","gravatar_id":"","url":"https://api.github.com/users/Dreadwall","html_url":"https://github.com/Dreadwall","followers_url":"https://api.github.com/users/Dreadwall/followers","following_url":"https://api.github.com/users/Dreadwall/following{/other_user}","gists_url":"https://api.github.com/users/Dreadwall/gists{/gist_id}","starred_url":"https://api.github.com/users/Dreadwall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dreadwall/subscriptions","organizations_url":"https://api.github.com/users/Dreadwall/orgs","repos_url":"https://api.github.com/users/Dreadwall/repos","events_url":"https://api.github.com/users/Dreadwall/events{/privacy}","received_events_url":"https://api.github.com/users/Dreadwall/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-17T18:38:40Z","updated_at":"2015-11-19T03:33:42Z","closed_at":null,"body":"shell_manager undeploy has a few bugs, I'm gonna start working on it just wanted to document them. \r\n1. Calling undeploy with an incorrect number of instances leaves orphaned instances that cannot be removed. \r\n    A. Deploy -n 3 NAME\r\n    B. undeploy NAME\r\n    C. undeploy -n 2 NAME\r\nBoth B and C leave orphaned instances that cannot be removed using deploy.\r\n\r\n2. If undeploy is given the correct number of instances, it is correctly removed from the problems directory, but shell_manager status shows the problem with 0 instances.  \r\n    A. Deploy -n 3 NAME\r\n    B. undeploy -n 3 NAME\r\n\r\n3. Following from 2, if there are 0 instances of a problem, and load deployment is selected from the management tab, the problems aren't removed from the deployment. It does not install the question again, the number of problems installed decreases, but the problem remains available on the platform."},"comment":{"url":"https://api.github.com/repos/picoCTF/picoCTF-shell-manager/issues/comments/157940159","html_url":"https://github.com/picoCTF/picoCTF-shell-manager/issues/60#issuecomment-157940159","issue_url":"https://api.github.com/repos/picoCTF/picoCTF-shell-manager/issues/60","id":157940159,"user":{"login":"cganas","id":5132014,"avatar_url":"https://avatars.githubusercontent.com/u/5132014?v=3","gravatar_id":"","url":"https://api.github.com/users/cganas","html_url":"https://github.com/cganas","followers_url":"https://api.github.com/users/cganas/followers","following_url":"https://api.github.com/users/cganas/following{/other_user}","gists_url":"https://api.github.com/users/cganas/gists{/gist_id}","starred_url":"https://api.github.com/users/cganas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cganas/subscriptions","organizations_url":"https://api.github.com/users/cganas/orgs","repos_url":"https://api.github.com/users/cganas/repos","events_url":"https://api.github.com/users/cganas/events{/privacy}","received_events_url":"https://api.github.com/users/cganas/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T03:33:42Z","updated_at":"2015-11-19T03:33:42Z","body":"I would prefer option 2 of Tim's suggested workarounds (publishing zero instance problems). I think it makes a lot of sense to disable problems that have zero instances. Though I'm not sure what \"disabling\" should mean.\r\n\r\nProblems are either enabled or disabled and stay visible to the admin management page. I would argue a problem with **0** instances should be hidden from view and implicitly disabled, i.e. \r\n\r\nhidden? `len(problem[\"instances\"]) == 0`\r\ndisabled? `problem[\"disabled\"] or hidden?`\r\n\r\nThis should also affect bundle visibility. A bundle is included iff there exists some published problem in that bundle. This can easily be modified to **a bundle is included iff there exists some published problem with non-zero instances in that bundle.** I believe that change should be sufficient."}}