{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/25117","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/25117/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/25117/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/25117/events","html_url":"https://github.com/symfony/symfony/pull/25117","id":276104024,"number":25117,"title":"[FrameworkBundle] Make cache:clear \"atomic\" and consistent with cache:warmup","user":{"login":"hkdobrev","id":506129,"avatar_url":"https://avatars2.githubusercontent.com/u/506129?v=4","gravatar_id":"","url":"https://api.github.com/users/hkdobrev","html_url":"https://github.com/hkdobrev","followers_url":"https://api.github.com/users/hkdobrev/followers","following_url":"https://api.github.com/users/hkdobrev/following{/other_user}","gists_url":"https://api.github.com/users/hkdobrev/gists{/gist_id}","starred_url":"https://api.github.com/users/hkdobrev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkdobrev/subscriptions","organizations_url":"https://api.github.com/users/hkdobrev/orgs","repos_url":"https://api.github.com/users/hkdobrev/repos","events_url":"https://api.github.com/users/hkdobrev/events{/privacy}","received_events_url":"https://api.github.com/users/hkdobrev/received_events","type":"User","site_admin":false},"labels":[{"id":100079,"url":"https://api.github.com/repos/symfony/symfony/labels/Bug","name":"Bug","color":"e10c02","default":false},{"id":237550465,"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Reviewed","name":"Status: Reviewed","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/symfony/symfony/milestones/10","html_url":"https://github.com/symfony/symfony/milestone/10","labels_url":"https://api.github.com/repos/symfony/symfony/milestones/10/labels","id":2117464,"number":10,"title":"3.4","description":"https://symfony.com/roadmap?version=3.4#checker","creator":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars3.githubusercontent.com/u/73419?v=4","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":593,"state":"open","created_at":"2016-11-06T20:24:23Z","updated_at":"2017-12-30T11:43:29Z","due_on":"2020-11-30T08:00:00Z","closed_at":null},"comments":5,"created_at":"2017-11-22T15:15:43Z","updated_at":"2017-12-30T13:05:40Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/25117","html_url":"https://github.com/symfony/symfony/pull/25117","diff_url":"https://github.com/symfony/symfony/pull/25117.diff","patch_url":"https://github.com/symfony/symfony/pull/25117.patch"},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | master\r\n| Bug fix?      | yes\r\n| New feature?  | no\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes/no\r\n| Fixed tickets | -\r\n| License       | MIT\r\n| Doc PR        | -\r\n\r\n\r\nHere's what happens before/after this PR on `cache:clear` and `cache:clear --no-warmup`.\r\n\r\n### Before PR\r\n\r\n**`cache:clear`**\r\n\r\n1. `rm var/cache_old`\r\n1. Clearing cache in `var/cache`    &nbsp;<i>&lt;--- This is not in line and not atomic</i>\r\n1. `rm var/cache_warmup`\r\n1. Warming up cache in `var/cache_warmup`\r\n1. `mv var/cache var/cache_old`\r\n1. `mv var/cache_warmup var/cache`\r\n1. `rm var/cache_old`\r\n\r\n**`cache:clear --no-warmup`**\r\n\r\n1. `rm var/cache_old`\r\n1. Clearing cache in `var/cache`    &nbsp;<i>&lt;--- This is not in line and not atomic</i>\r\n1. `mv var/cache var/cache_old`    <i>&lt;--- The old cache dir is completely obsolete in this workflow</i>\r\n1. `rm var/cache_old`\r\n\r\n---\r\n\r\n### After PR\r\n\r\n**`cache:clear`**\r\n\r\n1. `rm var/cache_old`\r\n1. `rm var/cache_new`\r\n1. Clearing cache in `var/cache_new`\r\n1. Warming up cache in `var/cache_new`\r\n1. `mv var/cache var/cache_old`\r\n1. `mv var/cache_new var/cache`\r\n1. `rm var/cache_old`\r\n\r\n**`cache:clear --no-warmup`**\r\n\r\n1. `rm var/cache_old`\r\n1. `rm var/cache_new`\r\n1. Clearing cache in `var/cache_new`\r\n1. `mv var/cache var/cache_old`\r\n1. `mv var/cache_new var/cache`\r\n1. `rm var/cache_old`\r\n\r\n---\r\n\r\nThe main differences:\r\n- Unify the flows and have each distinct operation only once in the code\r\n- Clear the cache in the new cache directory and then switch to it atomically instead of clearing in the current one.\r\n- Always have the cache directory present in the end. It was missing after `cache:clear --no-warmup` before.\r\n\r\nI think this brings more consistency and is aligned with the present goals of the command as well.\r\n\r\nHowever, I'm not really familiar with the Symfony framework and I might have wrong assumptions."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/354545287","html_url":"https://github.com/symfony/symfony/pull/25117#issuecomment-354545287","issue_url":"https://api.github.com/repos/symfony/symfony/issues/25117","id":354545287,"user":{"login":"nicolas-grekas","id":243674,"avatar_url":"https://avatars3.githubusercontent.com/u/243674?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"created_at":"2017-12-30T13:05:40Z","updated_at":"2017-12-30T13:05:40Z","author_association":"OWNER","body":"@hkdobrev that's already the case, I pushed on your branch."}}
{"actor":{"display_login":"nicolas-grekas"}}