{"action":"created","issue":{"url":"https://api.github.com/repos/zendesk/samson/issues/198","labels_url":"https://api.github.com/repos/zendesk/samson/issues/198/labels{/name}","comments_url":"https://api.github.com/repos/zendesk/samson/issues/198/comments","events_url":"https://api.github.com/repos/zendesk/samson/issues/198/events","html_url":"https://github.com/zendesk/samson/pull/198","id":48967596,"number":198,"title":"Fneves/autocomplete tags on deploy","user":{"login":"fneves","id":647255,"avatar_url":"https://avatars.githubusercontent.com/u/647255?v=3","gravatar_id":"","url":"https://api.github.com/users/fneves","html_url":"https://github.com/fneves","followers_url":"https://api.github.com/users/fneves/followers","following_url":"https://api.github.com/users/fneves/following{/other_user}","gists_url":"https://api.github.com/users/fneves/gists{/gist_id}","starred_url":"https://api.github.com/users/fneves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fneves/subscriptions","organizations_url":"https://api.github.com/users/fneves/orgs","repos_url":"https://api.github.com/users/fneves/repos","events_url":"https://api.github.com/users/fneves/events{/privacy}","received_events_url":"https://api.github.com/users/fneves/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2014-11-16T10:28:40Z","updated_at":"2015-01-05T13:37:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zendesk/samson/pulls/198","html_url":"https://github.com/zendesk/samson/pull/198","diff_url":"https://github.com/zendesk/samson/pull/198.diff","patch_url":"https://github.com/zendesk/samson/pull/198.patch"},"body":"## Description\r\n\r\nThis pull request adds the ability of having autocomplete with branches and tags on the autocomplete screen.\r\nIt also bumps up the version of typeahead javascript plugin supporting the new suggestion engine Bloodhound.\r\n\r\nThis works in two different ways:\r\n1. If there is no locally cached repository, it gets the tags and branches remotely using git ls-remote command.\r\n2. If a locally cached repository exists, it pulls the last changes and queries it for its branches and tags. \r\n\r\nAll the changes are cached for so that multiple consecutive requests don't trigger multiple pulls or git ls-remotes in a short period of time. This cache uses a default TTL of 30 minutes and has an extra parameter (hit_count) that guarantees that if we hit the endpoint at least 6 times, it will refresh the cache even before the TTL.\r\n\r\nThe option of using git ls-remote when the repository is not locally cached is due to the fact that a big repository when cloned might take some time, and the repository would be locked for all that time.\r\n\r\nThis is an autocomplete feature meaning that the user does not really want to wait a long time to get the autocomplete suggestions and it would be strange that his deployment would then be waiting for a lock on the git repo. \r\nThis way we use the git ls-remote to return the tags long way before the repository would be cloned.\r\n\r\n## Screenshots: \r\n\r\n![versions](https://cloud.githubusercontent.com/assets/647255/5061127/39ff6a38-6d7b-11e4-9e7e-0ed8c682a359.png)\r\n\r\n![autocomplete](https://cloud.githubusercontent.com/assets/647255/5061128/3e0236a6-6d7b-11e4-917f-06ad7fa2b65d.png)\r\n\r\n/cc @zendesk/samson @pswadi-zendesk \r\n\r\n### References\r\n - Jira link: [SAMSON-109] (https://zendesk.atlassian.net/browse/SAMSON-109)\r\n\r\n### Risks\r\n - There was some refactoring on the JobExecution so that the logic of repository setup could be shared between two controllers. Although all the tests should cover this refactoring we should keep an eye for possible problems that might show up from cloning repositories."},"comment":{"url":"https://api.github.com/repos/zendesk/samson/issues/comments/68708156","html_url":"https://github.com/zendesk/samson/pull/198#issuecomment-68708156","issue_url":"https://api.github.com/repos/zendesk/samson/issues/198","id":68708156,"user":{"login":"fneves","id":647255,"avatar_url":"https://avatars.githubusercontent.com/u/647255?v=3","gravatar_id":"","url":"https://api.github.com/users/fneves","html_url":"https://github.com/fneves","followers_url":"https://api.github.com/users/fneves/followers","following_url":"https://api.github.com/users/fneves/following{/other_user}","gists_url":"https://api.github.com/users/fneves/gists{/gist_id}","starred_url":"https://api.github.com/users/fneves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fneves/subscriptions","organizations_url":"https://api.github.com/users/fneves/orgs","repos_url":"https://api.github.com/users/fneves/repos","events_url":"https://api.github.com/users/fneves/events{/privacy}","received_events_url":"https://api.github.com/users/fneves/received_events","type":"User","site_admin":false},"created_at":"2015-01-05T13:37:25Z","updated_at":"2015-01-05T13:37:25Z","body":"It seems that code climate hanged while analysing the code. I don't seem to have permissions to go into the link and check what is going on. Can anyone give me permissions or cancel and retry the code climate execution? Not even sure if that it possible, just want to unlock it."}}