{"action":"created","comment":{"url":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments/180807995","pull_request_review_id":111295311,"id":180807995,"diff_hunk":"@@ -37,7 +37,11 @@ let test_rpc ~__context call =\n   | name, params ->\n      failwith (Printf.sprintf \"Unexpected RPC: %s(%s)\" name (String.concat \" \" (List.map Rpc.to_string params)))\n \n-let create_cluster ~__context =\n+let create_cluster ~__context ?cluster_stack () =\n+  let cluster_stack = match cluster_stack with","path":"ocaml/tests/test_cluster.ml","position":6,"original_position":6,"commit_id":"edd33c9b2359ce2abcdb35973ba7fe813ba86477","original_commit_id":"edd33c9b2359ce2abcdb35973ba7fe813ba86477","user":{"login":"edwintorok","id":721894,"avatar_url":"https://avatars1.githubusercontent.com/u/721894?v=4","gravatar_id":"","url":"https://api.github.com/users/edwintorok","html_url":"https://github.com/edwintorok","followers_url":"https://api.github.com/users/edwintorok/followers","following_url":"https://api.github.com/users/edwintorok/following{/other_user}","gists_url":"https://api.github.com/users/edwintorok/gists{/gist_id}","starred_url":"https://api.github.com/users/edwintorok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwintorok/subscriptions","organizations_url":"https://api.github.com/users/edwintorok/orgs","repos_url":"https://api.github.com/users/edwintorok/repos","events_url":"https://api.github.com/users/edwintorok/events{/privacy}","received_events_url":"https://api.github.com/users/edwintorok/received_events","type":"User","site_admin":false},"body":"You can use ?(cluster_stack=Constants.default_smapiv3_cluster_stack) instead of this match","created_at":"2018-04-11T15:58:09Z","updated_at":"2018-04-11T16:01:58Z","html_url":"https://github.com/xapi-project/xen-api/pull/3554#discussion_r180807995","pull_request_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/3554","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments/180807995"},"html":{"href":"https://github.com/xapi-project/xen-api/pull/3554#discussion_r180807995"},"pull_request":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/3554"}}},"pull_request":{"url":"https://api.github.com/repos/xapi-project/xen-api/pulls/3554","id":180946030,"html_url":"https://github.com/xapi-project/xen-api/pull/3554","diff_url":"https://github.com/xapi-project/xen-api/pull/3554.diff","patch_url":"https://github.com/xapi-project/xen-api/pull/3554.patch","issue_url":"https://api.github.com/repos/xapi-project/xen-api/issues/3554","number":3554,"state":"open","locked":false,"title":"CA-287854: Check for valid cluster_stack in Cluster.create","user":{"login":"minishrink","id":16429238,"avatar_url":"https://avatars1.githubusercontent.com/u/16429238?v=4","gravatar_id":"","url":"https://api.github.com/users/minishrink","html_url":"https://github.com/minishrink","followers_url":"https://api.github.com/users/minishrink/followers","following_url":"https://api.github.com/users/minishrink/following{/other_user}","gists_url":"https://api.github.com/users/minishrink/gists{/gist_id}","starred_url":"https://api.github.com/users/minishrink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minishrink/subscriptions","organizations_url":"https://api.github.com/users/minishrink/orgs","repos_url":"https://api.github.com/users/minishrink/repos","events_url":"https://api.github.com/users/minishrink/events{/privacy}","received_events_url":"https://api.github.com/users/minishrink/received_events","type":"User","site_admin":false},"body":"This PR addresses two issues:\r\n- prevents users from creating a cluster with an invalid cluster_stack, or a 'valid' one (currently `xhad`) that might cause confusion in any HA or clustering checks\r\n- cuts down on hardcoding cluster stacks in tests and other Xapi code to keep code maintainable if support for additional cluster stacks is added\r\n\r\nby doing the following:\r\n- defining constant values for cluster_stack comparison\r\n- - `default_smapiv3_cluster_stack = \"corosync\"`\r\n- - `supported_smapiv3_cluster_stacks = [ \"corosync\" ]`\r\n- introducing the API error `invalid_cluster_stack` for any supplied cluster_stacks not found in the above list\r\n- adding a test to catch this error\r\n- replacing hardcoded `\"corosync\"` references with the constant","created_at":"2018-04-11T15:39:00Z","updated_at":"2018-04-11T16:01:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b2adf9168a29cb4129c15dbec0401ea931dceeb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/3554/commits","review_comments_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/3554/comments","review_comment_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xapi-project/xen-api/issues/3554/comments","statuses_url":"https://api.github.com/repos/xapi-project/xen-api/statuses/edd33c9b2359ce2abcdb35973ba7fe813ba86477","head":{"label":"minishrink:feature/REQ477/CA-287854","ref":"feature/REQ477/CA-287854","sha":"edd33c9b2359ce2abcdb35973ba7fe813ba86477","user":{"login":"minishrink","id":16429238,"avatar_url":"https://avatars1.githubusercontent.com/u/16429238?v=4","gravatar_id":"","url":"https://api.github.com/users/minishrink","html_url":"https://github.com/minishrink","followers_url":"https://api.github.com/users/minishrink/followers","following_url":"https://api.github.com/users/minishrink/following{/other_user}","gists_url":"https://api.github.com/users/minishrink/gists{/gist_id}","starred_url":"https://api.github.com/users/minishrink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minishrink/subscriptions","organizations_url":"https://api.github.com/users/minishrink/orgs","repos_url":"https://api.github.com/users/minishrink/repos","events_url":"https://api.github.com/users/minishrink/events{/privacy}","received_events_url":"https://api.github.com/users/minishrink/received_events","type":"User","site_admin":false},"repo":{"id":99582590,"name":"xen-api","full_name":"minishrink/xen-api","owner":{"login":"minishrink","id":16429238,"avatar_url":"https://avatars1.githubusercontent.com/u/16429238?v=4","gravatar_id":"","url":"https://api.github.com/users/minishrink","html_url":"https://github.com/minishrink","followers_url":"https://api.github.com/users/minishrink/followers","following_url":"https://api.github.com/users/minishrink/following{/other_user}","gists_url":"https://api.github.com/users/minishrink/gists{/gist_id}","starred_url":"https://api.github.com/users/minishrink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minishrink/subscriptions","organizations_url":"https://api.github.com/users/minishrink/orgs","repos_url":"https://api.github.com/users/minishrink/repos","events_url":"https://api.github.com/users/minishrink/events{/privacy}","received_events_url":"https://api.github.com/users/minishrink/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/minishrink/xen-api","description":"The Xapi Project's XenAPI Server","fork":true,"url":"https://api.github.com/repos/minishrink/xen-api","forks_url":"https://api.github.com/repos/minishrink/xen-api/forks","keys_url":"https://api.github.com/repos/minishrink/xen-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/minishrink/xen-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/minishrink/xen-api/teams","hooks_url":"https://api.github.com/repos/minishrink/xen-api/hooks","issue_events_url":"https://api.github.com/repos/minishrink/xen-api/issues/events{/number}","events_url":"https://api.github.com/repos/minishrink/xen-api/events","assignees_url":"https://api.github.com/repos/minishrink/xen-api/assignees{/user}","branches_url":"https://api.github.com/repos/minishrink/xen-api/branches{/branch}","tags_url":"https://api.github.com/repos/minishrink/xen-api/tags","blobs_url":"https://api.github.com/repos/minishrink/xen-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/minishrink/xen-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/minishrink/xen-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/minishrink/xen-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/minishrink/xen-api/statuses/{sha}","languages_url":"https://api.github.com/repos/minishrink/xen-api/languages","stargazers_url":"https://api.github.com/repos/minishrink/xen-api/stargazers","contributors_url":"https://api.github.com/repos/minishrink/xen-api/contributors","subscribers_url":"https://api.github.com/repos/minishrink/xen-api/subscribers","subscription_url":"https://api.github.com/repos/minishrink/xen-api/subscription","commits_url":"https://api.github.com/repos/minishrink/xen-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/minishrink/xen-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/minishrink/xen-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/minishrink/xen-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/minishrink/xen-api/contents/{+path}","compare_url":"https://api.github.com/repos/minishrink/xen-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/minishrink/xen-api/merges","archive_url":"https://api.github.com/repos/minishrink/xen-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/minishrink/xen-api/downloads","issues_url":"https://api.github.com/repos/minishrink/xen-api/issues{/number}","pulls_url":"https://api.github.com/repos/minishrink/xen-api/pulls{/number}","milestones_url":"https://api.github.com/repos/minishrink/xen-api/milestones{/number}","notifications_url":"https://api.github.com/repos/minishrink/xen-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/minishrink/xen-api/labels{/name}","releases_url":"https://api.github.com/repos/minishrink/xen-api/releases{/id}","deployments_url":"https://api.github.com/repos/minishrink/xen-api/deployments","created_at":"2017-08-07T13:45:59Z","updated_at":"2018-03-22T10:23:17Z","pushed_at":"2018-04-11T15:52:47Z","git_url":"git://github.com/minishrink/xen-api.git","ssh_url":"git@github.com:minishrink/xen-api.git","clone_url":"https://github.com/minishrink/xen-api.git","svn_url":"https://github.com/minishrink/xen-api","homepage":"http://xenproject.org/developers/teams/xapi.html","size":30604,"stargazers_count":0,"watchers_count":0,"language":"OCaml","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xapi-project:master","ref":"master","sha":"553300cc041daf09c7afefde988993016d5f5d42","user":{"login":"xapi-project","id":317268,"avatar_url":"https://avatars3.githubusercontent.com/u/317268?v=4","gravatar_id":"","url":"https://api.github.com/users/xapi-project","html_url":"https://github.com/xapi-project","followers_url":"https://api.github.com/users/xapi-project/followers","following_url":"https://api.github.com/users/xapi-project/following{/other_user}","gists_url":"https://api.github.com/users/xapi-project/gists{/gist_id}","starred_url":"https://api.github.com/users/xapi-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapi-project/subscriptions","organizations_url":"https://api.github.com/users/xapi-project/orgs","repos_url":"https://api.github.com/users/xapi-project/repos","events_url":"https://api.github.com/users/xapi-project/events{/privacy}","received_events_url":"https://api.github.com/users/xapi-project/received_events","type":"Organization","site_admin":false},"repo":{"id":960233,"name":"xen-api","full_name":"xapi-project/xen-api","owner":{"login":"xapi-project","id":317268,"avatar_url":"https://avatars3.githubusercontent.com/u/317268?v=4","gravatar_id":"","url":"https://api.github.com/users/xapi-project","html_url":"https://github.com/xapi-project","followers_url":"https://api.github.com/users/xapi-project/followers","following_url":"https://api.github.com/users/xapi-project/following{/other_user}","gists_url":"https://api.github.com/users/xapi-project/gists{/gist_id}","starred_url":"https://api.github.com/users/xapi-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapi-project/subscriptions","organizations_url":"https://api.github.com/users/xapi-project/orgs","repos_url":"https://api.github.com/users/xapi-project/repos","events_url":"https://api.github.com/users/xapi-project/events{/privacy}","received_events_url":"https://api.github.com/users/xapi-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xapi-project/xen-api","description":"The Xapi Project's XenAPI Server","fork":false,"url":"https://api.github.com/repos/xapi-project/xen-api","forks_url":"https://api.github.com/repos/xapi-project/xen-api/forks","keys_url":"https://api.github.com/repos/xapi-project/xen-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xapi-project/xen-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xapi-project/xen-api/teams","hooks_url":"https://api.github.com/repos/xapi-project/xen-api/hooks","issue_events_url":"https://api.github.com/repos/xapi-project/xen-api/issues/events{/number}","events_url":"https://api.github.com/repos/xapi-project/xen-api/events","assignees_url":"https://api.github.com/repos/xapi-project/xen-api/assignees{/user}","branches_url":"https://api.github.com/repos/xapi-project/xen-api/branches{/branch}","tags_url":"https://api.github.com/repos/xapi-project/xen-api/tags","blobs_url":"https://api.github.com/repos/xapi-project/xen-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xapi-project/xen-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xapi-project/xen-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/xapi-project/xen-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xapi-project/xen-api/statuses/{sha}","languages_url":"https://api.github.com/repos/xapi-project/xen-api/languages","stargazers_url":"https://api.github.com/repos/xapi-project/xen-api/stargazers","contributors_url":"https://api.github.com/repos/xapi-project/xen-api/contributors","subscribers_url":"https://api.github.com/repos/xapi-project/xen-api/subscribers","subscription_url":"https://api.github.com/repos/xapi-project/xen-api/subscription","commits_url":"https://api.github.com/repos/xapi-project/xen-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/xapi-project/xen-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/xapi-project/xen-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/xapi-project/xen-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/xapi-project/xen-api/contents/{+path}","compare_url":"https://api.github.com/repos/xapi-project/xen-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xapi-project/xen-api/merges","archive_url":"https://api.github.com/repos/xapi-project/xen-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xapi-project/xen-api/downloads","issues_url":"https://api.github.com/repos/xapi-project/xen-api/issues{/number}","pulls_url":"https://api.github.com/repos/xapi-project/xen-api/pulls{/number}","milestones_url":"https://api.github.com/repos/xapi-project/xen-api/milestones{/number}","notifications_url":"https://api.github.com/repos/xapi-project/xen-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xapi-project/xen-api/labels{/name}","releases_url":"https://api.github.com/repos/xapi-project/xen-api/releases{/id}","deployments_url":"https://api.github.com/repos/xapi-project/xen-api/deployments","created_at":"2010-10-04T10:52:57Z","updated_at":"2018-04-11T15:11:54Z","pushed_at":"2018-04-11T15:52:49Z","git_url":"git://github.com/xapi-project/xen-api.git","ssh_url":"git@github.com:xapi-project/xen-api.git","clone_url":"https://github.com/xapi-project/xen-api.git","svn_url":"https://github.com/xapi-project/xen-api","homepage":"http://xenproject.org/developers/teams/xapi.html","size":32666,"stargazers_count":254,"watchers_count":254,"language":"OCaml","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":204,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":204,"open_issues":18,"watchers":254,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/3554"},"html":{"href":"https://github.com/xapi-project/xen-api/pull/3554"},"issue":{"href":"https://api.github.com/repos/xapi-project/xen-api/issues/3554"},"comments":{"href":"https://api.github.com/repos/xapi-project/xen-api/issues/3554/comments"},"review_comments":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/3554/comments"},"review_comment":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/3554/commits"},"statuses":{"href":"https://api.github.com/repos/xapi-project/xen-api/statuses/edd33c9b2359ce2abcdb35973ba7fe813ba86477"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"edwintorok"}}