{"action":"created","comment":{"url":"https://api.github.com/repos/mbrainerd/tk-mari/pulls/comments/238149725","pull_request_review_id":180620180,"id":238149725,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODE0OTcyNQ==","diff_hunk":"@@ -440,6 +447,36 @@ def __on_project_opened(self, opened_project, is_new):\n         # change current engine context:\n         sgtk.platform.change_context(ctx)\n \n+    def __on_project_saved(self, saved_project):\n+        if not self.__metadata_mgr.get_metadata(saved_project):\n+            # this is not an sgtk compliant project\n+            return\n+\n+        workfiles_app = self.apps.get(\"tk-multi-workfiles2\")\n+        proj_mgr_app = self.apps.get(\"tk-mari-projectmanager\")\n+        if not workfiles_app or not proj_mgr_app:\n+            self.log_error(\"Unable to find workfiles or projectmanager app. Not exporting msf file.\")\n+            return\n+\n+        fields = self.context.as_template_fields()\n+\n+        # use project name to obtain \"name\" field\n+        project_name_template = proj_mgr_app.get_template(\"template_new_project_name\")\n+        if not project_name_template.validate(saved_project.name()):\n+            # this is not an sgtk compliant project\n+            return\n+        fields.update(project_name_template.get_fields(saved_project.name()))\n+\n+        # use project metadata to get the \"version\" field\n+        # assume 1 if no version is set yet\n+        fields[\"version\"] = self.__metadata_mgr.get_project_version(saved_project) or 1\n+","path":"engine.py","position":109,"original_position":109,"commit_id":"d33084554c0fdd2466b7221b9a63ac034625fec7","original_commit_id":"d33084554c0fdd2466b7221b9a63ac034625fec7","user":{"login":"aparna-d2","id":35912094,"node_id":"MDQ6VXNlcjM1OTEyMDk0","avatar_url":"https://avatars2.githubusercontent.com/u/35912094?v=4","gravatar_id":"","url":"https://api.github.com/users/aparna-d2","html_url":"https://github.com/aparna-d2","followers_url":"https://api.github.com/users/aparna-d2/followers","following_url":"https://api.github.com/users/aparna-d2/following{/other_user}","gists_url":"https://api.github.com/users/aparna-d2/gists{/gist_id}","starred_url":"https://api.github.com/users/aparna-d2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aparna-d2/subscriptions","organizations_url":"https://api.github.com/users/aparna-d2/orgs","repos_url":"https://api.github.com/users/aparna-d2/repos","events_url":"https://api.github.com/users/aparna-d2/events{/privacy}","received_events_url":"https://api.github.com/users/aparna-d2/received_events","type":"User","site_admin":false},"body":"The thing is, since v3 changes are already in use, and I am only setting new project version as 1 starting this pull request, earlier projects may have other metadata but not version (which should ideally have been 1) That's why I mentioned this is for backwards compatibility (in Github comment, not code)","created_at":"2018-12-03T05:45:14Z","updated_at":"2018-12-03T05:45:14Z","html_url":"https://github.com/mbrainerd/tk-mari/pull/1#discussion_r238149725","pull_request_url":"https://api.github.com/repos/mbrainerd/tk-mari/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/mbrainerd/tk-mari/pulls/comments/238149725"},"html":{"href":"https://github.com/mbrainerd/tk-mari/pull/1#discussion_r238149725"},"pull_request":{"href":"https://api.github.com/repos/mbrainerd/tk-mari/pulls/1"}},"in_reply_to_id":237971541},"pull_request":{"url":"https://api.github.com/repos/mbrainerd/tk-mari/pulls/1","id":233913215,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzOTEzMjE1","html_url":"https://github.com/mbrainerd/tk-mari/pull/1","diff_url":"https://github.com/mbrainerd/tk-mari/pull/1.diff","patch_url":"https://github.com/mbrainerd/tk-mari/pull/1.patch","issue_url":"https://api.github.com/repos/mbrainerd/tk-mari/issues/1","number":1,"state":"open","locked":false,"title":"#927: add export_session callback on save, set initial project version=1","user":{"login":"aparna-d2","id":35912094,"node_id":"MDQ6VXNlcjM1OTEyMDk0","avatar_url":"https://avatars2.githubusercontent.com/u/35912094?v=4","gravatar_id":"","url":"https://api.github.com/users/aparna-d2","html_url":"https://github.com/aparna-d2","followers_url":"https://api.github.com/users/aparna-d2/followers","following_url":"https://api.github.com/users/aparna-d2/following{/other_user}","gists_url":"https://api.github.com/users/aparna-d2/gists{/gist_id}","starred_url":"https://api.github.com/users/aparna-d2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aparna-d2/subscriptions","organizations_url":"https://api.github.com/users/aparna-d2/orgs","repos_url":"https://api.github.com/users/aparna-d2/repos","events_url":"https://api.github.com/users/aparna-d2/events{/privacy}","received_events_url":"https://api.github.com/users/aparna-d2/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-27T13:36:16Z","updated_at":"2018-12-03T05:45:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3c24104cc169359d02bb5bf946cd3307b1606389","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mbrainerd/tk-mari/pulls/1/commits","review_comments_url":"https://api.github.com/repos/mbrainerd/tk-mari/pulls/1/comments","review_comment_url":"https://api.github.com/repos/mbrainerd/tk-mari/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mbrainerd/tk-mari/issues/1/comments","statuses_url":"https://api.github.com/repos/mbrainerd/tk-mari/statuses/d33084554c0fdd2466b7221b9a63ac034625fec7","head":{"label":"aparna-d2:task-927","ref":"task-927","sha":"d33084554c0fdd2466b7221b9a63ac034625fec7","user":{"login":"aparna-d2","id":35912094,"node_id":"MDQ6VXNlcjM1OTEyMDk0","avatar_url":"https://avatars2.githubusercontent.com/u/35912094?v=4","gravatar_id":"","url":"https://api.github.com/users/aparna-d2","html_url":"https://github.com/aparna-d2","followers_url":"https://api.github.com/users/aparna-d2/followers","following_url":"https://api.github.com/users/aparna-d2/following{/other_user}","gists_url":"https://api.github.com/users/aparna-d2/gists{/gist_id}","starred_url":"https://api.github.com/users/aparna-d2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aparna-d2/subscriptions","organizations_url":"https://api.github.com/users/aparna-d2/orgs","repos_url":"https://api.github.com/users/aparna-d2/repos","events_url":"https://api.github.com/users/aparna-d2/events{/privacy}","received_events_url":"https://api.github.com/users/aparna-d2/received_events","type":"User","site_admin":false},"repo":{"id":159340497,"node_id":"MDEwOlJlcG9zaXRvcnkxNTkzNDA0OTc=","name":"tk-mari","full_name":"aparna-d2/tk-mari","private":false,"owner":{"login":"aparna-d2","id":35912094,"node_id":"MDQ6VXNlcjM1OTEyMDk0","avatar_url":"https://avatars2.githubusercontent.com/u/35912094?v=4","gravatar_id":"","url":"https://api.github.com/users/aparna-d2","html_url":"https://github.com/aparna-d2","followers_url":"https://api.github.com/users/aparna-d2/followers","following_url":"https://api.github.com/users/aparna-d2/following{/other_user}","gists_url":"https://api.github.com/users/aparna-d2/gists{/gist_id}","starred_url":"https://api.github.com/users/aparna-d2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aparna-d2/subscriptions","organizations_url":"https://api.github.com/users/aparna-d2/orgs","repos_url":"https://api.github.com/users/aparna-d2/repos","events_url":"https://api.github.com/users/aparna-d2/events{/privacy}","received_events_url":"https://api.github.com/users/aparna-d2/received_events","type":"User","site_admin":false},"html_url":"https://github.com/aparna-d2/tk-mari","description":null,"fork":true,"url":"https://api.github.com/repos/aparna-d2/tk-mari","forks_url":"https://api.github.com/repos/aparna-d2/tk-mari/forks","keys_url":"https://api.github.com/repos/aparna-d2/tk-mari/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aparna-d2/tk-mari/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aparna-d2/tk-mari/teams","hooks_url":"https://api.github.com/repos/aparna-d2/tk-mari/hooks","issue_events_url":"https://api.github.com/repos/aparna-d2/tk-mari/issues/events{/number}","events_url":"https://api.github.com/repos/aparna-d2/tk-mari/events","assignees_url":"https://api.github.com/repos/aparna-d2/tk-mari/assignees{/user}","branches_url":"https://api.github.com/repos/aparna-d2/tk-mari/branches{/branch}","tags_url":"https://api.github.com/repos/aparna-d2/tk-mari/tags","blobs_url":"https://api.github.com/repos/aparna-d2/tk-mari/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aparna-d2/tk-mari/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aparna-d2/tk-mari/git/refs{/sha}","trees_url":"https://api.github.com/repos/aparna-d2/tk-mari/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aparna-d2/tk-mari/statuses/{sha}","languages_url":"https://api.github.com/repos/aparna-d2/tk-mari/languages","stargazers_url":"https://api.github.com/repos/aparna-d2/tk-mari/stargazers","contributors_url":"https://api.github.com/repos/aparna-d2/tk-mari/contributors","subscribers_url":"https://api.github.com/repos/aparna-d2/tk-mari/subscribers","subscription_url":"https://api.github.com/repos/aparna-d2/tk-mari/subscription","commits_url":"https://api.github.com/repos/aparna-d2/tk-mari/commits{/sha}","git_commits_url":"https://api.github.com/repos/aparna-d2/tk-mari/git/commits{/sha}","comments_url":"https://api.github.com/repos/aparna-d2/tk-mari/comments{/number}","issue_comment_url":"https://api.github.com/repos/aparna-d2/tk-mari/issues/comments{/number}","contents_url":"https://api.github.com/repos/aparna-d2/tk-mari/contents/{+path}","compare_url":"https://api.github.com/repos/aparna-d2/tk-mari/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aparna-d2/tk-mari/merges","archive_url":"https://api.github.com/repos/aparna-d2/tk-mari/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aparna-d2/tk-mari/downloads","issues_url":"https://api.github.com/repos/aparna-d2/tk-mari/issues{/number}","pulls_url":"https://api.github.com/repos/aparna-d2/tk-mari/pulls{/number}","milestones_url":"https://api.github.com/repos/aparna-d2/tk-mari/milestones{/number}","notifications_url":"https://api.github.com/repos/aparna-d2/tk-mari/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aparna-d2/tk-mari/labels{/name}","releases_url":"https://api.github.com/repos/aparna-d2/tk-mari/releases{/id}","deployments_url":"https://api.github.com/repos/aparna-d2/tk-mari/deployments","created_at":"2018-11-27T13:33:56Z","updated_at":"2018-11-27T13:33:59Z","pushed_at":"2018-11-30T11:36:44Z","git_url":"git://github.com/aparna-d2/tk-mari.git","ssh_url":"git@github.com:aparna-d2/tk-mari.git","clone_url":"https://github.com/aparna-d2/tk-mari.git","svn_url":"https://github.com/aparna-d2/tk-mari","homepage":null,"size":219,"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,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mbrainerd:master","ref":"master","sha":"6722c6657638d31d75a3548d6e4cb25df0dbd0e3","user":{"login":"mbrainerd","id":13911942,"node_id":"MDQ6VXNlcjEzOTExOTQy","avatar_url":"https://avatars0.githubusercontent.com/u/13911942?v=4","gravatar_id":"","url":"https://api.github.com/users/mbrainerd","html_url":"https://github.com/mbrainerd","followers_url":"https://api.github.com/users/mbrainerd/followers","following_url":"https://api.github.com/users/mbrainerd/following{/other_user}","gists_url":"https://api.github.com/users/mbrainerd/gists{/gist_id}","starred_url":"https://api.github.com/users/mbrainerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbrainerd/subscriptions","organizations_url":"https://api.github.com/users/mbrainerd/orgs","repos_url":"https://api.github.com/users/mbrainerd/repos","events_url":"https://api.github.com/users/mbrainerd/events{/privacy}","received_events_url":"https://api.github.com/users/mbrainerd/received_events","type":"User","site_admin":false},"repo":{"id":142081351,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIwODEzNTE=","name":"tk-mari","full_name":"mbrainerd/tk-mari","private":false,"owner":{"login":"mbrainerd","id":13911942,"node_id":"MDQ6VXNlcjEzOTExOTQy","avatar_url":"https://avatars0.githubusercontent.com/u/13911942?v=4","gravatar_id":"","url":"https://api.github.com/users/mbrainerd","html_url":"https://github.com/mbrainerd","followers_url":"https://api.github.com/users/mbrainerd/followers","following_url":"https://api.github.com/users/mbrainerd/following{/other_user}","gists_url":"https://api.github.com/users/mbrainerd/gists{/gist_id}","starred_url":"https://api.github.com/users/mbrainerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbrainerd/subscriptions","organizations_url":"https://api.github.com/users/mbrainerd/orgs","repos_url":"https://api.github.com/users/mbrainerd/repos","events_url":"https://api.github.com/users/mbrainerd/events{/privacy}","received_events_url":"https://api.github.com/users/mbrainerd/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mbrainerd/tk-mari","description":null,"fork":false,"url":"https://api.github.com/repos/mbrainerd/tk-mari","forks_url":"https://api.github.com/repos/mbrainerd/tk-mari/forks","keys_url":"https://api.github.com/repos/mbrainerd/tk-mari/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mbrainerd/tk-mari/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mbrainerd/tk-mari/teams","hooks_url":"https://api.github.com/repos/mbrainerd/tk-mari/hooks","issue_events_url":"https://api.github.com/repos/mbrainerd/tk-mari/issues/events{/number}","events_url":"https://api.github.com/repos/mbrainerd/tk-mari/events","assignees_url":"https://api.github.com/repos/mbrainerd/tk-mari/assignees{/user}","branches_url":"https://api.github.com/repos/mbrainerd/tk-mari/branches{/branch}","tags_url":"https://api.github.com/repos/mbrainerd/tk-mari/tags","blobs_url":"https://api.github.com/repos/mbrainerd/tk-mari/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mbrainerd/tk-mari/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mbrainerd/tk-mari/git/refs{/sha}","trees_url":"https://api.github.com/repos/mbrainerd/tk-mari/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mbrainerd/tk-mari/statuses/{sha}","languages_url":"https://api.github.com/repos/mbrainerd/tk-mari/languages","stargazers_url":"https://api.github.com/repos/mbrainerd/tk-mari/stargazers","contributors_url":"https://api.github.com/repos/mbrainerd/tk-mari/contributors","subscribers_url":"https://api.github.com/repos/mbrainerd/tk-mari/subscribers","subscription_url":"https://api.github.com/repos/mbrainerd/tk-mari/subscription","commits_url":"https://api.github.com/repos/mbrainerd/tk-mari/commits{/sha}","git_commits_url":"https://api.github.com/repos/mbrainerd/tk-mari/git/commits{/sha}","comments_url":"https://api.github.com/repos/mbrainerd/tk-mari/comments{/number}","issue_comment_url":"https://api.github.com/repos/mbrainerd/tk-mari/issues/comments{/number}","contents_url":"https://api.github.com/repos/mbrainerd/tk-mari/contents/{+path}","compare_url":"https://api.github.com/repos/mbrainerd/tk-mari/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mbrainerd/tk-mari/merges","archive_url":"https://api.github.com/repos/mbrainerd/tk-mari/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mbrainerd/tk-mari/downloads","issues_url":"https://api.github.com/repos/mbrainerd/tk-mari/issues{/number}","pulls_url":"https://api.github.com/repos/mbrainerd/tk-mari/pulls{/number}","milestones_url":"https://api.github.com/repos/mbrainerd/tk-mari/milestones{/number}","notifications_url":"https://api.github.com/repos/mbrainerd/tk-mari/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mbrainerd/tk-mari/labels{/name}","releases_url":"https://api.github.com/repos/mbrainerd/tk-mari/releases{/id}","deployments_url":"https://api.github.com/repos/mbrainerd/tk-mari/deployments","created_at":"2018-07-23T23:52:47Z","updated_at":"2018-11-15T02:20:00Z","pushed_at":"2018-11-30T11:36:45Z","git_url":"git://github.com/mbrainerd/tk-mari.git","ssh_url":"git@github.com:mbrainerd/tk-mari.git","clone_url":"https://github.com/mbrainerd/tk-mari.git","svn_url":"https://github.com/mbrainerd/tk-mari","homepage":null,"size":202,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mbrainerd/tk-mari/pulls/1"},"html":{"href":"https://github.com/mbrainerd/tk-mari/pull/1"},"issue":{"href":"https://api.github.com/repos/mbrainerd/tk-mari/issues/1"},"comments":{"href":"https://api.github.com/repos/mbrainerd/tk-mari/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/mbrainerd/tk-mari/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/mbrainerd/tk-mari/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mbrainerd/tk-mari/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/mbrainerd/tk-mari/statuses/d33084554c0fdd2466b7221b9a63ac034625fec7"}},"author_association":"NONE"}}
{"actor":{"display_login":"aparna-d2"}}