{"action":"created","issue":{"url":"https://api.github.com/repos/buildbot/buildbot/issues/2500","repository_url":"https://api.github.com/repos/buildbot/buildbot","labels_url":"https://api.github.com/repos/buildbot/buildbot/issues/2500/labels{/name}","comments_url":"https://api.github.com/repos/buildbot/buildbot/issues/2500/comments","events_url":"https://api.github.com/repos/buildbot/buildbot/issues/2500/events","html_url":"https://github.com/buildbot/buildbot/pull/2500","id":188983597,"number":2500,"title":"Update tutorial to reflect current situation","user":{"login":"Lekensteyn","id":164530,"avatar_url":"https://avatars.githubusercontent.com/u/164530?v=3","gravatar_id":"","url":"https://api.github.com/users/Lekensteyn","html_url":"https://github.com/Lekensteyn","followers_url":"https://api.github.com/users/Lekensteyn/followers","following_url":"https://api.github.com/users/Lekensteyn/following{/other_user}","gists_url":"https://api.github.com/users/Lekensteyn/gists{/gist_id}","starred_url":"https://api.github.com/users/Lekensteyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lekensteyn/subscriptions","organizations_url":"https://api.github.com/users/Lekensteyn/orgs","repos_url":"https://api.github.com/users/Lekensteyn/repos","events_url":"https://api.github.com/users/Lekensteyn/events{/privacy}","received_events_url":"https://api.github.com/users/Lekensteyn/received_events","type":"User","site_admin":false},"labels":[{"id":69661060,"url":"https://api.github.com/repos/buildbot/buildbot/labels/needs%20work","name":"needs work","color":"f7c6c7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-11-13T17:49:27Z","updated_at":"2016-11-21T13:22:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/buildbot/buildbot/pulls/2500","html_url":"https://github.com/buildbot/buildbot/pull/2500","diff_url":"https://github.com/buildbot/buildbot/pull/2500.diff","patch_url":"https://github.com/buildbot/buildbot/pull/2500.patch"},"body":"Addresses almost all of the remaining comments in #2498, the only things not updated are the pictures.\r\n\r\nPlease have a closer look at the sample config, it contains a hack for a simple single-user scenario. (I do not intent to use this configuration in practice, but thought it would be a simple demonstration of auth(z) concepts)."},"comment":{"url":"https://api.github.com/repos/buildbot/buildbot/issues/comments/261937056","html_url":"https://github.com/buildbot/buildbot/pull/2500#issuecomment-261937056","issue_url":"https://api.github.com/repos/buildbot/buildbot/issues/2500","id":261937056,"user":{"login":"Lekensteyn","id":164530,"avatar_url":"https://avatars.githubusercontent.com/u/164530?v=3","gravatar_id":"","url":"https://api.github.com/users/Lekensteyn","html_url":"https://github.com/Lekensteyn","followers_url":"https://api.github.com/users/Lekensteyn/followers","following_url":"https://api.github.com/users/Lekensteyn/following{/other_user}","gists_url":"https://api.github.com/users/Lekensteyn/gists{/gist_id}","starred_url":"https://api.github.com/users/Lekensteyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lekensteyn/subscriptions","organizations_url":"https://api.github.com/users/Lekensteyn/orgs","repos_url":"https://api.github.com/users/Lekensteyn/repos","events_url":"https://api.github.com/users/Lekensteyn/events{/privacy}","received_events_url":"https://api.github.com/users/Lekensteyn/received_events","type":"User","site_admin":false},"created_at":"2016-11-21T13:22:14Z","updated_at":"2016-11-21T13:22:14Z","body":"Applied a slightly different change, `config.error` does not return an exception so raising it probably did not work. Passes the local `trial buildbot/test/unit/test_www_roles.py` test.\r\n\r\n```diff\r\ndiff --git a/master/buildbot/test/unit/test_www_roles.py b/master/buildbot/test/unit/test_www_roles.py\r\nindex a7780d8..8cb4fa4 100644\r\n--- a/master/buildbot/test/unit/test_www_roles.py\r\n+++ b/master/buildbot/test/unit/test_www_roles.py\r\n@@ -13,6 +13,7 @@\r\n # Copyright Buildbot Team Members\r\n from twisted.trial import unittest\r\n \r\n+from buildbot.test.util.config import ConfigErrorsMixin\r\n from buildbot.www.authz import roles\r\n \r\n \r\n@@ -82,7 +83,7 @@ class RolesFromOwner(unittest.TestCase):\r\n         self.assertEqual(ret, [\"ownerofbuild\"])\r\n \r\n \r\n-class RolesFromUsername(unittest.TestCase):\r\n+class RolesFromUsername(unittest.TestCase, ConfigErrorsMixin):\r\n \r\n     def setUp(self):\r\n         self.roles = roles.RolesFromUsername(roles=[\"admins\"], usernames=[\"Admin\"])\r\n@@ -106,5 +107,5 @@ class RolesFromUsername(unittest.TestCase):\r\n         self.assertEqual(ret, [\"developers\", \"integrators\"])\r\n \r\n     def test_badUsernames(self):\r\n-        self.assertRaises(ValueError,\r\n-            roles.RolesFromUsername, roles=[], usernames=[None])\r\n+        self.assertRaisesConfigError('Usernames cannot be None',\r\n+            lambda: roles.RolesFromUsername(roles=[], usernames=[None]))\r\ndiff --git a/master/buildbot/www/authz/roles.py b/master/buildbot/www/authz/roles.py\r\nindex d50eaa5..af19912 100644\r\n--- a/master/buildbot/www/authz/roles.py\r\n+++ b/master/buildbot/www/authz/roles.py\r\n@@ -76,7 +76,8 @@ class RolesFromUsername(RolesFromBase):\r\n     def __init__(self, roles, usernames):\r\n         self.roles = roles\r\n         if None in usernames:\r\n-            raise ValueError('Usernames cannot be None')\r\n+            from buildbot import config\r\n+            config.error('Usernames cannot be None')\r\n         self.usernames = usernames\r\n \r\n     def getRolesFromUser(self, userDetails):\r\n```"}}
{"actor":{"display_login":"Lekensteyn"}}