{"action":"created","comment":{"url":"https://api.github.com/repos/snapcore/snapcraft/pulls/comments/109506641","pull_request_review_id":30613489,"id":109506641,"diff_hunk":"@@ -92,80 +128,47 @@ def _add_and_commit_file(path, filename, contents=None, message=None):\n \n         return _call_with_output(['git', '-C', name, 'rev-parse', 'HEAD'])\n \n-    def test_pull(self):\n+    scenarios = [\n+        ('plain', {\n+            'part_name': 'git-part',\n+            'expected': {}\n+        }),\n+        ('branch', {\n+            'part_name': 'git-part-branch',\n+            'expected': {\n+                'branch': 'feature',\n+            }\n+        }),\n+        ('tag', {\n+            'part_name': 'git-part-tag',\n+            'expected': {\n+                'tag': 'feature-tag',\n+            }\n+        }),\n+    ]\n+\n+    def test_git_pull(self):\n         project_dir = 'asset-tracking'\n-        self.run_snapcraft(['pull', 'asset-tracking'], project_dir)\n \n-        state_file = os.path.join(\n-            self.parts_dir, project_dir, 'state', 'pull')\n-        self.assertThat(state_file, FileExists())\n-        with open(state_file) as f:\n-            state = yaml.load(f)\n-\n-        # Verify that the correct version of 'hello' is installed\n-        self.assertTrue(len(state.assets['stage-packages']) > 0)\n-        self.assertTrue(len(state.assets['build-packages']) > 0)\n-        self.assertIn('hello=2.10-1', state.assets['stage-packages'])\n-        self.assertIn('source-details', state.assets)\n-\n-    def test_pull_git(self):\n-        project_dir = 'asset-tracking'\n-        part = 'git-part'\n         expected_commit = self._create_git_repo('git-source')\n-        self.run_snapcraft(['pull', part], project_dir)\n+        self.run_snapcraft(['pull', self.part_name], project_dir)\n \n         state_file = os.path.join(\n-            self.parts_dir, part, 'state', 'pull')\n+            self.parts_dir, self.part_name, 'state', 'pull')\n         self.assertThat(state_file, FileExists())\n         with open(state_file) as f:\n             state = yaml.load(f)\n \n         self.assertIn('source-details', state.assets)\n-        self.assertEqual(expected_commit,\n-                         state.assets['source-details']['commit'])\n \n-    def test_pull_git_branch(self):\n-        project_dir = 'asset-tracking'\n-        part = 'git-part-branch'\n-        self._create_git_repo('git-source')\n-        self.run_snapcraft(['pull', part], project_dir)\n-\n-        state_file = os.path.join(\n-            self.parts_dir, part, 'state', 'pull')\n-        self.assertThat(state_file, FileExists())\n-        with open(state_file) as f:\n-            state = yaml.load(f)\n-\n-        self.assertIn('source-details', state.assets)\n-        self.assertEqual('feature', state.assets['source-details']['branch'])\n-\n-    def test_pull_git_tag(self):\n-        project_dir = 'asset-tracking'\n-        part = 'git-part-tag'\n-        self._create_git_repo('git-source')\n-        self.run_snapcraft(['pull', part], project_dir)\n-\n-        state_file = os.path.join(\n-            self.parts_dir, part, 'state', 'pull')\n-        with open(state_file) as f:\n-            state = yaml.load(f)\n-\n-        self.assertIn('source-details', state.assets)\n-        self.assertEqual('feature-tag', state.assets['source-details']['tag'])\n-\n-    def test_pull_global_build_packages_are_excluded(self):\n-        \"\"\"\n-        Ensure global build-packages are not included in each part's\n-        build-packages data.\n-        \"\"\"\n-        project_dir = 'build-package-version-global'\n-        self.run_snapcraft('pull', project_dir)\n-\n-        state_file = os.path.join(\n-            self.parts_dir, project_dir, 'state', 'pull')\n-        self.assertThat(state_file, FileExists())\n-        with open(state_file) as f:\n-            state = yaml.load(f)\n-\n-        self.assertTrue(len(state.assets['build-packages']) == 0)\n-        self.assertNotIn('hello=2.10-1', state.assets['build-packages'])\n+        print(\"JOE: {}\".format(state.assets['source-details']))","path":"integration_tests/test_pull_properties.py","position":null,"original_position":146,"commit_id":"727be16e3d5b8c7ea76681d8d2a54796fdaefd73","original_commit_id":"9c877071b62415db0d96bc8e9db88b61dee97086","user":{"login":"josepht","id":646088,"avatar_url":"https://avatars0.githubusercontent.com/u/646088?v=3","gravatar_id":"","url":"https://api.github.com/users/josepht","html_url":"https://github.com/josepht","followers_url":"https://api.github.com/users/josepht/followers","following_url":"https://api.github.com/users/josepht/following{/other_user}","gists_url":"https://api.github.com/users/josepht/gists{/gist_id}","starred_url":"https://api.github.com/users/josepht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josepht/subscriptions","organizations_url":"https://api.github.com/users/josepht/orgs","repos_url":"https://api.github.com/users/josepht/repos","events_url":"https://api.github.com/users/josepht/events{/privacy}","received_events_url":"https://api.github.com/users/josepht/received_events","type":"User","site_admin":false},"body":"I inadvertently broke my pre-commit hook that checks for that.  Fixed now. :-)","created_at":"2017-04-03T19:42:22Z","updated_at":"2017-04-03T19:42:22Z","html_url":"https://github.com/snapcore/snapcraft/pull/1211#discussion_r109506641","pull_request_url":"https://api.github.com/repos/snapcore/snapcraft/pulls/1211","_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapcraft/pulls/comments/109506641"},"html":{"href":"https://github.com/snapcore/snapcraft/pull/1211#discussion_r109506641"},"pull_request":{"href":"https://api.github.com/repos/snapcore/snapcraft/pulls/1211"}}},"pull_request":{"url":"https://api.github.com/repos/snapcore/snapcraft/pulls/1211","id":112089501,"html_url":"https://github.com/snapcore/snapcraft/pull/1211","diff_url":"https://github.com/snapcore/snapcraft/pull/1211.diff","patch_url":"https://github.com/snapcore/snapcraft/pull/1211.patch","issue_url":"https://api.github.com/repos/snapcore/snapcraft/issues/1211","number":1211,"state":"open","locked":false,"title":"sources: add git source tracking","user":{"login":"josepht","id":646088,"avatar_url":"https://avatars0.githubusercontent.com/u/646088?v=3","gravatar_id":"","url":"https://api.github.com/users/josepht","html_url":"https://github.com/josepht","followers_url":"https://api.github.com/users/josepht/followers","following_url":"https://api.github.com/users/josepht/following{/other_user}","gists_url":"https://api.github.com/users/josepht/gists{/gist_id}","starred_url":"https://api.github.com/users/josepht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josepht/subscriptions","organizations_url":"https://api.github.com/users/josepht/orgs","repos_url":"https://api.github.com/users/josepht/repos","events_url":"https://api.github.com/users/josepht/events{/privacy}","received_events_url":"https://api.github.com/users/josepht/received_events","type":"User","site_admin":false},"body":"LP: #1547158","created_at":"2017-03-22T19:17:02Z","updated_at":"2017-04-03T19:42:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ca232fa83f064ea49ad07c04457a1e0a0c7e55e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/snapcore/snapcraft/pulls/1211/commits","review_comments_url":"https://api.github.com/repos/snapcore/snapcraft/pulls/1211/comments","review_comment_url":"https://api.github.com/repos/snapcore/snapcraft/pulls/comments{/number}","comments_url":"https://api.github.com/repos/snapcore/snapcraft/issues/1211/comments","statuses_url":"https://api.github.com/repos/snapcore/snapcraft/statuses/727be16e3d5b8c7ea76681d8d2a54796fdaefd73","head":{"label":"josepht:a-t-git","ref":"a-t-git","sha":"727be16e3d5b8c7ea76681d8d2a54796fdaefd73","user":{"login":"josepht","id":646088,"avatar_url":"https://avatars0.githubusercontent.com/u/646088?v=3","gravatar_id":"","url":"https://api.github.com/users/josepht","html_url":"https://github.com/josepht","followers_url":"https://api.github.com/users/josepht/followers","following_url":"https://api.github.com/users/josepht/following{/other_user}","gists_url":"https://api.github.com/users/josepht/gists{/gist_id}","starred_url":"https://api.github.com/users/josepht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josepht/subscriptions","organizations_url":"https://api.github.com/users/josepht/orgs","repos_url":"https://api.github.com/users/josepht/repos","events_url":"https://api.github.com/users/josepht/events{/privacy}","received_events_url":"https://api.github.com/users/josepht/received_events","type":"User","site_admin":false},"repo":{"id":54208156,"name":"snapcraft","full_name":"josepht/snapcraft","owner":{"login":"josepht","id":646088,"avatar_url":"https://avatars0.githubusercontent.com/u/646088?v=3","gravatar_id":"","url":"https://api.github.com/users/josepht","html_url":"https://github.com/josepht","followers_url":"https://api.github.com/users/josepht/followers","following_url":"https://api.github.com/users/josepht/following{/other_user}","gists_url":"https://api.github.com/users/josepht/gists{/gist_id}","starred_url":"https://api.github.com/users/josepht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josepht/subscriptions","organizations_url":"https://api.github.com/users/josepht/orgs","repos_url":"https://api.github.com/users/josepht/repos","events_url":"https://api.github.com/users/josepht/events{/privacy}","received_events_url":"https://api.github.com/users/josepht/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/josepht/snapcraft","description":"Snapcraft is a delightful packaging tool","fork":true,"url":"https://api.github.com/repos/josepht/snapcraft","forks_url":"https://api.github.com/repos/josepht/snapcraft/forks","keys_url":"https://api.github.com/repos/josepht/snapcraft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/josepht/snapcraft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/josepht/snapcraft/teams","hooks_url":"https://api.github.com/repos/josepht/snapcraft/hooks","issue_events_url":"https://api.github.com/repos/josepht/snapcraft/issues/events{/number}","events_url":"https://api.github.com/repos/josepht/snapcraft/events","assignees_url":"https://api.github.com/repos/josepht/snapcraft/assignees{/user}","branches_url":"https://api.github.com/repos/josepht/snapcraft/branches{/branch}","tags_url":"https://api.github.com/repos/josepht/snapcraft/tags","blobs_url":"https://api.github.com/repos/josepht/snapcraft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/josepht/snapcraft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/josepht/snapcraft/git/refs{/sha}","trees_url":"https://api.github.com/repos/josepht/snapcraft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/josepht/snapcraft/statuses/{sha}","languages_url":"https://api.github.com/repos/josepht/snapcraft/languages","stargazers_url":"https://api.github.com/repos/josepht/snapcraft/stargazers","contributors_url":"https://api.github.com/repos/josepht/snapcraft/contributors","subscribers_url":"https://api.github.com/repos/josepht/snapcraft/subscribers","subscription_url":"https://api.github.com/repos/josepht/snapcraft/subscription","commits_url":"https://api.github.com/repos/josepht/snapcraft/commits{/sha}","git_commits_url":"https://api.github.com/repos/josepht/snapcraft/git/commits{/sha}","comments_url":"https://api.github.com/repos/josepht/snapcraft/comments{/number}","issue_comment_url":"https://api.github.com/repos/josepht/snapcraft/issues/comments{/number}","contents_url":"https://api.github.com/repos/josepht/snapcraft/contents/{+path}","compare_url":"https://api.github.com/repos/josepht/snapcraft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/josepht/snapcraft/merges","archive_url":"https://api.github.com/repos/josepht/snapcraft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/josepht/snapcraft/downloads","issues_url":"https://api.github.com/repos/josepht/snapcraft/issues{/number}","pulls_url":"https://api.github.com/repos/josepht/snapcraft/pulls{/number}","milestones_url":"https://api.github.com/repos/josepht/snapcraft/milestones{/number}","notifications_url":"https://api.github.com/repos/josepht/snapcraft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/josepht/snapcraft/labels{/name}","releases_url":"https://api.github.com/repos/josepht/snapcraft/releases{/id}","deployments_url":"https://api.github.com/repos/josepht/snapcraft/deployments","created_at":"2016-03-18T14:39:09Z","updated_at":"2016-03-18T14:39:10Z","pushed_at":"2017-04-03T19:38:38Z","git_url":"git://github.com/josepht/snapcraft.git","ssh_url":"git@github.com:josepht/snapcraft.git","clone_url":"https://github.com/josepht/snapcraft.git","svn_url":"https://github.com/josepht/snapcraft","homepage":null,"size":6767,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"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":"snapcore:master","ref":"master","sha":"c6bf989ae0b459dd697123208536d9f8ef1e1350","user":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars2.githubusercontent.com/u/19532717?v=3","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"repo":{"id":45199136,"name":"snapcraft","full_name":"snapcore/snapcraft","owner":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars2.githubusercontent.com/u/19532717?v=3","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/snapcore/snapcraft","description":"Snapcraft is a delightful packaging tool","fork":false,"url":"https://api.github.com/repos/snapcore/snapcraft","forks_url":"https://api.github.com/repos/snapcore/snapcraft/forks","keys_url":"https://api.github.com/repos/snapcore/snapcraft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/snapcore/snapcraft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/snapcore/snapcraft/teams","hooks_url":"https://api.github.com/repos/snapcore/snapcraft/hooks","issue_events_url":"https://api.github.com/repos/snapcore/snapcraft/issues/events{/number}","events_url":"https://api.github.com/repos/snapcore/snapcraft/events","assignees_url":"https://api.github.com/repos/snapcore/snapcraft/assignees{/user}","branches_url":"https://api.github.com/repos/snapcore/snapcraft/branches{/branch}","tags_url":"https://api.github.com/repos/snapcore/snapcraft/tags","blobs_url":"https://api.github.com/repos/snapcore/snapcraft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/snapcore/snapcraft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/snapcore/snapcraft/git/refs{/sha}","trees_url":"https://api.github.com/repos/snapcore/snapcraft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/snapcore/snapcraft/statuses/{sha}","languages_url":"https://api.github.com/repos/snapcore/snapcraft/languages","stargazers_url":"https://api.github.com/repos/snapcore/snapcraft/stargazers","contributors_url":"https://api.github.com/repos/snapcore/snapcraft/contributors","subscribers_url":"https://api.github.com/repos/snapcore/snapcraft/subscribers","subscription_url":"https://api.github.com/repos/snapcore/snapcraft/subscription","commits_url":"https://api.github.com/repos/snapcore/snapcraft/commits{/sha}","git_commits_url":"https://api.github.com/repos/snapcore/snapcraft/git/commits{/sha}","comments_url":"https://api.github.com/repos/snapcore/snapcraft/comments{/number}","issue_comment_url":"https://api.github.com/repos/snapcore/snapcraft/issues/comments{/number}","contents_url":"https://api.github.com/repos/snapcore/snapcraft/contents/{+path}","compare_url":"https://api.github.com/repos/snapcore/snapcraft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/snapcore/snapcraft/merges","archive_url":"https://api.github.com/repos/snapcore/snapcraft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/snapcore/snapcraft/downloads","issues_url":"https://api.github.com/repos/snapcore/snapcraft/issues{/number}","pulls_url":"https://api.github.com/repos/snapcore/snapcraft/pulls{/number}","milestones_url":"https://api.github.com/repos/snapcore/snapcraft/milestones{/number}","notifications_url":"https://api.github.com/repos/snapcore/snapcraft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/snapcore/snapcraft/labels{/name}","releases_url":"https://api.github.com/repos/snapcore/snapcraft/releases{/id}","deployments_url":"https://api.github.com/repos/snapcore/snapcraft/deployments","created_at":"2015-10-29T17:23:15Z","updated_at":"2017-03-31T09:28:46Z","pushed_at":"2017-04-03T19:38:40Z","git_url":"git://github.com/snapcore/snapcraft.git","ssh_url":"git@github.com:snapcore/snapcraft.git","clone_url":"https://github.com/snapcore/snapcraft.git","svn_url":"https://github.com/snapcore/snapcraft","homepage":null,"size":6563,"stargazers_count":310,"watchers_count":310,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":165,"mirror_url":null,"open_issues_count":16,"forks":165,"open_issues":16,"watchers":310,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapcraft/pulls/1211"},"html":{"href":"https://github.com/snapcore/snapcraft/pull/1211"},"issue":{"href":"https://api.github.com/repos/snapcore/snapcraft/issues/1211"},"comments":{"href":"https://api.github.com/repos/snapcore/snapcraft/issues/1211/comments"},"review_comments":{"href":"https://api.github.com/repos/snapcore/snapcraft/pulls/1211/comments"},"review_comment":{"href":"https://api.github.com/repos/snapcore/snapcraft/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/snapcore/snapcraft/pulls/1211/commits"},"statuses":{"href":"https://api.github.com/repos/snapcore/snapcraft/statuses/727be16e3d5b8c7ea76681d8d2a54796fdaefd73"}}}}
{"actor":{"display_login":"josepht"}}