{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/21929","labels_url":"https://api.github.com/repos/saltstack/salt/issues/21929/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/21929/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/21929/events","html_url":"https://github.com/saltstack/salt/issues/21929","id":63966941,"number":21929,"title":"composer.installed sould not run always","user":{"login":"TriAnMan","id":2266882,"avatar_url":"https://avatars.githubusercontent.com/u/2266882?v=3","gravatar_id":"","url":"https://api.github.com/users/TriAnMan","html_url":"https://github.com/TriAnMan","followers_url":"https://api.github.com/users/TriAnMan/followers","following_url":"https://api.github.com/users/TriAnMan/following{/other_user}","gists_url":"https://api.github.com/users/TriAnMan/gists{/gist_id}","starred_url":"https://api.github.com/users/TriAnMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TriAnMan/subscriptions","organizations_url":"https://api.github.com/users/TriAnMan/orgs","repos_url":"https://api.github.com/users/TriAnMan/repos","events_url":"https://api.github.com/users/TriAnMan/events{/privacy}","received_events_url":"https://api.github.com/users/TriAnMan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Feature","name":"Feature","color":"009800"}],"state":"open","locked":false,"assignee":{"login":"jfindlay","id":702905,"avatar_url":"https://avatars.githubusercontent.com/u/702905?v=3","gravatar_id":"","url":"https://api.github.com/users/jfindlay","html_url":"https://github.com/jfindlay","followers_url":"https://api.github.com/users/jfindlay/followers","following_url":"https://api.github.com/users/jfindlay/following{/other_user}","gists_url":"https://api.github.com/users/jfindlay/gists{/gist_id}","starred_url":"https://api.github.com/users/jfindlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfindlay/subscriptions","organizations_url":"https://api.github.com/users/jfindlay/orgs","repos_url":"https://api.github.com/users/jfindlay/repos","events_url":"https://api.github.com/users/jfindlay/events{/privacy}","received_events_url":"https://api.github.com/users/jfindlay/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":2080,"closed_issues":1712,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2015-03-25T14:37:10Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2015-03-24T10:50:57Z","updated_at":"2015-03-25T14:38:42Z","closed_at":null,"body":"I've discovered the way composer.installed satate can be run only if there is something to do. Check out my handmade state for such purpose:\r\n\r\n```\r\n  cmd.run:\r\n    - name: composer install --no-interaction\r\n    - cwd: /path/to/project\r\n    - unless: composer install --dry-run 2>&1 | grep \"Nothing to install or update\"\r\n```"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/86055649","html_url":"https://github.com/saltstack/salt/issues/21929#issuecomment-86055649","issue_url":"https://api.github.com/repos/saltstack/salt/issues/21929","id":86055649,"user":{"login":"ross-p","id":4956475,"avatar_url":"https://avatars.githubusercontent.com/u/4956475?v=3","gravatar_id":"","url":"https://api.github.com/users/ross-p","html_url":"https://github.com/ross-p","followers_url":"https://api.github.com/users/ross-p/followers","following_url":"https://api.github.com/users/ross-p/following{/other_user}","gists_url":"https://api.github.com/users/ross-p/gists{/gist_id}","starred_url":"https://api.github.com/users/ross-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ross-p/subscriptions","organizations_url":"https://api.github.com/users/ross-p/orgs","repos_url":"https://api.github.com/users/ross-p/repos","events_url":"https://api.github.com/users/ross-p/events{/privacy}","received_events_url":"https://api.github.com/users/ross-p/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T14:38:42Z","updated_at":"2015-03-25T14:38:42Z","body":"@TriAnMan RE `always_check: False`, in our organization we never update code that is running in production.  When there is an update, we create a new directory like /path/to/app/1.0.1 and we put all the code in there.  This allows for easy atomic updates, rollbacks, etc.\r\n\r\nAnd thus we never `composer install` on an existing code version in production unless it has never before been done for that version.  Running `composer install` causes a period of several seconds to several minutes where your PHP application is behaving in an undefined manner, you don't know what code exists when, and that is unacceptable in our production environments.\r\n\r\nI realize this is not the way that most people deploy PHP but it's really the way that anyone who is serious about reliability and uptime should deploy.  Or at least some way similar to this that allows for atomic updates of an existing production system.\r\n\r\nIn any case, I don't necessarily object to running `composer install --dry-run`, if you want to make that update.  It would take more CPU during the highstate but it would also cover the case of custom `composer.json` vendor directory locations."}}