{"action":"created","comment":{"url":"https://api.github.com/repos/buildbot/buildbot/pulls/comments/101021950","pull_request_review_id":21738295,"id":101021950,"diff_hunk":"@@ -0,0 +1,59 @@\n+# This file is part of Buildbot.  Buildbot is free software: you can\n+# redistribute it and/or modify it under the terms of the GNU General Public\n+# License as published by the Free Software Foundation, version 2.\n+#\n+# This program is distributed in the hope that it will be useful, but WITHOUT\n+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\n+# details.\n+#\n+# You should have received a copy of the GNU General Public License along with\n+# this program; if not, write to the Free Software Foundation, Inc., 51\n+# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n+#\n+# Copyright Buildbot Team Members\n+\n+from __future__ import absolute_import\n+from __future__ import print_function\n+\n+import os\n+from tempfile import mkstemp\n+\n+from twisted.internet import defer\n+from twisted.trial import unittest\n+\n+from buildbot.secrets.providers.file import SecretInAFile\n+from buildbot.test.util.config import ConfigErrorsMixin\n+\n+\n+class TestSecretInFile(ConfigErrorsMixin, unittest.TestCase):\n+\n+    @defer.inlineCallbacks\n+    def setUp(self):\n+        self.srvfile = SecretInAFile(\"name\", \"/path/todirname\")\n+        yield self.srvfile.startService()\n+\n+    @defer.inlineCallbacks\n+    def tearDown(self):\n+        yield self.srvfile.stopService()\n+\n+    def testCheckConfigSecretInAFileService(self):\n+        self.assertEqual(self.srvfile.name, \"SecretInAFile\")\n+        self.assertEqual(self.srvfile._dirname, \"/path/todirname\")\n+\n+    def testCheckConfigErrorSecretInAFileService(self):\n+        self.assertRaisesConfigError(\"directory name could not be empty\",\n+         lambda: self.srvfile.checkConfig(\"name2\", None))\n+\n+    @defer.inlineCallbacks\n+    def testReconfigSecretInAFileService(self):\n+        yield self.srvfile.reconfigService(\"name2\", \"/path/todirname2\")\n+        self.assertEqual(self.srvfile.name, \"SecretInAFile\")\n+        self.assertEqual(self.srvfile._dirname, \"/path/todirname2\")\n+\n+    def testGetFile(self):\n+        (fd, name) = mkstemp()\n+        os.write(fd, 'key value')\n+        value = self.srvfile.get(name)\n+        self.assertEqual(value, \"key value\")\n+        os.close(fd)","path":"master/buildbot/test/unit/test_secret_in_file.py","position":59,"original_position":59,"commit_id":"95bde3e2ab265043e69d05ba7bd3405d2f8aa4ba","original_commit_id":"95bde3e2ab265043e69d05ba7bd3405d2f8aa4ba","user":{"login":"tardyp","id":109859,"avatar_url":"https://avatars.githubusercontent.com/u/109859?v=3","gravatar_id":"","url":"https://api.github.com/users/tardyp","html_url":"https://github.com/tardyp","followers_url":"https://api.github.com/users/tardyp/followers","following_url":"https://api.github.com/users/tardyp/following{/other_user}","gists_url":"https://api.github.com/users/tardyp/gists{/gist_id}","starred_url":"https://api.github.com/users/tardyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tardyp/subscriptions","organizations_url":"https://api.github.com/users/tardyp/orgs","repos_url":"https://api.github.com/users/tardyp/repos","events_url":"https://api.github.com/users/tardyp/events{/privacy}","received_events_url":"https://api.github.com/users/tardyp/received_events","type":"User","site_admin":false},"body":"need to delete the temp file in the end of the test","created_at":"2017-02-14T12:17:31Z","updated_at":"2017-02-14T12:23:49Z","html_url":"https://github.com/buildbot/buildbot/pull/2791#discussion_r101021950","pull_request_url":"https://api.github.com/repos/buildbot/buildbot/pulls/2791","_links":{"self":{"href":"https://api.github.com/repos/buildbot/buildbot/pulls/comments/101021950"},"html":{"href":"https://github.com/buildbot/buildbot/pull/2791#discussion_r101021950"},"pull_request":{"href":"https://api.github.com/repos/buildbot/buildbot/pulls/2791"}}},"pull_request":{"url":"https://api.github.com/repos/buildbot/buildbot/pulls/2791","id":106082412,"html_url":"https://github.com/buildbot/buildbot/pull/2791","diff_url":"https://github.com/buildbot/buildbot/pull/2791.diff","patch_url":"https://github.com/buildbot/buildbot/pull/2791.patch","issue_url":"https://api.github.com/repos/buildbot/buildbot/issues/2791","number":2791,"state":"open","locked":false,"title":"Secret returned by files provider. The secret is stored in files.","user":{"login":"protatremy","id":10063334,"avatar_url":"https://avatars.githubusercontent.com/u/10063334?v=3","gravatar_id":"","url":"https://api.github.com/users/protatremy","html_url":"https://github.com/protatremy","followers_url":"https://api.github.com/users/protatremy/followers","following_url":"https://api.github.com/users/protatremy/following{/other_user}","gists_url":"https://api.github.com/users/protatremy/gists{/gist_id}","starred_url":"https://api.github.com/users/protatremy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/protatremy/subscriptions","organizations_url":"https://api.github.com/users/protatremy/orgs","repos_url":"https://api.github.com/users/protatremy/repos","events_url":"https://api.github.com/users/protatremy/events{/privacy}","received_events_url":"https://api.github.com/users/protatremy/received_events","type":"User","site_admin":false},"body":"## Contributor Checklist:\r\n\r\n* [x] I have updated the unit tests\r\n* [ ] I have created a file in the master/buildbot/newsfragment directory (and read the README.txt in that directory)\r\n* [x] I have updated the appropriate documentation\r\n\r\n","created_at":"2017-02-14T11:07:19Z","updated_at":"2017-02-14T12:23:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"01a8d6b2d6284ca19b6af33f5be0ff5b85715372","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/buildbot/buildbot/pulls/2791/commits","review_comments_url":"https://api.github.com/repos/buildbot/buildbot/pulls/2791/comments","review_comment_url":"https://api.github.com/repos/buildbot/buildbot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/buildbot/buildbot/issues/2791/comments","statuses_url":"https://api.github.com/repos/buildbot/buildbot/statuses/95bde3e2ab265043e69d05ba7bd3405d2f8aa4ba","head":{"label":"protatremy:filesprovider","ref":"filesprovider","sha":"95bde3e2ab265043e69d05ba7bd3405d2f8aa4ba","user":{"login":"protatremy","id":10063334,"avatar_url":"https://avatars.githubusercontent.com/u/10063334?v=3","gravatar_id":"","url":"https://api.github.com/users/protatremy","html_url":"https://github.com/protatremy","followers_url":"https://api.github.com/users/protatremy/followers","following_url":"https://api.github.com/users/protatremy/following{/other_user}","gists_url":"https://api.github.com/users/protatremy/gists{/gist_id}","starred_url":"https://api.github.com/users/protatremy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/protatremy/subscriptions","organizations_url":"https://api.github.com/users/protatremy/orgs","repos_url":"https://api.github.com/users/protatremy/repos","events_url":"https://api.github.com/users/protatremy/events{/privacy}","received_events_url":"https://api.github.com/users/protatremy/received_events","type":"User","site_admin":false},"repo":{"id":62791987,"name":"buildbot","full_name":"protatremy/buildbot","owner":{"login":"protatremy","id":10063334,"avatar_url":"https://avatars.githubusercontent.com/u/10063334?v=3","gravatar_id":"","url":"https://api.github.com/users/protatremy","html_url":"https://github.com/protatremy","followers_url":"https://api.github.com/users/protatremy/followers","following_url":"https://api.github.com/users/protatremy/following{/other_user}","gists_url":"https://api.github.com/users/protatremy/gists{/gist_id}","starred_url":"https://api.github.com/users/protatremy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/protatremy/subscriptions","organizations_url":"https://api.github.com/users/protatremy/orgs","repos_url":"https://api.github.com/users/protatremy/repos","events_url":"https://api.github.com/users/protatremy/events{/privacy}","received_events_url":"https://api.github.com/users/protatremy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/protatremy/buildbot","description":"Python-based continuous integration testing framework; your pull requests are more than welcome!","fork":true,"url":"https://api.github.com/repos/protatremy/buildbot","forks_url":"https://api.github.com/repos/protatremy/buildbot/forks","keys_url":"https://api.github.com/repos/protatremy/buildbot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/protatremy/buildbot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/protatremy/buildbot/teams","hooks_url":"https://api.github.com/repos/protatremy/buildbot/hooks","issue_events_url":"https://api.github.com/repos/protatremy/buildbot/issues/events{/number}","events_url":"https://api.github.com/repos/protatremy/buildbot/events","assignees_url":"https://api.github.com/repos/protatremy/buildbot/assignees{/user}","branches_url":"https://api.github.com/repos/protatremy/buildbot/branches{/branch}","tags_url":"https://api.github.com/repos/protatremy/buildbot/tags","blobs_url":"https://api.github.com/repos/protatremy/buildbot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/protatremy/buildbot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/protatremy/buildbot/git/refs{/sha}","trees_url":"https://api.github.com/repos/protatremy/buildbot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/protatremy/buildbot/statuses/{sha}","languages_url":"https://api.github.com/repos/protatremy/buildbot/languages","stargazers_url":"https://api.github.com/repos/protatremy/buildbot/stargazers","contributors_url":"https://api.github.com/repos/protatremy/buildbot/contributors","subscribers_url":"https://api.github.com/repos/protatremy/buildbot/subscribers","subscription_url":"https://api.github.com/repos/protatremy/buildbot/subscription","commits_url":"https://api.github.com/repos/protatremy/buildbot/commits{/sha}","git_commits_url":"https://api.github.com/repos/protatremy/buildbot/git/commits{/sha}","comments_url":"https://api.github.com/repos/protatremy/buildbot/comments{/number}","issue_comment_url":"https://api.github.com/repos/protatremy/buildbot/issues/comments{/number}","contents_url":"https://api.github.com/repos/protatremy/buildbot/contents/{+path}","compare_url":"https://api.github.com/repos/protatremy/buildbot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/protatremy/buildbot/merges","archive_url":"https://api.github.com/repos/protatremy/buildbot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/protatremy/buildbot/downloads","issues_url":"https://api.github.com/repos/protatremy/buildbot/issues{/number}","pulls_url":"https://api.github.com/repos/protatremy/buildbot/pulls{/number}","milestones_url":"https://api.github.com/repos/protatremy/buildbot/milestones{/number}","notifications_url":"https://api.github.com/repos/protatremy/buildbot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/protatremy/buildbot/labels{/name}","releases_url":"https://api.github.com/repos/protatremy/buildbot/releases{/id}","deployments_url":"https://api.github.com/repos/protatremy/buildbot/deployments","created_at":"2016-07-07T09:04:04Z","updated_at":"2016-07-07T09:04:09Z","pushed_at":"2017-02-14T11:25:13Z","git_url":"git://github.com/protatremy/buildbot.git","ssh_url":"git@github.com:protatremy/buildbot.git","clone_url":"https://github.com/protatremy/buildbot.git","svn_url":"https://github.com/protatremy/buildbot","homepage":"http://buildbot.net","size":43057,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"buildbot:master","ref":"master","sha":"f56dff6b8cef07677564b3fbacda9de41b22c52b","user":{"login":"buildbot","id":324515,"avatar_url":"https://avatars.githubusercontent.com/u/324515?v=3","gravatar_id":"","url":"https://api.github.com/users/buildbot","html_url":"https://github.com/buildbot","followers_url":"https://api.github.com/users/buildbot/followers","following_url":"https://api.github.com/users/buildbot/following{/other_user}","gists_url":"https://api.github.com/users/buildbot/gists{/gist_id}","starred_url":"https://api.github.com/users/buildbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildbot/subscriptions","organizations_url":"https://api.github.com/users/buildbot/orgs","repos_url":"https://api.github.com/users/buildbot/repos","events_url":"https://api.github.com/users/buildbot/events{/privacy}","received_events_url":"https://api.github.com/users/buildbot/received_events","type":"Organization","site_admin":false},"repo":{"id":760165,"name":"buildbot","full_name":"buildbot/buildbot","owner":{"login":"buildbot","id":324515,"avatar_url":"https://avatars.githubusercontent.com/u/324515?v=3","gravatar_id":"","url":"https://api.github.com/users/buildbot","html_url":"https://github.com/buildbot","followers_url":"https://api.github.com/users/buildbot/followers","following_url":"https://api.github.com/users/buildbot/following{/other_user}","gists_url":"https://api.github.com/users/buildbot/gists{/gist_id}","starred_url":"https://api.github.com/users/buildbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildbot/subscriptions","organizations_url":"https://api.github.com/users/buildbot/orgs","repos_url":"https://api.github.com/users/buildbot/repos","events_url":"https://api.github.com/users/buildbot/events{/privacy}","received_events_url":"https://api.github.com/users/buildbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/buildbot/buildbot","description":"Python-based continuous integration testing framework; your pull requests are more than welcome!","fork":false,"url":"https://api.github.com/repos/buildbot/buildbot","forks_url":"https://api.github.com/repos/buildbot/buildbot/forks","keys_url":"https://api.github.com/repos/buildbot/buildbot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/buildbot/buildbot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/buildbot/buildbot/teams","hooks_url":"https://api.github.com/repos/buildbot/buildbot/hooks","issue_events_url":"https://api.github.com/repos/buildbot/buildbot/issues/events{/number}","events_url":"https://api.github.com/repos/buildbot/buildbot/events","assignees_url":"https://api.github.com/repos/buildbot/buildbot/assignees{/user}","branches_url":"https://api.github.com/repos/buildbot/buildbot/branches{/branch}","tags_url":"https://api.github.com/repos/buildbot/buildbot/tags","blobs_url":"https://api.github.com/repos/buildbot/buildbot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/buildbot/buildbot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/buildbot/buildbot/git/refs{/sha}","trees_url":"https://api.github.com/repos/buildbot/buildbot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/buildbot/buildbot/statuses/{sha}","languages_url":"https://api.github.com/repos/buildbot/buildbot/languages","stargazers_url":"https://api.github.com/repos/buildbot/buildbot/stargazers","contributors_url":"https://api.github.com/repos/buildbot/buildbot/contributors","subscribers_url":"https://api.github.com/repos/buildbot/buildbot/subscribers","subscription_url":"https://api.github.com/repos/buildbot/buildbot/subscription","commits_url":"https://api.github.com/repos/buildbot/buildbot/commits{/sha}","git_commits_url":"https://api.github.com/repos/buildbot/buildbot/git/commits{/sha}","comments_url":"https://api.github.com/repos/buildbot/buildbot/comments{/number}","issue_comment_url":"https://api.github.com/repos/buildbot/buildbot/issues/comments{/number}","contents_url":"https://api.github.com/repos/buildbot/buildbot/contents/{+path}","compare_url":"https://api.github.com/repos/buildbot/buildbot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/buildbot/buildbot/merges","archive_url":"https://api.github.com/repos/buildbot/buildbot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/buildbot/buildbot/downloads","issues_url":"https://api.github.com/repos/buildbot/buildbot/issues{/number}","pulls_url":"https://api.github.com/repos/buildbot/buildbot/pulls{/number}","milestones_url":"https://api.github.com/repos/buildbot/buildbot/milestones{/number}","notifications_url":"https://api.github.com/repos/buildbot/buildbot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/buildbot/buildbot/labels{/name}","releases_url":"https://api.github.com/repos/buildbot/buildbot/releases{/id}","deployments_url":"https://api.github.com/repos/buildbot/buildbot/deployments","created_at":"2010-07-06T17:56:53Z","updated_at":"2017-02-14T05:56:04Z","pushed_at":"2017-02-14T11:25:15Z","git_url":"git://github.com/buildbot/buildbot.git","ssh_url":"git@github.com:buildbot/buildbot.git","clone_url":"https://github.com/buildbot/buildbot.git","svn_url":"https://github.com/buildbot/buildbot","homepage":"http://buildbot.net","size":43076,"stargazers_count":2567,"watchers_count":2567,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1031,"mirror_url":null,"open_issues_count":23,"forks":1031,"open_issues":23,"watchers":2567,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/buildbot/buildbot/pulls/2791"},"html":{"href":"https://github.com/buildbot/buildbot/pull/2791"},"issue":{"href":"https://api.github.com/repos/buildbot/buildbot/issues/2791"},"comments":{"href":"https://api.github.com/repos/buildbot/buildbot/issues/2791/comments"},"review_comments":{"href":"https://api.github.com/repos/buildbot/buildbot/pulls/2791/comments"},"review_comment":{"href":"https://api.github.com/repos/buildbot/buildbot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/buildbot/buildbot/pulls/2791/commits"},"statuses":{"href":"https://api.github.com/repos/buildbot/buildbot/statuses/95bde3e2ab265043e69d05ba7bd3405d2f8aa4ba"}}}}
{"actor":{"display_login":"tardyp"}}