{"action":"created","issue":{"url":"https://api.github.com/repos/YunoHost/yunohost/issues/453","repository_url":"https://api.github.com/repos/YunoHost/yunohost","labels_url":"https://api.github.com/repos/YunoHost/yunohost/issues/453/labels{/name}","comments_url":"https://api.github.com/repos/YunoHost/yunohost/issues/453/comments","events_url":"https://api.github.com/repos/YunoHost/yunohost/issues/453/events","html_url":"https://github.com/YunoHost/yunohost/pull/453","id":318624753,"number":453,"title":"ynh_setup_source: enable local cache","user":{"login":"Jibec","id":474883,"avatar_url":"https://avatars0.githubusercontent.com/u/474883?v=4","gravatar_id":"","url":"https://api.github.com/users/Jibec","html_url":"https://github.com/Jibec","followers_url":"https://api.github.com/users/Jibec/followers","following_url":"https://api.github.com/users/Jibec/following{/other_user}","gists_url":"https://api.github.com/users/Jibec/gists{/gist_id}","starred_url":"https://api.github.com/users/Jibec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jibec/subscriptions","organizations_url":"https://api.github.com/users/Jibec/orgs","repos_url":"https://api.github.com/users/Jibec/repos","events_url":"https://api.github.com/users/Jibec/events{/privacy}","received_events_url":"https://api.github.com/users/Jibec/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-28T10:43:03Z","updated_at":"2018-04-28T11:48:05Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/YunoHost/yunohost/pulls/453","html_url":"https://github.com/YunoHost/yunohost/pull/453","diff_url":"https://github.com/YunoHost/yunohost/pull/453.diff","patch_url":"https://github.com/YunoHost/yunohost/pull/453.patch"},"body":"## The problem\r\n\r\nWhen running a lot of tests (mostly using package_check), downloading takes useless time and resources. As both are limited, I try to cache everything I can.\r\n\r\nDebian already has a cache for packages, nothing is to be done for YunoHost: https://github.com/YunoHost/package_check/issues/26\r\n\r\nPip also have one, but including in in core is to be discussed (not here): https://github.com/YunoHost/package_check/issues/25\r\n\r\nYunoHost has some mechanics, but:\r\n\r\n1. the current system doesn't cache, it only looks into a folder to check if a file is already here\r\n2. the folder used for this cache file looks inconsistent\r\n\r\n## Solution\r\n\r\nadd a simple cache mechanism:\r\n * if a local file exists: overwrite this cache file if the checksum doesn't match\r\n * if it doesn't: just download a cache file\r\n\r\nI kept it simple and if there is an error, it just tells the user about it (I'm unsure this happens much).\r\n\r\n## PR Status\r\n\r\nHappily using it while testing application with package_check.\r\n\r\n## How to test\r\n\r\nYou may just copy/paste this function in any application an run package_check\r\n\r\n## Validation\r\n\r\n- [ ] Principle agreement 0/2 : \r\n- [ ] Quick review 0/1 : \r\n- [ ] Simple test 0/1 : \r\n- [ ] Deep review 0/1 : \r\n"},"comment":{"url":"https://api.github.com/repos/YunoHost/yunohost/issues/comments/385169169","html_url":"https://github.com/YunoHost/yunohost/pull/453#issuecomment-385169169","issue_url":"https://api.github.com/repos/YunoHost/yunohost/issues/453","id":385169169,"user":{"login":"JimboJoe","id":423472,"avatar_url":"https://avatars3.githubusercontent.com/u/423472?v=4","gravatar_id":"","url":"https://api.github.com/users/JimboJoe","html_url":"https://github.com/JimboJoe","followers_url":"https://api.github.com/users/JimboJoe/followers","following_url":"https://api.github.com/users/JimboJoe/following{/other_user}","gists_url":"https://api.github.com/users/JimboJoe/gists{/gist_id}","starred_url":"https://api.github.com/users/JimboJoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JimboJoe/subscriptions","organizations_url":"https://api.github.com/users/JimboJoe/orgs","repos_url":"https://api.github.com/users/JimboJoe/repos","events_url":"https://api.github.com/users/JimboJoe/events{/privacy}","received_events_url":"https://api.github.com/users/JimboJoe/received_events","type":"User","site_admin":false},"created_at":"2018-04-28T11:48:05Z","updated_at":"2018-04-28T11:48:05Z","author_association":"MEMBER","body":"While I think the idea of caching data in our package_check environment is really **great**, I'm more concerned with impacting our helpers here, for two main reasons:\r\n* caching upstream archives shouldn't be useful: I think we more reasonably should work on upgrading upstream apps in our applications only if it has changed (for example by comparing the \"upstream\" part of the package version), to avoid this unnecessary download, but also unnecessary (and risky) linked operations.\r\n* adding a cache means managing it: how can we ensure the /var partition won't get full?\r\n\r\nI'm maybe being too cautious here, but maybe would it be possible to restrict that (very welcome) caching mechanism to package_check environment...?"}}
{"actor":{"display_login":"JimboJoe"}}