{"action":"created","comment":{"url":"https://api.github.com/repos/open-io/oio-sds/pulls/comments/204367166","pull_request_review_id":139432602,"id":204367166,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDM2NzE2Ng==","diff_hunk":"@@ -0,0 +1,373 @@\n+// OpenIO SDS Go rawx\n+// Copyright (C) 2015-2018 OpenIO SAS\n+//\n+// This library is free software; you can redistribute it and/or\n+// modify it under the terms of the GNU Lesser General Public\n+// License as published by the Free Software Foundation; either\n+// version 3.0 of the License, or (at your option) any later version.\n+//\n+// This library is distributed in the hope that it will be useful,\n+// but WITHOUT ANY WARRANTY; without even the implied warranty of\n+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+// Lesser General Public License for more details.\n+//\n+// You should have received a copy of the GNU Affero General Public\n+// License along with this program. If not, see <http://www.gnu.org/licenses/>.\n+\n+package main\n+\n+import (\n+\t\"bytes\"\n+\t\"container/list\"\n+\t\"errors\"\n+\t\"io/ioutil\"\n+\t\"log\"\n+\t\"os\"\n+\t\"path/filepath\"\n+\t\"strings\"\n+\t\"syscall\"\n+)\n+\n+const (\n+\thashWidth    = 3\n+\thashDepth    = 1\n+\tputOpenFlags = os.O_WRONLY | os.O_CREATE | os.O_EXCL\n+\tputOpenMode  = 0644\n+\tputMkdirMode = 0755\n+)\n+\n+type NoopNotifier struct{}\n+\n+func (self *NoopNotifier) NotifyPut(n string) {}\n+func (self *NoopNotifier) NotifyDel(n string) {}\n+\n+type Notifier interface {\n+\tNotifyPut(name string)\n+\tNotifyDel(name string)\n+}\n+\n+type FileRepository struct {\n+\tnotifier       Notifier\n+\troot           string\n+\tputOpenMode    os.FileMode\n+\tputMkdirMode   os.FileMode\n+\tHashWidth      int\n+\tHashDepth      int\n+\tputOpenFlags   int\n+\tsync_file      bool\n+\tsync_dir       bool\n+\tfallocate_file bool\n+}\n+\n+func MakeFileRepository(root string, notifier Notifier) *FileRepository {\n+\tr := new(FileRepository)\n+\tif notifier == nil {\n+\t\tr.notifier = &NoopNotifier{}\n+\t} else {\n+\t\tr.notifier = notifier\n+\t}\n+\tr.root = root\n+\tr.HashWidth = hashWidth\n+\tr.HashDepth = hashDepth\n+\tr.putOpenFlags = putOpenFlags\n+\tr.putOpenMode = putOpenMode\n+\tr.putMkdirMode = putMkdirMode\n+\tr.sync_file = false\n+\tr.sync_dir = true\n+\n+\treturn r\n+}\n+\n+func setOrHasXattr(path, n, v string) error {\n+\tif err := syscall.Setxattr(path, n, []byte(v), 1); err == nil {\n+\t\treturn nil\n+\t} else if !os.IsExist(err) {\n+\t\treturn err\n+\t}\n+\ttab := make([]byte, 256)\n+\tsz, err := syscall.Getxattr(path, n, tab)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tif bytes.Equal([]byte(v), tab[:sz]) {\n+\t\treturn nil\n+\t} else {\n+\t\treturn errors.New(\"XATTR mismatch\")\n+\t}\n+}\n+\n+func (r *FileRepository) Lock(ns, url string) error {\n+\tvar err error\n+\terr = setOrHasXattr(r.root, \"user.rawx_server.address\", url)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\terr = setOrHasXattr(r.root, \"user.rawx_server.namespace\", ns)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\treturn nil","path":"rawx/filerepo.go","position":109,"original_position":109,"commit_id":"ea2b3d36dfcd13adbc441feafdb340065baed9ad","original_commit_id":"7efe9f0d676c0ed97d4cb4036901d3523ad44a69","user":{"login":"jfsmig","id":2921642,"node_id":"MDQ6VXNlcjI5MjE2NDI=","avatar_url":"https://avatars0.githubusercontent.com/u/2921642?v=4","gravatar_id":"","url":"https://api.github.com/users/jfsmig","html_url":"https://github.com/jfsmig","followers_url":"https://api.github.com/users/jfsmig/followers","following_url":"https://api.github.com/users/jfsmig/following{/other_user}","gists_url":"https://api.github.com/users/jfsmig/gists{/gist_id}","starred_url":"https://api.github.com/users/jfsmig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfsmig/subscriptions","organizations_url":"https://api.github.com/users/jfsmig/orgs","repos_url":"https://api.github.com/users/jfsmig/repos","events_url":"https://api.github.com/users/jfsmig/events{/privacy}","received_events_url":"https://api.github.com/users/jfsmig/received_events","type":"User","site_admin":false},"body":"To be honest, this should even receive a custom test case!","created_at":"2018-07-23T11:29:17Z","updated_at":"2018-07-23T11:29:18Z","html_url":"https://github.com/open-io/oio-sds/pull/1527#discussion_r204367166","pull_request_url":"https://api.github.com/repos/open-io/oio-sds/pulls/1527","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/open-io/oio-sds/pulls/comments/204367166"},"html":{"href":"https://github.com/open-io/oio-sds/pull/1527#discussion_r204367166"},"pull_request":{"href":"https://api.github.com/repos/open-io/oio-sds/pulls/1527"}},"in_reply_to_id":204092818},"pull_request":{"url":"https://api.github.com/repos/open-io/oio-sds/pulls/1527","id":202834071,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyODM0MDcx","html_url":"https://github.com/open-io/oio-sds/pull/1527","diff_url":"https://github.com/open-io/oio-sds/pull/1527.diff","patch_url":"https://github.com/open-io/oio-sds/pull/1527.patch","issue_url":"https://api.github.com/repos/open-io/oio-sds/issues/1527","number":1527,"state":"open","locked":false,"title":"Draft a pure Go rawx","user":{"login":"jfsmig","id":2921642,"node_id":"MDQ6VXNlcjI5MjE2NDI=","avatar_url":"https://avatars0.githubusercontent.com/u/2921642?v=4","gravatar_id":"","url":"https://api.github.com/users/jfsmig","html_url":"https://github.com/jfsmig","followers_url":"https://api.github.com/users/jfsmig/followers","following_url":"https://api.github.com/users/jfsmig/following{/other_user}","gists_url":"https://api.github.com/users/jfsmig/gists{/gist_id}","starred_url":"https://api.github.com/users/jfsmig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfsmig/subscriptions","organizations_url":"https://api.github.com/users/jfsmig/orgs","repos_url":"https://api.github.com/users/jfsmig/repos","events_url":"https://api.github.com/users/jfsmig/events{/privacy}","received_events_url":"https://api.github.com/users/jfsmig/received_events","type":"User","site_admin":false},"body":"##### SUMMARY\r\nAdd an initial (and partial) implementation of a Golang version of the rawx service.\r\n\r\n##### ISSUE TYPE\r\n`enhancement`\r\n\r\n##### COMPONENT NAME\r\n`rawx`\r\n\r\n##### SDS VERSION\r\n`4.3.0`\r\n\r\n##### ADDITIONAL INFORMATION\r\nHopefully:\r\n* PUT/GET/DELETE should be nearly functional\r\n\r\nSadly:\r\n* The current rawx is not subject to the CI functional tests\r\n* ~We do not check `go` is available, during the build process~\r\n* ~No configuration file is read at strartup~\r\n* The log format doesn't follow the standard\r\n* No signal is managed as it is done in other services\r\n* The central configuration is not considered\r\n\r\n","created_at":"2018-07-20T12:24:33Z","updated_at":"2018-07-23T11:29:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"604185131621434ce59bf230a22dccc31fbaa5c5","assignee":null,"assignees":[],"requested_reviewers":[{"login":"AymericDu","id":7973460,"node_id":"MDQ6VXNlcjc5NzM0NjA=","avatar_url":"https://avatars2.githubusercontent.com/u/7973460?v=4","gravatar_id":"","url":"https://api.github.com/users/AymericDu","html_url":"https://github.com/AymericDu","followers_url":"https://api.github.com/users/AymericDu/followers","following_url":"https://api.github.com/users/AymericDu/following{/other_user}","gists_url":"https://api.github.com/users/AymericDu/gists{/gist_id}","starred_url":"https://api.github.com/users/AymericDu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AymericDu/subscriptions","organizations_url":"https://api.github.com/users/AymericDu/orgs","repos_url":"https://api.github.com/users/AymericDu/repos","events_url":"https://api.github.com/users/AymericDu/events{/privacy}","received_events_url":"https://api.github.com/users/AymericDu/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/open-io/oio-sds/pulls/1527/commits","review_comments_url":"https://api.github.com/repos/open-io/oio-sds/pulls/1527/comments","review_comment_url":"https://api.github.com/repos/open-io/oio-sds/pulls/comments{/number}","comments_url":"https://api.github.com/repos/open-io/oio-sds/issues/1527/comments","statuses_url":"https://api.github.com/repos/open-io/oio-sds/statuses/ea2b3d36dfcd13adbc441feafdb340065baed9ad","head":{"label":"jfsmig:4.x-rawx-v2","ref":"4.x-rawx-v2","sha":"ea2b3d36dfcd13adbc441feafdb340065baed9ad","user":{"login":"jfsmig","id":2921642,"node_id":"MDQ6VXNlcjI5MjE2NDI=","avatar_url":"https://avatars0.githubusercontent.com/u/2921642?v=4","gravatar_id":"","url":"https://api.github.com/users/jfsmig","html_url":"https://github.com/jfsmig","followers_url":"https://api.github.com/users/jfsmig/followers","following_url":"https://api.github.com/users/jfsmig/following{/other_user}","gists_url":"https://api.github.com/users/jfsmig/gists{/gist_id}","starred_url":"https://api.github.com/users/jfsmig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfsmig/subscriptions","organizations_url":"https://api.github.com/users/jfsmig/orgs","repos_url":"https://api.github.com/users/jfsmig/repos","events_url":"https://api.github.com/users/jfsmig/events{/privacy}","received_events_url":"https://api.github.com/users/jfsmig/received_events","type":"User","site_admin":false},"repo":{"id":32326040,"node_id":"MDEwOlJlcG9zaXRvcnkzMjMyNjA0MA==","name":"oio-sds","full_name":"jfsmig/oio-sds","owner":{"login":"jfsmig","id":2921642,"node_id":"MDQ6VXNlcjI5MjE2NDI=","avatar_url":"https://avatars0.githubusercontent.com/u/2921642?v=4","gravatar_id":"","url":"https://api.github.com/users/jfsmig","html_url":"https://github.com/jfsmig","followers_url":"https://api.github.com/users/jfsmig/followers","following_url":"https://api.github.com/users/jfsmig/following{/other_user}","gists_url":"https://api.github.com/users/jfsmig/gists{/gist_id}","starred_url":"https://api.github.com/users/jfsmig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfsmig/subscriptions","organizations_url":"https://api.github.com/users/jfsmig/orgs","repos_url":"https://api.github.com/users/jfsmig/repos","events_url":"https://api.github.com/users/jfsmig/events{/privacy}","received_events_url":"https://api.github.com/users/jfsmig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jfsmig/oio-sds","description":"OpenIO Software Defined Storage","fork":true,"url":"https://api.github.com/repos/jfsmig/oio-sds","forks_url":"https://api.github.com/repos/jfsmig/oio-sds/forks","keys_url":"https://api.github.com/repos/jfsmig/oio-sds/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jfsmig/oio-sds/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jfsmig/oio-sds/teams","hooks_url":"https://api.github.com/repos/jfsmig/oio-sds/hooks","issue_events_url":"https://api.github.com/repos/jfsmig/oio-sds/issues/events{/number}","events_url":"https://api.github.com/repos/jfsmig/oio-sds/events","assignees_url":"https://api.github.com/repos/jfsmig/oio-sds/assignees{/user}","branches_url":"https://api.github.com/repos/jfsmig/oio-sds/branches{/branch}","tags_url":"https://api.github.com/repos/jfsmig/oio-sds/tags","blobs_url":"https://api.github.com/repos/jfsmig/oio-sds/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jfsmig/oio-sds/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jfsmig/oio-sds/git/refs{/sha}","trees_url":"https://api.github.com/repos/jfsmig/oio-sds/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jfsmig/oio-sds/statuses/{sha}","languages_url":"https://api.github.com/repos/jfsmig/oio-sds/languages","stargazers_url":"https://api.github.com/repos/jfsmig/oio-sds/stargazers","contributors_url":"https://api.github.com/repos/jfsmig/oio-sds/contributors","subscribers_url":"https://api.github.com/repos/jfsmig/oio-sds/subscribers","subscription_url":"https://api.github.com/repos/jfsmig/oio-sds/subscription","commits_url":"https://api.github.com/repos/jfsmig/oio-sds/commits{/sha}","git_commits_url":"https://api.github.com/repos/jfsmig/oio-sds/git/commits{/sha}","comments_url":"https://api.github.com/repos/jfsmig/oio-sds/comments{/number}","issue_comment_url":"https://api.github.com/repos/jfsmig/oio-sds/issues/comments{/number}","contents_url":"https://api.github.com/repos/jfsmig/oio-sds/contents/{+path}","compare_url":"https://api.github.com/repos/jfsmig/oio-sds/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jfsmig/oio-sds/merges","archive_url":"https://api.github.com/repos/jfsmig/oio-sds/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jfsmig/oio-sds/downloads","issues_url":"https://api.github.com/repos/jfsmig/oio-sds/issues{/number}","pulls_url":"https://api.github.com/repos/jfsmig/oio-sds/pulls{/number}","milestones_url":"https://api.github.com/repos/jfsmig/oio-sds/milestones{/number}","notifications_url":"https://api.github.com/repos/jfsmig/oio-sds/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jfsmig/oio-sds/labels{/name}","releases_url":"https://api.github.com/repos/jfsmig/oio-sds/releases{/id}","deployments_url":"https://api.github.com/repos/jfsmig/oio-sds/deployments","created_at":"2015-03-16T13:18:19Z","updated_at":"2018-05-16T09:16:43Z","pushed_at":"2018-07-23T11:16:18Z","git_url":"git://github.com/jfsmig/oio-sds.git","ssh_url":"git@github.com:jfsmig/oio-sds.git","clone_url":"https://github.com/jfsmig/oio-sds.git","svn_url":"https://github.com/jfsmig/oio-sds","homepage":null,"size":16447,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"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,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"open-io:4.x","ref":"4.x","sha":"0d0a649426ba2d557b59de1df7818273cb335884","user":{"login":"open-io","id":11300184,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMzAwMTg0","avatar_url":"https://avatars1.githubusercontent.com/u/11300184?v=4","gravatar_id":"","url":"https://api.github.com/users/open-io","html_url":"https://github.com/open-io","followers_url":"https://api.github.com/users/open-io/followers","following_url":"https://api.github.com/users/open-io/following{/other_user}","gists_url":"https://api.github.com/users/open-io/gists{/gist_id}","starred_url":"https://api.github.com/users/open-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-io/subscriptions","organizations_url":"https://api.github.com/users/open-io/orgs","repos_url":"https://api.github.com/users/open-io/repos","events_url":"https://api.github.com/users/open-io/events{/privacy}","received_events_url":"https://api.github.com/users/open-io/received_events","type":"Organization","site_admin":false},"repo":{"id":32169193,"node_id":"MDEwOlJlcG9zaXRvcnkzMjE2OTE5Mw==","name":"oio-sds","full_name":"open-io/oio-sds","owner":{"login":"open-io","id":11300184,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMzAwMTg0","avatar_url":"https://avatars1.githubusercontent.com/u/11300184?v=4","gravatar_id":"","url":"https://api.github.com/users/open-io","html_url":"https://github.com/open-io","followers_url":"https://api.github.com/users/open-io/followers","following_url":"https://api.github.com/users/open-io/following{/other_user}","gists_url":"https://api.github.com/users/open-io/gists{/gist_id}","starred_url":"https://api.github.com/users/open-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-io/subscriptions","organizations_url":"https://api.github.com/users/open-io/orgs","repos_url":"https://api.github.com/users/open-io/repos","events_url":"https://api.github.com/users/open-io/events{/privacy}","received_events_url":"https://api.github.com/users/open-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-io/oio-sds","description":"OpenIO Software Defined Storage","fork":false,"url":"https://api.github.com/repos/open-io/oio-sds","forks_url":"https://api.github.com/repos/open-io/oio-sds/forks","keys_url":"https://api.github.com/repos/open-io/oio-sds/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-io/oio-sds/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-io/oio-sds/teams","hooks_url":"https://api.github.com/repos/open-io/oio-sds/hooks","issue_events_url":"https://api.github.com/repos/open-io/oio-sds/issues/events{/number}","events_url":"https://api.github.com/repos/open-io/oio-sds/events","assignees_url":"https://api.github.com/repos/open-io/oio-sds/assignees{/user}","branches_url":"https://api.github.com/repos/open-io/oio-sds/branches{/branch}","tags_url":"https://api.github.com/repos/open-io/oio-sds/tags","blobs_url":"https://api.github.com/repos/open-io/oio-sds/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-io/oio-sds/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-io/oio-sds/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-io/oio-sds/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-io/oio-sds/statuses/{sha}","languages_url":"https://api.github.com/repos/open-io/oio-sds/languages","stargazers_url":"https://api.github.com/repos/open-io/oio-sds/stargazers","contributors_url":"https://api.github.com/repos/open-io/oio-sds/contributors","subscribers_url":"https://api.github.com/repos/open-io/oio-sds/subscribers","subscription_url":"https://api.github.com/repos/open-io/oio-sds/subscription","commits_url":"https://api.github.com/repos/open-io/oio-sds/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-io/oio-sds/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-io/oio-sds/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-io/oio-sds/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-io/oio-sds/contents/{+path}","compare_url":"https://api.github.com/repos/open-io/oio-sds/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-io/oio-sds/merges","archive_url":"https://api.github.com/repos/open-io/oio-sds/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-io/oio-sds/downloads","issues_url":"https://api.github.com/repos/open-io/oio-sds/issues{/number}","pulls_url":"https://api.github.com/repos/open-io/oio-sds/pulls{/number}","milestones_url":"https://api.github.com/repos/open-io/oio-sds/milestones{/number}","notifications_url":"https://api.github.com/repos/open-io/oio-sds/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-io/oio-sds/labels{/name}","releases_url":"https://api.github.com/repos/open-io/oio-sds/releases{/id}","deployments_url":"https://api.github.com/repos/open-io/oio-sds/deployments","created_at":"2015-03-13T17:06:25Z","updated_at":"2018-07-18T06:42:35Z","pushed_at":"2018-07-23T11:16:19Z","git_url":"git://github.com/open-io/oio-sds.git","ssh_url":"git@github.com:open-io/oio-sds.git","clone_url":"https://github.com/open-io/oio-sds.git","svn_url":"https://github.com/open-io/oio-sds","homepage":null,"size":16454,"stargazers_count":276,"watchers_count":276,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"archived":false,"open_issues_count":37,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":61,"open_issues":37,"watchers":276,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open-io/oio-sds/pulls/1527"},"html":{"href":"https://github.com/open-io/oio-sds/pull/1527"},"issue":{"href":"https://api.github.com/repos/open-io/oio-sds/issues/1527"},"comments":{"href":"https://api.github.com/repos/open-io/oio-sds/issues/1527/comments"},"review_comments":{"href":"https://api.github.com/repos/open-io/oio-sds/pulls/1527/comments"},"review_comment":{"href":"https://api.github.com/repos/open-io/oio-sds/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/open-io/oio-sds/pulls/1527/commits"},"statuses":{"href":"https://api.github.com/repos/open-io/oio-sds/statuses/ea2b3d36dfcd13adbc441feafdb340065baed9ad"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jfsmig"}}