{"action":"created","issue":{"url":"https://api.github.com/repos/jenkinsci/pipeline-milestone-step-plugin/issues/1","repository_url":"https://api.github.com/repos/jenkinsci/pipeline-milestone-step-plugin","labels_url":"https://api.github.com/repos/jenkinsci/pipeline-milestone-step-plugin/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/jenkinsci/pipeline-milestone-step-plugin/issues/1/comments","events_url":"https://api.github.com/repos/jenkinsci/pipeline-milestone-step-plugin/issues/1/events","html_url":"https://github.com/jenkinsci/pipeline-milestone-step-plugin/pull/1","id":147555707,"number":1,"title":"[JENKINS-27039] New step: milestone","user":{"login":"amuniz","id":1017585,"avatar_url":"https://avatars.githubusercontent.com/u/1017585?v=3","gravatar_id":"","url":"https://api.github.com/users/amuniz","html_url":"https://github.com/amuniz","followers_url":"https://api.github.com/users/amuniz/followers","following_url":"https://api.github.com/users/amuniz/following{/other_user}","gists_url":"https://api.github.com/users/amuniz/gists{/gist_id}","starred_url":"https://api.github.com/users/amuniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amuniz/subscriptions","organizations_url":"https://api.github.com/users/amuniz/orgs","repos_url":"https://api.github.com/users/amuniz/repos","events_url":"https://api.github.com/users/amuniz/events{/privacy}","received_events_url":"https://api.github.com/users/amuniz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jenkinsci/pipeline-milestone-step-plugin/labels/work-in-progress","name":"work-in-progress","color":"B1C9F0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-11T21:09:40Z","updated_at":"2016-04-13T10:08:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jenkinsci/pipeline-milestone-step-plugin/pulls/1","html_url":"https://github.com/jenkinsci/pipeline-milestone-step-plugin/pull/1","diff_url":"https://github.com/jenkinsci/pipeline-milestone-step-plugin/pull/1.diff","patch_url":"https://github.com/jenkinsci/pipeline-milestone-step-plugin/pull/1.patch"},"body":"(Moved from https://github.com/jenkinsci/pipeline-plugin/pull/355)\r\n\r\nBased on discussion on [JENKINS-27039](https://issues.jenkins-ci.org/browse/JENKINS-27039) (and also covers [JENKINS-32829](https://issues.jenkins-ci.org/browse/JENKINS-32829)).\r\n\r\nThe implementation is based on the `stage` step code and @jglick's proposal in the linked JIRA. There is currently some duplicated code which will be there until `concurrency` is deprecated in `stage`.\r\n\r\nThis step has been designed to accomplish the following:\r\n 1. Builds pass through the `milestone` in order (taking the build number as sorter field).\r\n 1. Older builds will not proceed (they are aborted) if a newer one already entered the milestone.\r\n 1. Once a build passes a milestone, it will be never aborted by a newer build which did not reach the milestone yet.\r\n 1. Once a build passes a milestone, any older build that passed the previous milestone but not this one is aborted.\r\n\r\nI used this Pipeline script for manual testing (thanks @stephenc):\r\n\r\n```\r\nmilestone\r\nnode {\r\n    def delay = new Random().nextInt(60)\r\n    echo \"Sleeping for ${delay}s...\"\r\n    sleep time: delay, unit: 'SECONDS'\r\n}\r\nmilestone\r\nnode {\r\n    def delay = new Random().nextInt(60)\r\n    echo \"Sleeping for ${delay}s...\"\r\n    sleep time: delay, unit: 'SECONDS'\r\n}\r\n```\r\n\r\n- [x] Base implementation of `milestone` step\r\n- [x] Automated tests\r\n- [x] Clean up non existing `milestone`s in config file (`$JENKINS_HOME/org.jenkinsci.plugins.workflow.support.steps.MilestoneStep.xml`)\r\n- [ ] Update the CD stock demo to use `milestone` and `lock` in tandem (it requires upstream https://github.com/jenkinsci/lockable-resources-plugin/pull/25 to be merged and released)\r\n- [ ] Allow to specify the `ordinal` as a parameter (or auto-generate it otherwise)\r\n\r\n@reviewbybees "},"comment":{"url":"https://api.github.com/repos/jenkinsci/pipeline-milestone-step-plugin/issues/comments/209351533","html_url":"https://github.com/jenkinsci/pipeline-milestone-step-plugin/pull/1#issuecomment-209351533","issue_url":"https://api.github.com/repos/jenkinsci/pipeline-milestone-step-plugin/issues/1","id":209351533,"user":{"login":"amuniz","id":1017585,"avatar_url":"https://avatars.githubusercontent.com/u/1017585?v=3","gravatar_id":"","url":"https://api.github.com/users/amuniz","html_url":"https://github.com/amuniz","followers_url":"https://api.github.com/users/amuniz/followers","following_url":"https://api.github.com/users/amuniz/following{/other_user}","gists_url":"https://api.github.com/users/amuniz/gists{/gist_id}","starred_url":"https://api.github.com/users/amuniz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amuniz/subscriptions","organizations_url":"https://api.github.com/users/amuniz/orgs","repos_url":"https://api.github.com/users/amuniz/repos","events_url":"https://api.github.com/users/amuniz/events{/privacy}","received_events_url":"https://api.github.com/users/amuniz/received_events","type":"User","site_admin":false},"created_at":"2016-04-13T10:08:15Z","updated_at":"2016-04-13T10:08:15Z","body":"> I guess this is still a w[o]rk-in-progress \r\n\r\nYes, the last TODO was added later and forgot to add the label. Done."}}