{"action":"created","comment":{"url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls/comments/132156901","pull_request_review_id":55205553,"id":132156901,"diff_hunk":"@@ -8,11 +8,12 @@ matrix:\n     - python: 3.6\n     - python: 3.4.1\n \n-script:  # Handles creating a blank config file so imports dont fail\n-  - mkdir -p instance\n-  - touch instance/config.py\n+env:\n+  - APP_CONFIG_NAME=test\n+\n+script:\n   - pytest\n-  - flake8 middleware/ --ignore=F403,F405\n+  - flake8 middleware/ --ignore=F401,F403,F405","path":".travis.yml","position":13,"original_position":13,"commit_id":"e32a2bc4bad39f1bdf3e16a386ed94f8d4fd2981","original_commit_id":"e32a2bc4bad39f1bdf3e16a386ed94f8d4fd2981","user":{"login":"sgrieve","id":10617231,"avatar_url":"https://avatars1.githubusercontent.com/u/10617231?v=4","gravatar_id":"","url":"https://api.github.com/users/sgrieve","html_url":"https://github.com/sgrieve","followers_url":"https://api.github.com/users/sgrieve/followers","following_url":"https://api.github.com/users/sgrieve/following{/other_user}","gists_url":"https://api.github.com/users/sgrieve/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrieve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrieve/subscriptions","organizations_url":"https://api.github.com/users/sgrieve/orgs","repos_url":"https://api.github.com/users/sgrieve/repos","events_url":"https://api.github.com/users/sgrieve/events{/privacy}","received_events_url":"https://api.github.com/users/sgrieve/received_events","type":"User","site_admin":false},"body":"No, it only flags modules that are imported and not used. 403 and 405 are to do with * imports.","created_at":"2017-08-09T11:25:19Z","updated_at":"2017-08-09T11:25:19Z","html_url":"https://github.com/alan-turing-institute/science-gateway-middleware/pull/29#discussion_r132156901","pull_request_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls/comments/132156901"},"html":{"href":"https://github.com/alan-turing-institute/science-gateway-middleware/pull/29#discussion_r132156901"},"pull_request":{"href":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls/29","id":134757935,"html_url":"https://github.com/alan-turing-institute/science-gateway-middleware/pull/29","diff_url":"https://github.com/alan-turing-institute/science-gateway-middleware/pull/29.diff","patch_url":"https://github.com/alan-turing-institute/science-gateway-middleware/pull/29.patch","issue_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/issues/29","number":29,"state":"open","locked":false,"title":"22 sql database","user":{"login":"martintoreilly","id":21147592,"avatar_url":"https://avatars3.githubusercontent.com/u/21147592?v=4","gravatar_id":"","url":"https://api.github.com/users/martintoreilly","html_url":"https://github.com/martintoreilly","followers_url":"https://api.github.com/users/martintoreilly/followers","following_url":"https://api.github.com/users/martintoreilly/following{/other_user}","gists_url":"https://api.github.com/users/martintoreilly/gists{/gist_id}","starred_url":"https://api.github.com/users/martintoreilly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martintoreilly/subscriptions","organizations_url":"https://api.github.com/users/martintoreilly/orgs","repos_url":"https://api.github.com/users/martintoreilly/repos","events_url":"https://api.github.com/users/martintoreilly/events{/privacy}","received_events_url":"https://api.github.com/users/martintoreilly/received_events","type":"User","site_admin":false},"body":"### Ports Job API to use SQLAlchemy + Marshmallow\r\n  - `job/models.py`: SQLAlchemy entity classes representing a Job and it's non primitive fields (i.e. the collections of `Parameters`, `Templates`, `Scripts` and `Inputs`). These are fully-featured classes, implementing `==`, `!=` and `<` operators and therefore supporting value-based comparison and sorting. We seem get construction via named parameters for free from SQLAlchemy (or possibly base Python, I'm not sure), but we define an explicit constructor for the Job entity so we can auto-generate Job IDs.\r\n  - `job/schema.py`: Marshmallow schema classes to manage serialisation and deserialisation of Job entity objects to and from JSON-compatible Python dictionaries. The `job_to_json` and `json_to_job` methods are wrappers to permit this serialisation / deserialisation to occur without a database session.\r\n  - We're actually using `Flask-SQLAlchemy` and `Flask-Marshmallow`, so we need to have `SQLAlchemy` (`db`) and `Marshmallow` (`ma`) objects available when we define our entity objects and schemas (see `database.py` and files that import `db` and / or `ma` from there. We're not particularly happy about this and it caused us some trouble testing, but we've not had time to find another / a better way to do this. We construct our Flask app in `factory.py` using these shared `db` and `ma` objects from `database.py`, but replace `db.session` if an SQLAlchemy-based Job repository is passed into the app factory. We do this in order to use isolated SQLAlchemy sessions in our tests.\r\n\r\n### Refactors how app is constructed\r\nThis branch also changes how the app is run locally and the `travis.yml` config file. This also removes the need to ensure an instance directory exists.\r\n","created_at":"2017-08-08T21:02:03Z","updated_at":"2017-08-09T11:25:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"abca519c07ccdc7b84974385ebb7296b1c14fe91","assignee":{"login":"sgrieve","id":10617231,"avatar_url":"https://avatars1.githubusercontent.com/u/10617231?v=4","gravatar_id":"","url":"https://api.github.com/users/sgrieve","html_url":"https://github.com/sgrieve","followers_url":"https://api.github.com/users/sgrieve/followers","following_url":"https://api.github.com/users/sgrieve/following{/other_user}","gists_url":"https://api.github.com/users/sgrieve/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrieve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrieve/subscriptions","organizations_url":"https://api.github.com/users/sgrieve/orgs","repos_url":"https://api.github.com/users/sgrieve/repos","events_url":"https://api.github.com/users/sgrieve/events{/privacy}","received_events_url":"https://api.github.com/users/sgrieve/received_events","type":"User","site_admin":false},"assignees":[{"login":"sgrieve","id":10617231,"avatar_url":"https://avatars1.githubusercontent.com/u/10617231?v=4","gravatar_id":"","url":"https://api.github.com/users/sgrieve","html_url":"https://github.com/sgrieve","followers_url":"https://api.github.com/users/sgrieve/followers","following_url":"https://api.github.com/users/sgrieve/following{/other_user}","gists_url":"https://api.github.com/users/sgrieve/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrieve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrieve/subscriptions","organizations_url":"https://api.github.com/users/sgrieve/orgs","repos_url":"https://api.github.com/users/sgrieve/repos","events_url":"https://api.github.com/users/sgrieve/events{/privacy}","received_events_url":"https://api.github.com/users/sgrieve/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"masonlr","id":5828176,"avatar_url":"https://avatars2.githubusercontent.com/u/5828176?v=4","gravatar_id":"","url":"https://api.github.com/users/masonlr","html_url":"https://github.com/masonlr","followers_url":"https://api.github.com/users/masonlr/followers","following_url":"https://api.github.com/users/masonlr/following{/other_user}","gists_url":"https://api.github.com/users/masonlr/gists{/gist_id}","starred_url":"https://api.github.com/users/masonlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masonlr/subscriptions","organizations_url":"https://api.github.com/users/masonlr/orgs","repos_url":"https://api.github.com/users/masonlr/repos","events_url":"https://api.github.com/users/masonlr/events{/privacy}","received_events_url":"https://api.github.com/users/masonlr/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls/29/commits","review_comments_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls/29/comments","review_comment_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/issues/29/comments","statuses_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/statuses/e32a2bc4bad39f1bdf3e16a386ed94f8d4fd2981","head":{"label":"alan-turing-institute:22-sql-database","ref":"22-sql-database","sha":"e32a2bc4bad39f1bdf3e16a386ed94f8d4fd2981","user":{"login":"alan-turing-institute","id":18304793,"avatar_url":"https://avatars1.githubusercontent.com/u/18304793?v=4","gravatar_id":"","url":"https://api.github.com/users/alan-turing-institute","html_url":"https://github.com/alan-turing-institute","followers_url":"https://api.github.com/users/alan-turing-institute/followers","following_url":"https://api.github.com/users/alan-turing-institute/following{/other_user}","gists_url":"https://api.github.com/users/alan-turing-institute/gists{/gist_id}","starred_url":"https://api.github.com/users/alan-turing-institute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alan-turing-institute/subscriptions","organizations_url":"https://api.github.com/users/alan-turing-institute/orgs","repos_url":"https://api.github.com/users/alan-turing-institute/repos","events_url":"https://api.github.com/users/alan-turing-institute/events{/privacy}","received_events_url":"https://api.github.com/users/alan-turing-institute/received_events","type":"Organization","site_admin":false},"repo":{"id":94429073,"name":"science-gateway-middleware","full_name":"alan-turing-institute/science-gateway-middleware","owner":{"login":"alan-turing-institute","id":18304793,"avatar_url":"https://avatars1.githubusercontent.com/u/18304793?v=4","gravatar_id":"","url":"https://api.github.com/users/alan-turing-institute","html_url":"https://github.com/alan-turing-institute","followers_url":"https://api.github.com/users/alan-turing-institute/followers","following_url":"https://api.github.com/users/alan-turing-institute/following{/other_user}","gists_url":"https://api.github.com/users/alan-turing-institute/gists{/gist_id}","starred_url":"https://api.github.com/users/alan-turing-institute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alan-turing-institute/subscriptions","organizations_url":"https://api.github.com/users/alan-turing-institute/orgs","repos_url":"https://api.github.com/users/alan-turing-institute/repos","events_url":"https://api.github.com/users/alan-turing-institute/events{/privacy}","received_events_url":"https://api.github.com/users/alan-turing-institute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alan-turing-institute/science-gateway-middleware","description":"Middleware endpoints for the Science Gateway project","fork":false,"url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware","forks_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/forks","keys_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/teams","hooks_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/hooks","issue_events_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/issues/events{/number}","events_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/events","assignees_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/assignees{/user}","branches_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/branches{/branch}","tags_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/tags","blobs_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/git/refs{/sha}","trees_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/statuses/{sha}","languages_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/languages","stargazers_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/stargazers","contributors_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/contributors","subscribers_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/subscribers","subscription_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/subscription","commits_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/commits{/sha}","git_commits_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/git/commits{/sha}","comments_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/comments{/number}","issue_comment_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/issues/comments{/number}","contents_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/contents/{+path}","compare_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/merges","archive_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/downloads","issues_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/issues{/number}","pulls_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls{/number}","milestones_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/milestones{/number}","notifications_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/labels{/name}","releases_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/releases{/id}","deployments_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/deployments","created_at":"2017-06-15T10:33:24Z","updated_at":"2017-08-03T07:40:08Z","pushed_at":"2017-08-08T21:03:37Z","git_url":"git://github.com/alan-turing-institute/science-gateway-middleware.git","ssh_url":"git@github.com:alan-turing-institute/science-gateway-middleware.git","clone_url":"https://github.com/alan-turing-institute/science-gateway-middleware.git","svn_url":"https://github.com/alan-turing-institute/science-gateway-middleware","homepage":"https://github.com/alan-turing-institute/science-gateway","size":3909,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":1,"default_branch":"master"}},"base":{"label":"alan-turing-institute:master","ref":"master","sha":"5e21c0f75cf74c35a1ab7563c4472d2344e75b03","user":{"login":"alan-turing-institute","id":18304793,"avatar_url":"https://avatars1.githubusercontent.com/u/18304793?v=4","gravatar_id":"","url":"https://api.github.com/users/alan-turing-institute","html_url":"https://github.com/alan-turing-institute","followers_url":"https://api.github.com/users/alan-turing-institute/followers","following_url":"https://api.github.com/users/alan-turing-institute/following{/other_user}","gists_url":"https://api.github.com/users/alan-turing-institute/gists{/gist_id}","starred_url":"https://api.github.com/users/alan-turing-institute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alan-turing-institute/subscriptions","organizations_url":"https://api.github.com/users/alan-turing-institute/orgs","repos_url":"https://api.github.com/users/alan-turing-institute/repos","events_url":"https://api.github.com/users/alan-turing-institute/events{/privacy}","received_events_url":"https://api.github.com/users/alan-turing-institute/received_events","type":"Organization","site_admin":false},"repo":{"id":94429073,"name":"science-gateway-middleware","full_name":"alan-turing-institute/science-gateway-middleware","owner":{"login":"alan-turing-institute","id":18304793,"avatar_url":"https://avatars1.githubusercontent.com/u/18304793?v=4","gravatar_id":"","url":"https://api.github.com/users/alan-turing-institute","html_url":"https://github.com/alan-turing-institute","followers_url":"https://api.github.com/users/alan-turing-institute/followers","following_url":"https://api.github.com/users/alan-turing-institute/following{/other_user}","gists_url":"https://api.github.com/users/alan-turing-institute/gists{/gist_id}","starred_url":"https://api.github.com/users/alan-turing-institute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alan-turing-institute/subscriptions","organizations_url":"https://api.github.com/users/alan-turing-institute/orgs","repos_url":"https://api.github.com/users/alan-turing-institute/repos","events_url":"https://api.github.com/users/alan-turing-institute/events{/privacy}","received_events_url":"https://api.github.com/users/alan-turing-institute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alan-turing-institute/science-gateway-middleware","description":"Middleware endpoints for the Science Gateway project","fork":false,"url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware","forks_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/forks","keys_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/teams","hooks_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/hooks","issue_events_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/issues/events{/number}","events_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/events","assignees_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/assignees{/user}","branches_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/branches{/branch}","tags_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/tags","blobs_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/git/refs{/sha}","trees_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/statuses/{sha}","languages_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/languages","stargazers_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/stargazers","contributors_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/contributors","subscribers_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/subscribers","subscription_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/subscription","commits_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/commits{/sha}","git_commits_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/git/commits{/sha}","comments_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/comments{/number}","issue_comment_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/issues/comments{/number}","contents_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/contents/{+path}","compare_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/merges","archive_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/downloads","issues_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/issues{/number}","pulls_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls{/number}","milestones_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/milestones{/number}","notifications_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/labels{/name}","releases_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/releases{/id}","deployments_url":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/deployments","created_at":"2017-06-15T10:33:24Z","updated_at":"2017-08-03T07:40:08Z","pushed_at":"2017-08-08T21:03:37Z","git_url":"git://github.com/alan-turing-institute/science-gateway-middleware.git","ssh_url":"git@github.com:alan-turing-institute/science-gateway-middleware.git","clone_url":"https://github.com/alan-turing-institute/science-gateway-middleware.git","svn_url":"https://github.com/alan-turing-institute/science-gateway-middleware","homepage":"https://github.com/alan-turing-institute/science-gateway","size":3909,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls/29"},"html":{"href":"https://github.com/alan-turing-institute/science-gateway-middleware/pull/29"},"issue":{"href":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/issues/29"},"comments":{"href":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/alan-turing-institute/science-gateway-middleware/statuses/e32a2bc4bad39f1bdf3e16a386ed94f8d4fd2981"}}}}
{"actor":{"display_login":"sgrieve"}}