{"action":"created","comment":{"url":"https://api.github.com/repos/lookout/deploydb/pulls/comments/27696528","id":27696528,"diff_hunk":"@@ -16,14 +16,143 @@ Feature: DeployDB config APIs\n \n \n   Scenario: If deployments are NOT verified i.e. are in progress, then attempt to reload\n-            config should fail. A deployment is considered as in progress, if the status\n+            config should succeed. A deployment is considered as in progress, if the status\n             is NOT SUCCESS or FAILED\n \n     Given there is a deployment\n+    And Models configuration directory path is \"./config\"\n     When I POST to \"/tasks/configReload\" from the admin app\n     Then the response should be 200\n     And the response body should be:\n     \"\"\"\n-    Failed: Configuration reload is not allowed while deployments are in progress\n+    Done!\n+    \"\"\"\n+\n+\n+  @freezetime\n+  Scenario: If deployment is CREATED state and configuration is reloaded, then\n+            a deployment update of STARTED state should invoke set of global webhook\n+            and environment webhook, as specified by the older config\n+    Given a deployment webhook \"started\" configuration:\n+    \"\"\"\n+      deployment:\n+        started:\n+           - http://localhost:10000/job/old-notify-deployment-started/build\n+    \"\"\"\n+    And an deployment environment webhook \"started\" configuration named \"pre-prod\":\n+    \"\"\"\n+    description: \"DeployDB Primary Integration\"\n+    webhooks:\n+      deployment:\n+        started:\n+          - http://localhost:10000/job/another-old-notify-deployment-started/build\n+    \"\"\"\n+    And there is a deployment in \"CREATED\" state\n+    And Models configuration is reloaded from directory path \"./config\"\n+    When I PATCH \"/api/deployments/1\" with:\n+    \"\"\"\n+      {\n+        \"status\" : \"STARTED\"\n+      }\n+    \"\"\"\n+    Then the webhook 1 should be invoked with the JSON:\n+    \"\"\"\n+      {\n+        \"id\" : 1,\n+        \"artifact\" : {\n+          \"id\" : 1,\n+          \"group\" : \"com.example.cucumber\",\n+          \"name\" : \"cucumber-artifact\",\n+          \"version\" : \"1.0.1\",\n+          \"sourceUrl\" : \"http://example.com/maven/com.example.cucumber/cucumber-artifact/1.0.1/cucumber-artifact-1.0.1.jar\",\n+          \"createdAt\" : \"{{created_timestamp}}\"\n+        },\n+        \"status\" : \"STARTED\",\n+        \"service\" : \"faas\",\n+        \"environment\" : \"pre-prod\",\n+        \"createdAt\" : \"{{created_timestamp}}\"\n+      }\n+    \"\"\"\n+    And the webhook 2 should be invoked with the JSON:\n+    \"\"\"\n+      {\n+        \"id\" : 1,\n+        \"artifact\" : {\n+          \"id\" : 1,\n+          \"group\" : \"com.example.cucumber\",\n+          \"name\" : \"cucumber-artifact\",\n+          \"version\" : \"1.0.1\",\n+          \"sourceUrl\" : \"http://example.com/maven/com.example.cucumber/cucumber-artifact/1.0.1/cucumber-artifact-1.0.1.jar\",\n+          \"createdAt\" : \"{{created_timestamp}}\"\n+        },\n+        \"status\" : \"STARTED\",\n+        \"service\" : \"faas\",\n+        \"environment\" : \"pre-prod\",\n+        \"createdAt\" : \"{{created_timestamp}}\"\n+      }\n+    \"\"\"\n+\n+\n+  @freezetime\n+  Scenario: If deployment is STARTED state and configuration is reloaded, then","path":"features/api/config.feature","position":93,"original_position":93,"commit_id":"d1cce09796765f7d02480b13955a536103c873e3","original_commit_id":"d1cce09796765f7d02480b13955a536103c873e3","user":{"login":"rtyler","id":26594,"avatar_url":"https://avatars.githubusercontent.com/u/26594?v=3","gravatar_id":"","url":"https://api.github.com/users/rtyler","html_url":"https://github.com/rtyler","followers_url":"https://api.github.com/users/rtyler/followers","following_url":"https://api.github.com/users/rtyler/following{/other_user}","gists_url":"https://api.github.com/users/rtyler/gists{/gist_id}","starred_url":"https://api.github.com/users/rtyler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtyler/subscriptions","organizations_url":"https://api.github.com/users/rtyler/orgs","repos_url":"https://api.github.com/users/rtyler/repos","events_url":"https://api.github.com/users/rtyler/events{/privacy}","received_events_url":"https://api.github.com/users/rtyler/received_events","type":"User","site_admin":false},"body":"ETOOLONG","created_at":"2015-04-02T20:58:50Z","updated_at":"2015-04-02T20:58:50Z","html_url":"https://github.com/lookout/deploydb/pull/141#discussion_r27696528","pull_request_url":"https://api.github.com/repos/lookout/deploydb/pulls/141","_links":{"self":{"href":"https://api.github.com/repos/lookout/deploydb/pulls/comments/27696528"},"html":{"href":"https://github.com/lookout/deploydb/pull/141#discussion_r27696528"},"pull_request":{"href":"https://api.github.com/repos/lookout/deploydb/pulls/141"}}},"pull_request":{"url":"https://api.github.com/repos/lookout/deploydb/pulls/141","id":32545020,"html_url":"https://github.com/lookout/deploydb/pull/141","diff_url":"https://github.com/lookout/deploydb/pull/141.diff","patch_url":"https://github.com/lookout/deploydb/pull/141.patch","issue_url":"https://api.github.com/repos/lookout/deploydb/issues/141","number":141,"state":"open","locked":false,"title":"Allow Models-config to change (configReload) while deployments are in progress","user":{"login":"maheshkelkar","id":10839177,"avatar_url":"https://avatars.githubusercontent.com/u/10839177?v=3","gravatar_id":"","url":"https://api.github.com/users/maheshkelkar","html_url":"https://github.com/maheshkelkar","followers_url":"https://api.github.com/users/maheshkelkar/followers","following_url":"https://api.github.com/users/maheshkelkar/following{/other_user}","gists_url":"https://api.github.com/users/maheshkelkar/gists{/gist_id}","starred_url":"https://api.github.com/users/maheshkelkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maheshkelkar/subscriptions","organizations_url":"https://api.github.com/users/maheshkelkar/orgs","repos_url":"https://api.github.com/users/maheshkelkar/repos","events_url":"https://api.github.com/users/maheshkelkar/events{/privacy}","received_events_url":"https://api.github.com/users/maheshkelkar/received_events","type":"User","site_admin":false},"body":"- Added ModelConfig model, DB table, etc to keep track of old configs.\r\n\r\n- Added checksum calculations to keep track of each configReload\r\n  iteration. This calculation reads all the directories and files\r\n  in a deterministic order and computes checksum, which should remain\r\n  same for given config on any platform.\r\n\r\n- The checksum is stored in the DeployDB app object as well Flow object\r\n  in order to associate them with the given iteration of config.\r\n\r\n- On the subsequent Flow/Deployment transitions, if checksum from the\r\n  Flow matches with that in the App object, then in-memory (i.e. registry)\r\n  Model objects are used. Otherwise Model objects are read from the\r\n  ModelConfig objects.\r\n\r\n- In loadConfigModels, moved code repetitions such as loading from\r\n  string, inserting into registry, checksum calculations, etc.\r\n  to common function\r\n\r\n- Added cucumber and spock tests to validate the code.\r\n\r\nReferences #126","created_at":"2015-04-02T20:02:55Z","updated_at":"2015-04-02T20:58:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"86f5d873330b67bad23fa5961060b75c322adea9","assignee":{"login":"rtyler","id":26594,"avatar_url":"https://avatars.githubusercontent.com/u/26594?v=3","gravatar_id":"","url":"https://api.github.com/users/rtyler","html_url":"https://github.com/rtyler","followers_url":"https://api.github.com/users/rtyler/followers","following_url":"https://api.github.com/users/rtyler/following{/other_user}","gists_url":"https://api.github.com/users/rtyler/gists{/gist_id}","starred_url":"https://api.github.com/users/rtyler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtyler/subscriptions","organizations_url":"https://api.github.com/users/rtyler/orgs","repos_url":"https://api.github.com/users/rtyler/repos","events_url":"https://api.github.com/users/rtyler/events{/privacy}","received_events_url":"https://api.github.com/users/rtyler/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/lookout/deploydb/milestones/3","html_url":"https://github.com/lookout/deploydb/milestones/0.3.0%20-%20Ares","labels_url":"https://api.github.com/repos/lookout/deploydb/milestones/3/labels","id":1026422,"number":3,"title":"0.3.0 - Ares","description":"The one with all the UI supporting work","creator":{"login":"rtyler","id":26594,"avatar_url":"https://avatars.githubusercontent.com/u/26594?v=3","gravatar_id":"","url":"https://api.github.com/users/rtyler","html_url":"https://github.com/rtyler","followers_url":"https://api.github.com/users/rtyler/followers","following_url":"https://api.github.com/users/rtyler/following{/other_user}","gists_url":"https://api.github.com/users/rtyler/gists{/gist_id}","starred_url":"https://api.github.com/users/rtyler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtyler/subscriptions","organizations_url":"https://api.github.com/users/rtyler/orgs","repos_url":"https://api.github.com/users/rtyler/repos","events_url":"https://api.github.com/users/rtyler/events{/privacy}","received_events_url":"https://api.github.com/users/rtyler/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":4,"state":"open","created_at":"2015-03-18T00:24:19Z","updated_at":"2015-04-02T20:04:22Z","due_on":"2015-04-03T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/lookout/deploydb/pulls/141/commits","review_comments_url":"https://api.github.com/repos/lookout/deploydb/pulls/141/comments","review_comment_url":"https://api.github.com/repos/lookout/deploydb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lookout/deploydb/issues/141/comments","statuses_url":"https://api.github.com/repos/lookout/deploydb/statuses/d1cce09796765f7d02480b13955a536103c873e3","head":{"label":"maheshkelkar:issues/126-allow-config-changes","ref":"issues/126-allow-config-changes","sha":"d1cce09796765f7d02480b13955a536103c873e3","user":{"login":"maheshkelkar","id":10839177,"avatar_url":"https://avatars.githubusercontent.com/u/10839177?v=3","gravatar_id":"","url":"https://api.github.com/users/maheshkelkar","html_url":"https://github.com/maheshkelkar","followers_url":"https://api.github.com/users/maheshkelkar/followers","following_url":"https://api.github.com/users/maheshkelkar/following{/other_user}","gists_url":"https://api.github.com/users/maheshkelkar/gists{/gist_id}","starred_url":"https://api.github.com/users/maheshkelkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maheshkelkar/subscriptions","organizations_url":"https://api.github.com/users/maheshkelkar/orgs","repos_url":"https://api.github.com/users/maheshkelkar/repos","events_url":"https://api.github.com/users/maheshkelkar/events{/privacy}","received_events_url":"https://api.github.com/users/maheshkelkar/received_events","type":"User","site_admin":false},"repo":{"id":30329363,"name":"deploydb","full_name":"maheshkelkar/deploydb","owner":{"login":"maheshkelkar","id":10839177,"avatar_url":"https://avatars.githubusercontent.com/u/10839177?v=3","gravatar_id":"","url":"https://api.github.com/users/maheshkelkar","html_url":"https://github.com/maheshkelkar","followers_url":"https://api.github.com/users/maheshkelkar/followers","following_url":"https://api.github.com/users/maheshkelkar/following{/other_user}","gists_url":"https://api.github.com/users/maheshkelkar/gists{/gist_id}","starred_url":"https://api.github.com/users/maheshkelkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maheshkelkar/subscriptions","organizations_url":"https://api.github.com/users/maheshkelkar/orgs","repos_url":"https://api.github.com/users/maheshkelkar/repos","events_url":"https://api.github.com/users/maheshkelkar/events{/privacy}","received_events_url":"https://api.github.com/users/maheshkelkar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maheshkelkar/deploydb","description":"Your deployments: who, what, where and when.","fork":true,"url":"https://api.github.com/repos/maheshkelkar/deploydb","forks_url":"https://api.github.com/repos/maheshkelkar/deploydb/forks","keys_url":"https://api.github.com/repos/maheshkelkar/deploydb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maheshkelkar/deploydb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maheshkelkar/deploydb/teams","hooks_url":"https://api.github.com/repos/maheshkelkar/deploydb/hooks","issue_events_url":"https://api.github.com/repos/maheshkelkar/deploydb/issues/events{/number}","events_url":"https://api.github.com/repos/maheshkelkar/deploydb/events","assignees_url":"https://api.github.com/repos/maheshkelkar/deploydb/assignees{/user}","branches_url":"https://api.github.com/repos/maheshkelkar/deploydb/branches{/branch}","tags_url":"https://api.github.com/repos/maheshkelkar/deploydb/tags","blobs_url":"https://api.github.com/repos/maheshkelkar/deploydb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maheshkelkar/deploydb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maheshkelkar/deploydb/git/refs{/sha}","trees_url":"https://api.github.com/repos/maheshkelkar/deploydb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maheshkelkar/deploydb/statuses/{sha}","languages_url":"https://api.github.com/repos/maheshkelkar/deploydb/languages","stargazers_url":"https://api.github.com/repos/maheshkelkar/deploydb/stargazers","contributors_url":"https://api.github.com/repos/maheshkelkar/deploydb/contributors","subscribers_url":"https://api.github.com/repos/maheshkelkar/deploydb/subscribers","subscription_url":"https://api.github.com/repos/maheshkelkar/deploydb/subscription","commits_url":"https://api.github.com/repos/maheshkelkar/deploydb/commits{/sha}","git_commits_url":"https://api.github.com/repos/maheshkelkar/deploydb/git/commits{/sha}","comments_url":"https://api.github.com/repos/maheshkelkar/deploydb/comments{/number}","issue_comment_url":"https://api.github.com/repos/maheshkelkar/deploydb/issues/comments{/number}","contents_url":"https://api.github.com/repos/maheshkelkar/deploydb/contents/{+path}","compare_url":"https://api.github.com/repos/maheshkelkar/deploydb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maheshkelkar/deploydb/merges","archive_url":"https://api.github.com/repos/maheshkelkar/deploydb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maheshkelkar/deploydb/downloads","issues_url":"https://api.github.com/repos/maheshkelkar/deploydb/issues{/number}","pulls_url":"https://api.github.com/repos/maheshkelkar/deploydb/pulls{/number}","milestones_url":"https://api.github.com/repos/maheshkelkar/deploydb/milestones{/number}","notifications_url":"https://api.github.com/repos/maheshkelkar/deploydb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maheshkelkar/deploydb/labels{/name}","releases_url":"https://api.github.com/repos/maheshkelkar/deploydb/releases{/id}","created_at":"2015-02-05T00:36:28Z","updated_at":"2015-02-05T00:36:29Z","pushed_at":"2015-04-02T20:37:14Z","git_url":"git://github.com/maheshkelkar/deploydb.git","ssh_url":"git@github.com:maheshkelkar/deploydb.git","clone_url":"https://github.com/maheshkelkar/deploydb.git","svn_url":"https://github.com/maheshkelkar/deploydb","homepage":"http://hackers.lookout.com/deploydb/","size":1462,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"lookout:master","ref":"master","sha":"b573f49474d19a42798bfd52d42f052874694719","user":{"login":"lookout","id":47237,"avatar_url":"https://avatars.githubusercontent.com/u/47237?v=3","gravatar_id":"","url":"https://api.github.com/users/lookout","html_url":"https://github.com/lookout","followers_url":"https://api.github.com/users/lookout/followers","following_url":"https://api.github.com/users/lookout/following{/other_user}","gists_url":"https://api.github.com/users/lookout/gists{/gist_id}","starred_url":"https://api.github.com/users/lookout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookout/subscriptions","organizations_url":"https://api.github.com/users/lookout/orgs","repos_url":"https://api.github.com/users/lookout/repos","events_url":"https://api.github.com/users/lookout/events{/privacy}","received_events_url":"https://api.github.com/users/lookout/received_events","type":"Organization","site_admin":false},"repo":{"id":28099382,"name":"deploydb","full_name":"lookout/deploydb","owner":{"login":"lookout","id":47237,"avatar_url":"https://avatars.githubusercontent.com/u/47237?v=3","gravatar_id":"","url":"https://api.github.com/users/lookout","html_url":"https://github.com/lookout","followers_url":"https://api.github.com/users/lookout/followers","following_url":"https://api.github.com/users/lookout/following{/other_user}","gists_url":"https://api.github.com/users/lookout/gists{/gist_id}","starred_url":"https://api.github.com/users/lookout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookout/subscriptions","organizations_url":"https://api.github.com/users/lookout/orgs","repos_url":"https://api.github.com/users/lookout/repos","events_url":"https://api.github.com/users/lookout/events{/privacy}","received_events_url":"https://api.github.com/users/lookout/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lookout/deploydb","description":"Your deployments: who, what, where and when.","fork":false,"url":"https://api.github.com/repos/lookout/deploydb","forks_url":"https://api.github.com/repos/lookout/deploydb/forks","keys_url":"https://api.github.com/repos/lookout/deploydb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lookout/deploydb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lookout/deploydb/teams","hooks_url":"https://api.github.com/repos/lookout/deploydb/hooks","issue_events_url":"https://api.github.com/repos/lookout/deploydb/issues/events{/number}","events_url":"https://api.github.com/repos/lookout/deploydb/events","assignees_url":"https://api.github.com/repos/lookout/deploydb/assignees{/user}","branches_url":"https://api.github.com/repos/lookout/deploydb/branches{/branch}","tags_url":"https://api.github.com/repos/lookout/deploydb/tags","blobs_url":"https://api.github.com/repos/lookout/deploydb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lookout/deploydb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lookout/deploydb/git/refs{/sha}","trees_url":"https://api.github.com/repos/lookout/deploydb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lookout/deploydb/statuses/{sha}","languages_url":"https://api.github.com/repos/lookout/deploydb/languages","stargazers_url":"https://api.github.com/repos/lookout/deploydb/stargazers","contributors_url":"https://api.github.com/repos/lookout/deploydb/contributors","subscribers_url":"https://api.github.com/repos/lookout/deploydb/subscribers","subscription_url":"https://api.github.com/repos/lookout/deploydb/subscription","commits_url":"https://api.github.com/repos/lookout/deploydb/commits{/sha}","git_commits_url":"https://api.github.com/repos/lookout/deploydb/git/commits{/sha}","comments_url":"https://api.github.com/repos/lookout/deploydb/comments{/number}","issue_comment_url":"https://api.github.com/repos/lookout/deploydb/issues/comments{/number}","contents_url":"https://api.github.com/repos/lookout/deploydb/contents/{+path}","compare_url":"https://api.github.com/repos/lookout/deploydb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lookout/deploydb/merges","archive_url":"https://api.github.com/repos/lookout/deploydb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lookout/deploydb/downloads","issues_url":"https://api.github.com/repos/lookout/deploydb/issues{/number}","pulls_url":"https://api.github.com/repos/lookout/deploydb/pulls{/number}","milestones_url":"https://api.github.com/repos/lookout/deploydb/milestones{/number}","notifications_url":"https://api.github.com/repos/lookout/deploydb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lookout/deploydb/labels{/name}","releases_url":"https://api.github.com/repos/lookout/deploydb/releases{/id}","created_at":"2014-12-16T18:04:06Z","updated_at":"2015-04-01T19:44:56Z","pushed_at":"2015-04-02T20:38:33Z","git_url":"git://github.com/lookout/deploydb.git","ssh_url":"git@github.com:lookout/deploydb.git","clone_url":"https://github.com/lookout/deploydb.git","svn_url":"https://github.com/lookout/deploydb","homepage":"http://hackers.lookout.com/deploydb/","size":2305,"stargazers_count":37,"watchers_count":37,"language":"Groovy","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":19,"forks":7,"open_issues":19,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lookout/deploydb/pulls/141"},"html":{"href":"https://github.com/lookout/deploydb/pull/141"},"issue":{"href":"https://api.github.com/repos/lookout/deploydb/issues/141"},"comments":{"href":"https://api.github.com/repos/lookout/deploydb/issues/141/comments"},"review_comments":{"href":"https://api.github.com/repos/lookout/deploydb/pulls/141/comments"},"review_comment":{"href":"https://api.github.com/repos/lookout/deploydb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lookout/deploydb/pulls/141/commits"},"statuses":{"href":"https://api.github.com/repos/lookout/deploydb/statuses/d1cce09796765f7d02480b13955a536103c873e3"}}}}