{"action":"created","comment":{"url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls/comments/121257974","pull_request_review_id":43298157,"id":121257974,"diff_hunk":"@@ -835,22 +836,30 @@ def _get_contents_hash(self, config_descriptor, entities):\n         # the modtimes of all yml files found. When they're added to the digest,\n         # we'll dump as json sorting alphanumeric on yml file name to ensure\n         # consistent ordering of data.\n+        scanned = 0\n+\n         if config_descriptor and config_descriptor.is_immutable() == False:\n             yml_files = dict()\n \n-            # TODO: Deeper traversal that takes into account possible includes stuff\n-            # based on environment variables, which this might not catch if the included\n-            # file is outside of the config. <jbee>\n-            config_path = config_descriptor.get_path()\n+            # We do a shallow scan here of the bare minimum of yml files due\n+            # to speed concerns when network file servers are in use. We support\n+            # tk-shotgun configured in either the shotgun or non-shotgun yml\n+            # so we will stat all of the top level env files that we find. Note\n+            # that this means we are not covering included yml files, but we\n+            # accept that for the sake of speed.\n+            config_path = os.path.join(config_descriptor.get_path(), \"env\")\n \n             if config_path is not None:\n-                for root, dir_names, file_names in os.walk(config_path):\n-                    for file_name in fnmatch.filter(file_names, \"*.yml\"):\n-                        full_path = os.path.join(root, file_name)\n-                        yml_files[full_path] = os.path.getmtime(full_path)\n+                logger.debug(\"Statting yml files in %s\", config_path)\n+\n+                for file_path in glob.glob(os.path.join(config_path, \"*.yml\")):\n+                    yml_files[file_path] = os.path.getmtime(file_path)\n+                    scanned += 1","path":"python/tk_framework_desktopserver/shotgun/api_v2.py","position":38,"original_position":38,"commit_id":"139488fd56295044ae06f729092982d1cb9a960a","original_commit_id":"139488fd56295044ae06f729092982d1cb9a960a","user":{"login":"manneohrstrom","id":337710,"avatar_url":"https://avatars0.githubusercontent.com/u/337710?v=3","gravatar_id":"","url":"https://api.github.com/users/manneohrstrom","html_url":"https://github.com/manneohrstrom","followers_url":"https://api.github.com/users/manneohrstrom/followers","following_url":"https://api.github.com/users/manneohrstrom/following{/other_user}","gists_url":"https://api.github.com/users/manneohrstrom/gists{/gist_id}","starred_url":"https://api.github.com/users/manneohrstrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manneohrstrom/subscriptions","organizations_url":"https://api.github.com/users/manneohrstrom/orgs","repos_url":"https://api.github.com/users/manneohrstrom/repos","events_url":"https://api.github.com/users/manneohrstrom/events{/privacy}","received_events_url":"https://api.github.com/users/manneohrstrom/received_events","type":"User","site_admin":false},"body":"can skip `scanned` and just use `len(yml_files)`. ","created_at":"2017-06-10T14:07:15Z","updated_at":"2017-06-10T14:15:14Z","html_url":"https://github.com/shotgunsoftware/tk-framework-desktopserver/pull/36#discussion_r121257974","pull_request_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls/comments/121257974"},"html":{"href":"https://github.com/shotgunsoftware/tk-framework-desktopserver/pull/36#discussion_r121257974"},"pull_request":{"href":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls/36","id":124775499,"html_url":"https://github.com/shotgunsoftware/tk-framework-desktopserver/pull/36","diff_url":"https://github.com/shotgunsoftware/tk-framework-desktopserver/pull/36.diff","patch_url":"https://github.com/shotgunsoftware/tk-framework-desktopserver/pull/36.patch","issue_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/issues/36","number":36,"state":"open","locked":false,"title":"For #43105: Shallow yml mtime statting.","user":{"login":"thebeeland","id":4913787,"avatar_url":"https://avatars3.githubusercontent.com/u/4913787?v=3","gravatar_id":"","url":"https://api.github.com/users/thebeeland","html_url":"https://github.com/thebeeland","followers_url":"https://api.github.com/users/thebeeland/followers","following_url":"https://api.github.com/users/thebeeland/following{/other_user}","gists_url":"https://api.github.com/users/thebeeland/gists{/gist_id}","starred_url":"https://api.github.com/users/thebeeland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thebeeland/subscriptions","organizations_url":"https://api.github.com/users/thebeeland/orgs","repos_url":"https://api.github.com/users/thebeeland/repos","events_url":"https://api.github.com/users/thebeeland/events{/privacy}","received_events_url":"https://api.github.com/users/thebeeland/received_events","type":"User","site_admin":false},"body":"This change is for speed. Previously we statted all yml files found in the config by traversing the config recursively. Now we go straight to the subset of files that we know we want, and don't worry about anything else.","created_at":"2017-06-09T01:29:10Z","updated_at":"2017-06-10T14:15:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f8732912135e4bdb8dbe85158e51f8be16a3286","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls/36/commits","review_comments_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls/36/comments","review_comment_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/issues/36/comments","statuses_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/statuses/139488fd56295044ae06f729092982d1cb9a960a","head":{"label":"shotgunsoftware:43105_yml_mtime","ref":"43105_yml_mtime","sha":"139488fd56295044ae06f729092982d1cb9a960a","user":{"login":"shotgunsoftware","id":317894,"avatar_url":"https://avatars2.githubusercontent.com/u/317894?v=3","gravatar_id":"","url":"https://api.github.com/users/shotgunsoftware","html_url":"https://github.com/shotgunsoftware","followers_url":"https://api.github.com/users/shotgunsoftware/followers","following_url":"https://api.github.com/users/shotgunsoftware/following{/other_user}","gists_url":"https://api.github.com/users/shotgunsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/shotgunsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shotgunsoftware/subscriptions","organizations_url":"https://api.github.com/users/shotgunsoftware/orgs","repos_url":"https://api.github.com/users/shotgunsoftware/repos","events_url":"https://api.github.com/users/shotgunsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/shotgunsoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":27185714,"name":"tk-framework-desktopserver","full_name":"shotgunsoftware/tk-framework-desktopserver","owner":{"login":"shotgunsoftware","id":317894,"avatar_url":"https://avatars2.githubusercontent.com/u/317894?v=3","gravatar_id":"","url":"https://api.github.com/users/shotgunsoftware","html_url":"https://github.com/shotgunsoftware","followers_url":"https://api.github.com/users/shotgunsoftware/followers","following_url":"https://api.github.com/users/shotgunsoftware/following{/other_user}","gists_url":"https://api.github.com/users/shotgunsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/shotgunsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shotgunsoftware/subscriptions","organizations_url":"https://api.github.com/users/shotgunsoftware/orgs","repos_url":"https://api.github.com/users/shotgunsoftware/repos","events_url":"https://api.github.com/users/shotgunsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/shotgunsoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shotgunsoftware/tk-framework-desktopserver","description":"A framework that provides a server to run local commands.","fork":false,"url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver","forks_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/forks","keys_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/teams","hooks_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/hooks","issue_events_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/issues/events{/number}","events_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/events","assignees_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/assignees{/user}","branches_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/branches{/branch}","tags_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/tags","blobs_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/statuses/{sha}","languages_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/languages","stargazers_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/stargazers","contributors_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/contributors","subscribers_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/subscribers","subscription_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/subscription","commits_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/contents/{+path}","compare_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/merges","archive_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/downloads","issues_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/issues{/number}","pulls_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls{/number}","milestones_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/milestones{/number}","notifications_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/labels{/name}","releases_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/releases{/id}","deployments_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/deployments","created_at":"2014-11-26T16:30:33Z","updated_at":"2017-04-10T17:19:25Z","pushed_at":"2017-06-09T01:29:10Z","git_url":"git://github.com/shotgunsoftware/tk-framework-desktopserver.git","ssh_url":"git@github.com:shotgunsoftware/tk-framework-desktopserver.git","clone_url":"https://github.com/shotgunsoftware/tk-framework-desktopserver.git","svn_url":"https://github.com/shotgunsoftware/tk-framework-desktopserver","homepage":"","size":8422,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"shotgunsoftware:43236_empty_cache","ref":"43236_empty_cache","sha":"53363b0390c4a7aa84b23a51ae1a036833185e84","user":{"login":"shotgunsoftware","id":317894,"avatar_url":"https://avatars2.githubusercontent.com/u/317894?v=3","gravatar_id":"","url":"https://api.github.com/users/shotgunsoftware","html_url":"https://github.com/shotgunsoftware","followers_url":"https://api.github.com/users/shotgunsoftware/followers","following_url":"https://api.github.com/users/shotgunsoftware/following{/other_user}","gists_url":"https://api.github.com/users/shotgunsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/shotgunsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shotgunsoftware/subscriptions","organizations_url":"https://api.github.com/users/shotgunsoftware/orgs","repos_url":"https://api.github.com/users/shotgunsoftware/repos","events_url":"https://api.github.com/users/shotgunsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/shotgunsoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":27185714,"name":"tk-framework-desktopserver","full_name":"shotgunsoftware/tk-framework-desktopserver","owner":{"login":"shotgunsoftware","id":317894,"avatar_url":"https://avatars2.githubusercontent.com/u/317894?v=3","gravatar_id":"","url":"https://api.github.com/users/shotgunsoftware","html_url":"https://github.com/shotgunsoftware","followers_url":"https://api.github.com/users/shotgunsoftware/followers","following_url":"https://api.github.com/users/shotgunsoftware/following{/other_user}","gists_url":"https://api.github.com/users/shotgunsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/shotgunsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shotgunsoftware/subscriptions","organizations_url":"https://api.github.com/users/shotgunsoftware/orgs","repos_url":"https://api.github.com/users/shotgunsoftware/repos","events_url":"https://api.github.com/users/shotgunsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/shotgunsoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shotgunsoftware/tk-framework-desktopserver","description":"A framework that provides a server to run local commands.","fork":false,"url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver","forks_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/forks","keys_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/teams","hooks_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/hooks","issue_events_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/issues/events{/number}","events_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/events","assignees_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/assignees{/user}","branches_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/branches{/branch}","tags_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/tags","blobs_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/statuses/{sha}","languages_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/languages","stargazers_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/stargazers","contributors_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/contributors","subscribers_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/subscribers","subscription_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/subscription","commits_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/contents/{+path}","compare_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/merges","archive_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/downloads","issues_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/issues{/number}","pulls_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls{/number}","milestones_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/milestones{/number}","notifications_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/labels{/name}","releases_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/releases{/id}","deployments_url":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/deployments","created_at":"2014-11-26T16:30:33Z","updated_at":"2017-04-10T17:19:25Z","pushed_at":"2017-06-09T01:29:10Z","git_url":"git://github.com/shotgunsoftware/tk-framework-desktopserver.git","ssh_url":"git@github.com:shotgunsoftware/tk-framework-desktopserver.git","clone_url":"https://github.com/shotgunsoftware/tk-framework-desktopserver.git","svn_url":"https://github.com/shotgunsoftware/tk-framework-desktopserver","homepage":"","size":8422,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls/36"},"html":{"href":"https://github.com/shotgunsoftware/tk-framework-desktopserver/pull/36"},"issue":{"href":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/issues/36"},"comments":{"href":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/shotgunsoftware/tk-framework-desktopserver/statuses/139488fd56295044ae06f729092982d1cb9a960a"}}}}
{"actor":{"display_login":"manneohrstrom"}}