{"action":"created","comment":{"url":"https://api.github.com/repos/toto-framework/Toto/pulls/comments/83094581","pull_request_review_id":3957017,"id":83094581,"diff_hunk":"@@ -1,18 +1,94 @@\n+\"\"\"\n+<Program Name>\n+  matchrule.py\n+\n+<Author>\n+  Lukas Puehringer <lukas.puehringer@nyu.edu>\n+  Santiago Torres <santiago@nyu.edu>\n+\n+<Started>\n+  Sep 23, 2016\n+\n+<Copyright>\n+  See LICENSE for licensing information.\n+\n+<Purpose>\n+  Provides classes for material and product matchrules defined in\n+  Step or Inspection definitions in the layout, used to verify if\n+  materials and products as reported by link metadata are correctly\n+  interconnected\n+\n+<Classes>\n+  Matchrule:\n+      base class for all matchrules\n+\n+  Match:\n+      base class for MatchProduct and MatchMaterial\n+\n+  MatchProduct:\n+      class for matchrules of format: MATCH PRODUCT <path> FROM <step>\n+\n+  Matchmaterial:\n+      class for matchrules of format: MATCH MATERIAL <path> FROM <step>\n+\n+  Create:\n+      class for matchrules of format: CREATE <path>\n+\n+  Delete:\n+      class for matchrules of format: DELETE <path>\n+\n+  Modify:\n+      class for matchrules of format: MODIFY <path>\n+\n+Todo:\n+  - rethink specifications for matchrules, for now only the match target is\n+    mentioned in the rule, I think it would be clearer to have the notion of\n+    both match candiates in the rule:\n+    e.g.:\n+    MATCH <path> IN (PRODUCT|MATERIAL) WITH (PRODUCT|MATERIAL) FROM <step>\n+\n+  - clarify specifications for CREATE, DELETE, MODIFY matchrules\n+    I think the way how these rules are verified is not the way the specs\n+    intended them to do\n+\n+  - general revision of the verify_rule methods and the used arguments\n+\n+  - move RuleVerficationFailed to toto.exception (and fix typo)\n+\n+  - general revision of Exception messages\n+\n+\"\"\"\n+\n import attr\n import canonicaljson\n from toto.models.common import ComparableHashDict\n \n class RuleVerficationFailed(Exception):\n   pass\n \n+\n @attr.s(repr=False)\n class Matchrule(object):\n+  \"\"\"\n+  Base class for all matchrules, provides a method to instantiate the\n+  different matchrules based on their list representation.\n+\n+  Each subclass must implement a verify_rule method.\n+\n+  <Attributes>\n+    source_type:\n+        either \"material\" or \"product\" depending on whether the rule resides\n+        in a material_matchrules list or product_matchrules list\n+\n+  Todo:\n+    - needs better checking in the read method\n+  \"\"\"\n \n   source_type = attr.ib(\"\", init=False)\n \n+\n   @staticmethod\n   def read(data):\n-\n     # XXX LP: needs some better checking\n     # e.g. move checking to validator altogether\n     if len(data) == 5 and data[0] == \"MATCH\" and data[1] == \"MATERIAL\":","path":"toto/models/matchrule.py","position":95,"original_position":95,"commit_id":"9ebd3a649d884f0795caf3002ea391a7660dc8ce","original_commit_id":"9ebd3a649d884f0795caf3002ea391a7660dc8ce","user":{"login":"SantiagoTorres","id":3579933,"avatar_url":"https://avatars.githubusercontent.com/u/3579933?v=3","gravatar_id":"","url":"https://api.github.com/users/SantiagoTorres","html_url":"https://github.com/SantiagoTorres","followers_url":"https://api.github.com/users/SantiagoTorres/followers","following_url":"https://api.github.com/users/SantiagoTorres/following{/other_user}","gists_url":"https://api.github.com/users/SantiagoTorres/gists{/gist_id}","starred_url":"https://api.github.com/users/SantiagoTorres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SantiagoTorres/subscriptions","organizations_url":"https://api.github.com/users/SantiagoTorres/orgs","repos_url":"https://api.github.com/users/SantiagoTorres/repos","events_url":"https://api.github.com/users/SantiagoTorres/events{/privacy}","received_events_url":"https://api.github.com/users/SantiagoTorres/received_events","type":"User","site_admin":false},"body":"This *does* need better checking. Can we ticketize? ","created_at":"2016-10-12T20:45:07Z","updated_at":"2016-10-12T20:58:36Z","html_url":"https://github.com/toto-framework/Toto/pull/3#discussion_r83094581","pull_request_url":"https://api.github.com/repos/toto-framework/Toto/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/toto-framework/Toto/pulls/comments/83094581"},"html":{"href":"https://github.com/toto-framework/Toto/pull/3#discussion_r83094581"},"pull_request":{"href":"https://api.github.com/repos/toto-framework/Toto/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/toto-framework/Toto/pulls/3","id":88352202,"html_url":"https://github.com/toto-framework/Toto/pull/3","diff_url":"https://github.com/toto-framework/Toto/pull/3.diff","patch_url":"https://github.com/toto-framework/Toto/pull/3.patch","issue_url":"https://api.github.com/repos/toto-framework/Toto/issues/3","number":3,"state":"open","locked":false,"title":"Adds docstrings everywhere","user":{"login":"lukpueh","id":589324,"avatar_url":"https://avatars.githubusercontent.com/u/589324?v=3","gravatar_id":"","url":"https://api.github.com/users/lukpueh","html_url":"https://github.com/lukpueh","followers_url":"https://api.github.com/users/lukpueh/followers","following_url":"https://api.github.com/users/lukpueh/following{/other_user}","gists_url":"https://api.github.com/users/lukpueh/gists{/gist_id}","starred_url":"https://api.github.com/users/lukpueh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukpueh/subscriptions","organizations_url":"https://api.github.com/users/lukpueh/orgs","repos_url":"https://api.github.com/users/lukpueh/repos","events_url":"https://api.github.com/users/lukpueh/events{/privacy}","received_events_url":"https://api.github.com/users/lukpueh/received_events","type":"User","site_admin":false},"body":"A first iteration of the attempt of having useful and style guideline conformant docstrings","created_at":"2016-10-06T22:23:53Z","updated_at":"2016-10-12T20:58:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"21e27fb11eb92a275836f16b3ea6b7cd97280d56","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/toto-framework/Toto/pulls/3/commits","review_comments_url":"https://api.github.com/repos/toto-framework/Toto/pulls/3/comments","review_comment_url":"https://api.github.com/repos/toto-framework/Toto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/toto-framework/Toto/issues/3/comments","statuses_url":"https://api.github.com/repos/toto-framework/Toto/statuses/9ebd3a649d884f0795caf3002ea391a7660dc8ce","head":{"label":"toto-framework:add-docstrings","ref":"add-docstrings","sha":"9ebd3a649d884f0795caf3002ea391a7660dc8ce","user":{"login":"toto-framework","id":22661409,"avatar_url":"https://avatars.githubusercontent.com/u/22661409?v=3","gravatar_id":"","url":"https://api.github.com/users/toto-framework","html_url":"https://github.com/toto-framework","followers_url":"https://api.github.com/users/toto-framework/followers","following_url":"https://api.github.com/users/toto-framework/following{/other_user}","gists_url":"https://api.github.com/users/toto-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/toto-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toto-framework/subscriptions","organizations_url":"https://api.github.com/users/toto-framework/orgs","repos_url":"https://api.github.com/users/toto-framework/repos","events_url":"https://api.github.com/users/toto-framework/events{/privacy}","received_events_url":"https://api.github.com/users/toto-framework/received_events","type":"Organization","site_admin":false},"repo":{"id":59531400,"name":"Toto","full_name":"toto-framework/Toto","owner":{"login":"toto-framework","id":22661409,"avatar_url":"https://avatars.githubusercontent.com/u/22661409?v=3","gravatar_id":"","url":"https://api.github.com/users/toto-framework","html_url":"https://github.com/toto-framework","followers_url":"https://api.github.com/users/toto-framework/followers","following_url":"https://api.github.com/users/toto-framework/following{/other_user}","gists_url":"https://api.github.com/users/toto-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/toto-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toto-framework/subscriptions","organizations_url":"https://api.github.com/users/toto-framework/orgs","repos_url":"https://api.github.com/users/toto-framework/repos","events_url":"https://api.github.com/users/toto-framework/events{/privacy}","received_events_url":"https://api.github.com/users/toto-framework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/toto-framework/Toto","description":"Toto is a framework to protect the supply chain integrity.","fork":false,"url":"https://api.github.com/repos/toto-framework/Toto","forks_url":"https://api.github.com/repos/toto-framework/Toto/forks","keys_url":"https://api.github.com/repos/toto-framework/Toto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toto-framework/Toto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toto-framework/Toto/teams","hooks_url":"https://api.github.com/repos/toto-framework/Toto/hooks","issue_events_url":"https://api.github.com/repos/toto-framework/Toto/issues/events{/number}","events_url":"https://api.github.com/repos/toto-framework/Toto/events","assignees_url":"https://api.github.com/repos/toto-framework/Toto/assignees{/user}","branches_url":"https://api.github.com/repos/toto-framework/Toto/branches{/branch}","tags_url":"https://api.github.com/repos/toto-framework/Toto/tags","blobs_url":"https://api.github.com/repos/toto-framework/Toto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toto-framework/Toto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toto-framework/Toto/git/refs{/sha}","trees_url":"https://api.github.com/repos/toto-framework/Toto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toto-framework/Toto/statuses/{sha}","languages_url":"https://api.github.com/repos/toto-framework/Toto/languages","stargazers_url":"https://api.github.com/repos/toto-framework/Toto/stargazers","contributors_url":"https://api.github.com/repos/toto-framework/Toto/contributors","subscribers_url":"https://api.github.com/repos/toto-framework/Toto/subscribers","subscription_url":"https://api.github.com/repos/toto-framework/Toto/subscription","commits_url":"https://api.github.com/repos/toto-framework/Toto/commits{/sha}","git_commits_url":"https://api.github.com/repos/toto-framework/Toto/git/commits{/sha}","comments_url":"https://api.github.com/repos/toto-framework/Toto/comments{/number}","issue_comment_url":"https://api.github.com/repos/toto-framework/Toto/issues/comments{/number}","contents_url":"https://api.github.com/repos/toto-framework/Toto/contents/{+path}","compare_url":"https://api.github.com/repos/toto-framework/Toto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toto-framework/Toto/merges","archive_url":"https://api.github.com/repos/toto-framework/Toto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toto-framework/Toto/downloads","issues_url":"https://api.github.com/repos/toto-framework/Toto/issues{/number}","pulls_url":"https://api.github.com/repos/toto-framework/Toto/pulls{/number}","milestones_url":"https://api.github.com/repos/toto-framework/Toto/milestones{/number}","notifications_url":"https://api.github.com/repos/toto-framework/Toto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toto-framework/Toto/labels{/name}","releases_url":"https://api.github.com/repos/toto-framework/Toto/releases{/id}","deployments_url":"https://api.github.com/repos/toto-framework/Toto/deployments","created_at":"2016-05-24T01:46:38Z","updated_at":"2016-10-09T19:18:44Z","pushed_at":"2016-10-10T17:23:52Z","git_url":"git://github.com/toto-framework/Toto.git","ssh_url":"git@github.com:toto-framework/Toto.git","clone_url":"https://github.com/toto-framework/Toto.git","svn_url":"https://github.com/toto-framework/Toto","homepage":"","size":193,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"toto-framework:develop","ref":"develop","sha":"ab96f88a00c6a8e30864b4b2295c4f7003bf5082","user":{"login":"toto-framework","id":22661409,"avatar_url":"https://avatars.githubusercontent.com/u/22661409?v=3","gravatar_id":"","url":"https://api.github.com/users/toto-framework","html_url":"https://github.com/toto-framework","followers_url":"https://api.github.com/users/toto-framework/followers","following_url":"https://api.github.com/users/toto-framework/following{/other_user}","gists_url":"https://api.github.com/users/toto-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/toto-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toto-framework/subscriptions","organizations_url":"https://api.github.com/users/toto-framework/orgs","repos_url":"https://api.github.com/users/toto-framework/repos","events_url":"https://api.github.com/users/toto-framework/events{/privacy}","received_events_url":"https://api.github.com/users/toto-framework/received_events","type":"Organization","site_admin":false},"repo":{"id":59531400,"name":"Toto","full_name":"toto-framework/Toto","owner":{"login":"toto-framework","id":22661409,"avatar_url":"https://avatars.githubusercontent.com/u/22661409?v=3","gravatar_id":"","url":"https://api.github.com/users/toto-framework","html_url":"https://github.com/toto-framework","followers_url":"https://api.github.com/users/toto-framework/followers","following_url":"https://api.github.com/users/toto-framework/following{/other_user}","gists_url":"https://api.github.com/users/toto-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/toto-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toto-framework/subscriptions","organizations_url":"https://api.github.com/users/toto-framework/orgs","repos_url":"https://api.github.com/users/toto-framework/repos","events_url":"https://api.github.com/users/toto-framework/events{/privacy}","received_events_url":"https://api.github.com/users/toto-framework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/toto-framework/Toto","description":"Toto is a framework to protect the supply chain integrity.","fork":false,"url":"https://api.github.com/repos/toto-framework/Toto","forks_url":"https://api.github.com/repos/toto-framework/Toto/forks","keys_url":"https://api.github.com/repos/toto-framework/Toto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toto-framework/Toto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toto-framework/Toto/teams","hooks_url":"https://api.github.com/repos/toto-framework/Toto/hooks","issue_events_url":"https://api.github.com/repos/toto-framework/Toto/issues/events{/number}","events_url":"https://api.github.com/repos/toto-framework/Toto/events","assignees_url":"https://api.github.com/repos/toto-framework/Toto/assignees{/user}","branches_url":"https://api.github.com/repos/toto-framework/Toto/branches{/branch}","tags_url":"https://api.github.com/repos/toto-framework/Toto/tags","blobs_url":"https://api.github.com/repos/toto-framework/Toto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toto-framework/Toto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toto-framework/Toto/git/refs{/sha}","trees_url":"https://api.github.com/repos/toto-framework/Toto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toto-framework/Toto/statuses/{sha}","languages_url":"https://api.github.com/repos/toto-framework/Toto/languages","stargazers_url":"https://api.github.com/repos/toto-framework/Toto/stargazers","contributors_url":"https://api.github.com/repos/toto-framework/Toto/contributors","subscribers_url":"https://api.github.com/repos/toto-framework/Toto/subscribers","subscription_url":"https://api.github.com/repos/toto-framework/Toto/subscription","commits_url":"https://api.github.com/repos/toto-framework/Toto/commits{/sha}","git_commits_url":"https://api.github.com/repos/toto-framework/Toto/git/commits{/sha}","comments_url":"https://api.github.com/repos/toto-framework/Toto/comments{/number}","issue_comment_url":"https://api.github.com/repos/toto-framework/Toto/issues/comments{/number}","contents_url":"https://api.github.com/repos/toto-framework/Toto/contents/{+path}","compare_url":"https://api.github.com/repos/toto-framework/Toto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toto-framework/Toto/merges","archive_url":"https://api.github.com/repos/toto-framework/Toto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toto-framework/Toto/downloads","issues_url":"https://api.github.com/repos/toto-framework/Toto/issues{/number}","pulls_url":"https://api.github.com/repos/toto-framework/Toto/pulls{/number}","milestones_url":"https://api.github.com/repos/toto-framework/Toto/milestones{/number}","notifications_url":"https://api.github.com/repos/toto-framework/Toto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toto-framework/Toto/labels{/name}","releases_url":"https://api.github.com/repos/toto-framework/Toto/releases{/id}","deployments_url":"https://api.github.com/repos/toto-framework/Toto/deployments","created_at":"2016-05-24T01:46:38Z","updated_at":"2016-10-09T19:18:44Z","pushed_at":"2016-10-10T17:23:52Z","git_url":"git://github.com/toto-framework/Toto.git","ssh_url":"git@github.com:toto-framework/Toto.git","clone_url":"https://github.com/toto-framework/Toto.git","svn_url":"https://github.com/toto-framework/Toto","homepage":"","size":193,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/toto-framework/Toto/pulls/3"},"html":{"href":"https://github.com/toto-framework/Toto/pull/3"},"issue":{"href":"https://api.github.com/repos/toto-framework/Toto/issues/3"},"comments":{"href":"https://api.github.com/repos/toto-framework/Toto/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/toto-framework/Toto/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/toto-framework/Toto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/toto-framework/Toto/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/toto-framework/Toto/statuses/9ebd3a649d884f0795caf3002ea391a7660dc8ce"}}}}
{"actor":{"display_login":"SantiagoTorres"}}