{"action":"closed","issue":{"url":"https://api.github.com/repos/gulpjs/gulp/issues/1834","repository_url":"https://api.github.com/repos/gulpjs/gulp","labels_url":"https://api.github.com/repos/gulpjs/gulp/issues/1834/labels{/name}","comments_url":"https://api.github.com/repos/gulpjs/gulp/issues/1834/comments","events_url":"https://api.github.com/repos/gulpjs/gulp/issues/1834/events","html_url":"https://github.com/gulpjs/gulp/issues/1834","id":183190528,"number":1834,"title":"Add an --assume-task-ran CLI option","user":{"login":"hach-que","id":504826,"avatar_url":"https://avatars.githubusercontent.com/u/504826?v=3","gravatar_id":"","url":"https://api.github.com/users/hach-que","html_url":"https://github.com/hach-que","followers_url":"https://api.github.com/users/hach-que/followers","following_url":"https://api.github.com/users/hach-que/following{/other_user}","gists_url":"https://api.github.com/users/hach-que/gists{/gist_id}","starred_url":"https://api.github.com/users/hach-que/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hach-que/subscriptions","organizations_url":"https://api.github.com/users/hach-que/orgs","repos_url":"https://api.github.com/users/hach-que/repos","events_url":"https://api.github.com/users/hach-que/events{/privacy}","received_events_url":"https://api.github.com/users/hach-que/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-15T05:32:46Z","updated_at":"2016-10-15T05:53:16Z","closed_at":"2016-10-15T05:53:16Z","body":"I wasn't quite sure where to post feature requests; the issue text say this tracker is for bugs only, but the contribution guide recommends submitting them here?\r\n\r\nAnyway, say you have a list of tasks like this:\r\n\r\n- build\r\n- test (depends on build)\r\n- docker build (depends on test)\r\n- docker push (depends on docker build)\r\n- deploy (depends on docker push)\r\n\r\nTo gain visibility on these steps when running under Jenkins, you might think of doing something like this in a Jenkinsfile:\r\n\r\n```\r\nstage('Build'} { sh 'gulp build' }\r\nstage('Test'} { sh 'gulp test' }\r\n// ...\r\n```\r\n\r\nIt's even more important for things like Docker, where accidentally running `docker build` in parallel increases build times (https://github.com/docker/docker/issues/9656), so you want to use Jenkins locks to prevent multiple docker steps running in parallel on the same node:\r\n\r\n ```\r\n// ...\r\nstage('Docker Build') {\r\n  lock('docker') { sh 'gulp docker-build' }\r\n}\r\n// ...\r\n```\r\n\r\nThe problem is that Gulp doesn't have an easy way of saying \"this task has already run\", and this means that running \"docker-build\" will cause \"build\" and \"test\" to run again, unless you add some sort of variant like `gulp docker-build-ignore-deps` (and then you need to do this for *every* task in your Gulpfile).  And while you want to skip these dependencies on a build server (where you know the previous steps have run), it's still very important that developers only have to do `gulp docker-build` to have everything work right.\r\n\r\nSo this is a feature request to be able to do something like:\r\n\r\n```\r\ngulp --assume-ran=test docker-build\r\n```\r\n\r\nwhich would effectively be the same as replacing the task declaration for test with:\r\n\r\n```\r\ngulp.task('test', []);\r\n```\r\n\r\nthat is to say, not only does `test` no longer have any behaviour for this run, but all of the dependencies that it would in-turn bring in are removed from that particular task.  That doesn't stop those other dependencies from being brought in if say, another step was also required for `docker-build` that brought them in though.\r\n\r\nI'm not quite sure where I would go about adding this to Gulp to submit a PR, since I'm not familiar with Gulp internals at all."}}
{"actor":{"display_login":"phated"}}