{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/normandy/pulls/comments/107781388","pull_request_review_id":28774718,"id":107781388,"diff_hunk":"@@ -96,6 +97,20 @@ def create(self, validated_data):\n \n         return self.update(recipe, validated_data)\n \n+    def validate_extra_filter_expression(self, value):\n+        jexl = JEXL()\n+\n+        # Add mock transforms for validation\n+        jexl.add_transform('date', lambda x: x)\n+        jexl.add_transform('stableSample', lambda x: x)\n+        jexl.add_transform('bucketSample', lambda x: x)","path":"recipe-server/normandy/recipes/api/serializers.py","position":15,"original_position":15,"commit_id":"1efea67db81552cde58be4771e8c750615e0f5eb","original_commit_id":"1efea67db81552cde58be4771e8c750615e0f5eb","user":{"login":"mythmon","id":305049,"avatar_url":"https://avatars0.githubusercontent.com/u/305049?v=3","gravatar_id":"","url":"https://api.github.com/users/mythmon","html_url":"https://github.com/mythmon","followers_url":"https://api.github.com/users/mythmon/followers","following_url":"https://api.github.com/users/mythmon/following{/other_user}","gists_url":"https://api.github.com/users/mythmon/gists{/gist_id}","starred_url":"https://api.github.com/users/mythmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mythmon/subscriptions","organizations_url":"https://api.github.com/users/mythmon/orgs","repos_url":"https://api.github.com/users/mythmon/repos","events_url":"https://api.github.com/users/mythmon/events{/privacy}","received_events_url":"https://api.github.com/users/mythmon/received_events","type":"User","site_admin":false},"body":"This isn't very satisfying, but I don't know how we can do better. Maybe we can put a link to the docs that say what transforms need to be available?","created_at":"2017-03-23T20:55:28Z","updated_at":"2017-03-23T21:00:01Z","html_url":"https://github.com/mozilla/normandy/pull/629#discussion_r107781388","pull_request_url":"https://api.github.com/repos/mozilla/normandy/pulls/629","_links":{"self":{"href":"https://api.github.com/repos/mozilla/normandy/pulls/comments/107781388"},"html":{"href":"https://github.com/mozilla/normandy/pull/629#discussion_r107781388"},"pull_request":{"href":"https://api.github.com/repos/mozilla/normandy/pulls/629"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/normandy/pulls/629","id":112331715,"html_url":"https://github.com/mozilla/normandy/pull/629","diff_url":"https://github.com/mozilla/normandy/pull/629.diff","patch_url":"https://github.com/mozilla/normandy/pull/629.patch","issue_url":"https://api.github.com/repos/mozilla/normandy/issues/629","number":629,"state":"open","locked":false,"title":"Bug 1349596: Validate JEXL on the server instead of the client.","user":{"login":"Osmose","id":193106,"avatar_url":"https://avatars2.githubusercontent.com/u/193106?v=3","gravatar_id":"","url":"https://api.github.com/users/Osmose","html_url":"https://github.com/Osmose","followers_url":"https://api.github.com/users/Osmose/followers","following_url":"https://api.github.com/users/Osmose/following{/other_user}","gists_url":"https://api.github.com/users/Osmose/gists{/gist_id}","starred_url":"https://api.github.com/users/Osmose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Osmose/subscriptions","organizations_url":"https://api.github.com/users/Osmose/orgs","repos_url":"https://api.github.com/users/Osmose/repos","events_url":"https://api.github.com/users/Osmose/events{/privacy}","received_events_url":"https://api.github.com/users/Osmose/received_events","type":"User","site_admin":false},"body":"Validating JEXL on the client isn't ideal, because the JEXL library doesn't\r\nhave a public API for checking if a statement is valid without evaluating\r\nit, which means certain valid expressions won't pass validation if they\r\nreference data in the context that we don't provide in the admin interface.\r\n\r\nPyJEXL is a Python library that parses and evaluates JEXL, and it includes\r\na validation API that is more suitable for our validation.","created_at":"2017-03-23T20:30:50Z","updated_at":"2017-03-23T21:00:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b560abc7e2467a5b75c0ceec037410340f85ee9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/normandy/pulls/629/commits","review_comments_url":"https://api.github.com/repos/mozilla/normandy/pulls/629/comments","review_comment_url":"https://api.github.com/repos/mozilla/normandy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/normandy/issues/629/comments","statuses_url":"https://api.github.com/repos/mozilla/normandy/statuses/1efea67db81552cde58be4771e8c750615e0f5eb","head":{"label":"Osmose:pyjexl-validation","ref":"pyjexl-validation","sha":"1efea67db81552cde58be4771e8c750615e0f5eb","user":{"login":"Osmose","id":193106,"avatar_url":"https://avatars2.githubusercontent.com/u/193106?v=3","gravatar_id":"","url":"https://api.github.com/users/Osmose","html_url":"https://github.com/Osmose","followers_url":"https://api.github.com/users/Osmose/followers","following_url":"https://api.github.com/users/Osmose/following{/other_user}","gists_url":"https://api.github.com/users/Osmose/gists{/gist_id}","starred_url":"https://api.github.com/users/Osmose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Osmose/subscriptions","organizations_url":"https://api.github.com/users/Osmose/orgs","repos_url":"https://api.github.com/users/Osmose/repos","events_url":"https://api.github.com/users/Osmose/events{/privacy}","received_events_url":"https://api.github.com/users/Osmose/received_events","type":"User","site_admin":false},"repo":{"id":48456654,"name":"normandy","full_name":"Osmose/normandy","owner":{"login":"Osmose","id":193106,"avatar_url":"https://avatars2.githubusercontent.com/u/193106?v=3","gravatar_id":"","url":"https://api.github.com/users/Osmose","html_url":"https://github.com/Osmose","followers_url":"https://api.github.com/users/Osmose/followers","following_url":"https://api.github.com/users/Osmose/following{/other_user}","gists_url":"https://api.github.com/users/Osmose/gists{/gist_id}","starred_url":"https://api.github.com/users/Osmose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Osmose/subscriptions","organizations_url":"https://api.github.com/users/Osmose/orgs","repos_url":"https://api.github.com/users/Osmose/repos","events_url":"https://api.github.com/users/Osmose/events{/privacy}","received_events_url":"https://api.github.com/users/Osmose/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Osmose/normandy","description":"Self-Repair 2","fork":true,"url":"https://api.github.com/repos/Osmose/normandy","forks_url":"https://api.github.com/repos/Osmose/normandy/forks","keys_url":"https://api.github.com/repos/Osmose/normandy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Osmose/normandy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Osmose/normandy/teams","hooks_url":"https://api.github.com/repos/Osmose/normandy/hooks","issue_events_url":"https://api.github.com/repos/Osmose/normandy/issues/events{/number}","events_url":"https://api.github.com/repos/Osmose/normandy/events","assignees_url":"https://api.github.com/repos/Osmose/normandy/assignees{/user}","branches_url":"https://api.github.com/repos/Osmose/normandy/branches{/branch}","tags_url":"https://api.github.com/repos/Osmose/normandy/tags","blobs_url":"https://api.github.com/repos/Osmose/normandy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Osmose/normandy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Osmose/normandy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Osmose/normandy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Osmose/normandy/statuses/{sha}","languages_url":"https://api.github.com/repos/Osmose/normandy/languages","stargazers_url":"https://api.github.com/repos/Osmose/normandy/stargazers","contributors_url":"https://api.github.com/repos/Osmose/normandy/contributors","subscribers_url":"https://api.github.com/repos/Osmose/normandy/subscribers","subscription_url":"https://api.github.com/repos/Osmose/normandy/subscription","commits_url":"https://api.github.com/repos/Osmose/normandy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Osmose/normandy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Osmose/normandy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Osmose/normandy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Osmose/normandy/contents/{+path}","compare_url":"https://api.github.com/repos/Osmose/normandy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Osmose/normandy/merges","archive_url":"https://api.github.com/repos/Osmose/normandy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Osmose/normandy/downloads","issues_url":"https://api.github.com/repos/Osmose/normandy/issues{/number}","pulls_url":"https://api.github.com/repos/Osmose/normandy/pulls{/number}","milestones_url":"https://api.github.com/repos/Osmose/normandy/milestones{/number}","notifications_url":"https://api.github.com/repos/Osmose/normandy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Osmose/normandy/labels{/name}","releases_url":"https://api.github.com/repos/Osmose/normandy/releases{/id}","deployments_url":"https://api.github.com/repos/Osmose/normandy/deployments","created_at":"2015-12-22T22:18:41Z","updated_at":"2017-01-07T01:53:48Z","pushed_at":"2017-03-23T20:30:25Z","git_url":"git://github.com/Osmose/normandy.git","ssh_url":"git@github.com:Osmose/normandy.git","clone_url":"https://github.com/Osmose/normandy.git","svn_url":"https://github.com/Osmose/normandy","homepage":null,"size":3223,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"mozilla:master","ref":"master","sha":"2172b155578f2cfb1bbcdb7cc6206e3590084ee1","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars1.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":48456638,"name":"normandy","full_name":"mozilla/normandy","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars1.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/normandy","description":"Firefox recipe server","fork":false,"url":"https://api.github.com/repos/mozilla/normandy","forks_url":"https://api.github.com/repos/mozilla/normandy/forks","keys_url":"https://api.github.com/repos/mozilla/normandy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/normandy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/normandy/teams","hooks_url":"https://api.github.com/repos/mozilla/normandy/hooks","issue_events_url":"https://api.github.com/repos/mozilla/normandy/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/normandy/events","assignees_url":"https://api.github.com/repos/mozilla/normandy/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/normandy/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/normandy/tags","blobs_url":"https://api.github.com/repos/mozilla/normandy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/normandy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/normandy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/normandy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/normandy/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/normandy/languages","stargazers_url":"https://api.github.com/repos/mozilla/normandy/stargazers","contributors_url":"https://api.github.com/repos/mozilla/normandy/contributors","subscribers_url":"https://api.github.com/repos/mozilla/normandy/subscribers","subscription_url":"https://api.github.com/repos/mozilla/normandy/subscription","commits_url":"https://api.github.com/repos/mozilla/normandy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/normandy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/normandy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/normandy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/normandy/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/normandy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/normandy/merges","archive_url":"https://api.github.com/repos/mozilla/normandy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/normandy/downloads","issues_url":"https://api.github.com/repos/mozilla/normandy/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/normandy/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/normandy/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/normandy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/normandy/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/normandy/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/normandy/deployments","created_at":"2015-12-22T22:18:19Z","updated_at":"2017-03-15T11:54:32Z","pushed_at":"2017-03-23T20:56:03Z","git_url":"git://github.com/mozilla/normandy.git","ssh_url":"git@github.com:mozilla/normandy.git","clone_url":"https://github.com/mozilla/normandy.git","svn_url":"https://github.com/mozilla/normandy","homepage":"https://wiki.mozilla.org/Firefox/Recipe_Server","size":3398,"stargazers_count":15,"watchers_count":15,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":75,"forks":16,"open_issues":75,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/normandy/pulls/629"},"html":{"href":"https://github.com/mozilla/normandy/pull/629"},"issue":{"href":"https://api.github.com/repos/mozilla/normandy/issues/629"},"comments":{"href":"https://api.github.com/repos/mozilla/normandy/issues/629/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/normandy/pulls/629/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/normandy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/normandy/pulls/629/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/normandy/statuses/1efea67db81552cde58be4771e8c750615e0f5eb"}}}}
{"actor":{"display_login":"mythmon"}}