{"action":"created","comment":{"url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/pulls/comments/253807684","pull_request_review_id":200002778,"id":253807684,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI1MzgwNzY4NA==","diff_hunk":"@@ -92,15 +93,24 @@ class DepositProperties(depositId: DepositId, depositorId: Option[String] = None\n       .getOrElse(Failure(new IllegalStateException(\"Deposit without state\")))\n   }\n \n-  def setContentType(contentType: String): Try[DepositProperties] = Try {\n-    properties.setProperty(\"contentType\", contentType)\n+  def setClientMessageContentType(contentType: String): Try[DepositProperties] = Try {\n+    properties.setProperty(CLIENT_MESSAGE_CONTENT_TYPE_KEY, contentType)\n     this\n   }\n \n-  def getContentType: Try[String] = {\n-    Option(properties.getString(\"contentType\"))\n+  def removeClientMessageContentType(): Try[DepositProperties] = Try {\n+    properties.clearProperty(CLIENT_MESSAGE_CONTENT_TYPE_KEY)\n+    properties.clearProperty(CLIENT_MESSAGE_CONTENT_TYPE_KEY_OLD) // Also clean up old contentType property if still found\n+    this\n+  }\n+\n+  def getClientMessageContentType: Try[String] = {\n+    Seq(properties.getString(CLIENT_MESSAGE_CONTENT_TYPE_KEY),\n+      properties.getString(CLIENT_MESSAGE_CONTENT_TYPE_KEY_OLD)) // Also look for old contentType to support pre-upgrade deposits\n+      .find(StringUtils.isNotBlank)","path":"src/main/scala/nl.knaw.dans.easy.sword2/DepositProperties.scala","position":30,"original_position":30,"commit_id":"15f81a356a6e0b15fcc54db8bac7c86312b6cc30","original_commit_id":"15f81a356a6e0b15fcc54db8bac7c86312b6cc30","user":{"login":"rvanheest","id":5938204,"node_id":"MDQ6VXNlcjU5MzgyMDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/5938204?v=4","gravatar_id":"","url":"https://api.github.com/users/rvanheest","html_url":"https://github.com/rvanheest","followers_url":"https://api.github.com/users/rvanheest/followers","following_url":"https://api.github.com/users/rvanheest/following{/other_user}","gists_url":"https://api.github.com/users/rvanheest/gists{/gist_id}","starred_url":"https://api.github.com/users/rvanheest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvanheest/subscriptions","organizations_url":"https://api.github.com/users/rvanheest/orgs","repos_url":"https://api.github.com/users/rvanheest/repos","events_url":"https://api.github.com/users/rvanheest/events{/privacy}","received_events_url":"https://api.github.com/users/rvanheest/received_events","type":"User","site_admin":false},"body":"```diff\r\n- .find(StringUtils.isNotBlank)\r\n- .map(Success(_))\r\n+ .collectFirst { s if StringUtils.isNotBlank(s) => Success(s) }\r\n```","created_at":"2019-02-05T10:30:43Z","updated_at":"2019-02-05T10:30:43Z","html_url":"https://github.com/DANS-KNAW/easy-sword2/pull/123#discussion_r253807684","pull_request_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/pulls/123","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DANS-KNAW/easy-sword2/pulls/comments/253807684"},"html":{"href":"https://github.com/DANS-KNAW/easy-sword2/pull/123#discussion_r253807684"},"pull_request":{"href":"https://api.github.com/repos/DANS-KNAW/easy-sword2/pulls/123"}}},"pull_request":{"url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/pulls/123","id":249989121,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQ5OTg5MTIx","html_url":"https://github.com/DANS-KNAW/easy-sword2/pull/123","diff_url":"https://github.com/DANS-KNAW/easy-sword2/pull/123.diff","patch_url":"https://github.com/DANS-KNAW/easy-sword2/pull/123.patch","issue_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/issues/123","number":123,"state":"open","locked":false,"title":"NO JIRA. Refactoring: rename contentType to easy-sword2.client-message.content-type","user":{"login":"janvanmansum","id":3862694,"node_id":"MDQ6VXNlcjM4NjI2OTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/3862694?v=4","gravatar_id":"","url":"https://api.github.com/users/janvanmansum","html_url":"https://github.com/janvanmansum","followers_url":"https://api.github.com/users/janvanmansum/followers","following_url":"https://api.github.com/users/janvanmansum/following{/other_user}","gists_url":"https://api.github.com/users/janvanmansum/gists{/gist_id}","starred_url":"https://api.github.com/users/janvanmansum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janvanmansum/subscriptions","organizations_url":"https://api.github.com/users/janvanmansum/orgs","repos_url":"https://api.github.com/users/janvanmansum/repos","events_url":"https://api.github.com/users/janvanmansum/events{/privacy}","received_events_url":"https://api.github.com/users/janvanmansum/received_events","type":"User","site_admin":false},"body":"NO JIRA.\r\n\r\nRename a temporary property  in `deposit.properties` and clean it up after use, to avoid confusion.\r\n\r\n### Some background\r\nThe property is used to record what type of messages the sword client has been sending, i.e. `application/zip` or `application/octet-stream`. This information is needed in the \"finalizing\" stage. Since deposits can be pushed back onto the finalization queue if there is not enough room for them to be processed, this means that the information must be saved to `deposit.properties`, so that a restart of `easy-sword2` will not cause those deposits never to be processed.\r\n\r\n- [x] Test\r\n\r\n#### When applied it will\r\n* Rename `contentType` to `easy-sword2.client-message.content-type`\r\n* Make sure the `easy-sword2` still understands the old property, too.\r\n* Ensure that `easy-sword2` cleans up after successfully finalizing, as the property will not be useful after that point. \r\n\r\n#### Where should the reviewer @DANS-KNAW/easy start?\r\n\r\n#### How should this be manually tested?\r\n\r\n","created_at":"2019-02-04T09:46:10Z","updated_at":"2019-02-05T10:30:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f97a4f86b84ee092b7b69ca26d4ac8cdc9391d42","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/pulls/123/commits","review_comments_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/pulls/123/comments","review_comment_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/issues/123/comments","statuses_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/statuses/15f81a356a6e0b15fcc54db8bac7c86312b6cc30","head":{"label":"janvanmansum:CLIENT_MESSAGE_CONTENT_TYPE","ref":"CLIENT_MESSAGE_CONTENT_TYPE","sha":"15f81a356a6e0b15fcc54db8bac7c86312b6cc30","user":{"login":"janvanmansum","id":3862694,"node_id":"MDQ6VXNlcjM4NjI2OTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/3862694?v=4","gravatar_id":"","url":"https://api.github.com/users/janvanmansum","html_url":"https://github.com/janvanmansum","followers_url":"https://api.github.com/users/janvanmansum/followers","following_url":"https://api.github.com/users/janvanmansum/following{/other_user}","gists_url":"https://api.github.com/users/janvanmansum/gists{/gist_id}","starred_url":"https://api.github.com/users/janvanmansum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janvanmansum/subscriptions","organizations_url":"https://api.github.com/users/janvanmansum/orgs","repos_url":"https://api.github.com/users/janvanmansum/repos","events_url":"https://api.github.com/users/janvanmansum/events{/privacy}","received_events_url":"https://api.github.com/users/janvanmansum/received_events","type":"User","site_admin":false},"repo":{"id":98659255,"node_id":"MDEwOlJlcG9zaXRvcnk5ODY1OTI1NQ==","name":"easy-sword2","full_name":"janvanmansum/easy-sword2","private":false,"owner":{"login":"janvanmansum","id":3862694,"node_id":"MDQ6VXNlcjM4NjI2OTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/3862694?v=4","gravatar_id":"","url":"https://api.github.com/users/janvanmansum","html_url":"https://github.com/janvanmansum","followers_url":"https://api.github.com/users/janvanmansum/followers","following_url":"https://api.github.com/users/janvanmansum/following{/other_user}","gists_url":"https://api.github.com/users/janvanmansum/gists{/gist_id}","starred_url":"https://api.github.com/users/janvanmansum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janvanmansum/subscriptions","organizations_url":"https://api.github.com/users/janvanmansum/orgs","repos_url":"https://api.github.com/users/janvanmansum/repos","events_url":"https://api.github.com/users/janvanmansum/events{/privacy}","received_events_url":"https://api.github.com/users/janvanmansum/received_events","type":"User","site_admin":false},"html_url":"https://github.com/janvanmansum/easy-sword2","description":"SWORD v2.0 based deposit service","fork":true,"url":"https://api.github.com/repos/janvanmansum/easy-sword2","forks_url":"https://api.github.com/repos/janvanmansum/easy-sword2/forks","keys_url":"https://api.github.com/repos/janvanmansum/easy-sword2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/janvanmansum/easy-sword2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/janvanmansum/easy-sword2/teams","hooks_url":"https://api.github.com/repos/janvanmansum/easy-sword2/hooks","issue_events_url":"https://api.github.com/repos/janvanmansum/easy-sword2/issues/events{/number}","events_url":"https://api.github.com/repos/janvanmansum/easy-sword2/events","assignees_url":"https://api.github.com/repos/janvanmansum/easy-sword2/assignees{/user}","branches_url":"https://api.github.com/repos/janvanmansum/easy-sword2/branches{/branch}","tags_url":"https://api.github.com/repos/janvanmansum/easy-sword2/tags","blobs_url":"https://api.github.com/repos/janvanmansum/easy-sword2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/janvanmansum/easy-sword2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/janvanmansum/easy-sword2/git/refs{/sha}","trees_url":"https://api.github.com/repos/janvanmansum/easy-sword2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/janvanmansum/easy-sword2/statuses/{sha}","languages_url":"https://api.github.com/repos/janvanmansum/easy-sword2/languages","stargazers_url":"https://api.github.com/repos/janvanmansum/easy-sword2/stargazers","contributors_url":"https://api.github.com/repos/janvanmansum/easy-sword2/contributors","subscribers_url":"https://api.github.com/repos/janvanmansum/easy-sword2/subscribers","subscription_url":"https://api.github.com/repos/janvanmansum/easy-sword2/subscription","commits_url":"https://api.github.com/repos/janvanmansum/easy-sword2/commits{/sha}","git_commits_url":"https://api.github.com/repos/janvanmansum/easy-sword2/git/commits{/sha}","comments_url":"https://api.github.com/repos/janvanmansum/easy-sword2/comments{/number}","issue_comment_url":"https://api.github.com/repos/janvanmansum/easy-sword2/issues/comments{/number}","contents_url":"https://api.github.com/repos/janvanmansum/easy-sword2/contents/{+path}","compare_url":"https://api.github.com/repos/janvanmansum/easy-sword2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/janvanmansum/easy-sword2/merges","archive_url":"https://api.github.com/repos/janvanmansum/easy-sword2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/janvanmansum/easy-sword2/downloads","issues_url":"https://api.github.com/repos/janvanmansum/easy-sword2/issues{/number}","pulls_url":"https://api.github.com/repos/janvanmansum/easy-sword2/pulls{/number}","milestones_url":"https://api.github.com/repos/janvanmansum/easy-sword2/milestones{/number}","notifications_url":"https://api.github.com/repos/janvanmansum/easy-sword2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/janvanmansum/easy-sword2/labels{/name}","releases_url":"https://api.github.com/repos/janvanmansum/easy-sword2/releases{/id}","deployments_url":"https://api.github.com/repos/janvanmansum/easy-sword2/deployments","created_at":"2017-07-28T14:48:35Z","updated_at":"2017-07-28T14:48:37Z","pushed_at":"2019-02-05T10:27:11Z","git_url":"git://github.com/janvanmansum/easy-sword2.git","ssh_url":"git@github.com:janvanmansum/easy-sword2.git","clone_url":"https://github.com/janvanmansum/easy-sword2.git","svn_url":"https://github.com/janvanmansum/easy-sword2","homepage":"","size":4100,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"DANS-KNAW:master","ref":"master","sha":"0b99863d582c9b7b279991605289758917b42ef4","user":{"login":"DANS-KNAW","id":7858446,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4NTg0NDY=","avatar_url":"https://avatars3.githubusercontent.com/u/7858446?v=4","gravatar_id":"","url":"https://api.github.com/users/DANS-KNAW","html_url":"https://github.com/DANS-KNAW","followers_url":"https://api.github.com/users/DANS-KNAW/followers","following_url":"https://api.github.com/users/DANS-KNAW/following{/other_user}","gists_url":"https://api.github.com/users/DANS-KNAW/gists{/gist_id}","starred_url":"https://api.github.com/users/DANS-KNAW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DANS-KNAW/subscriptions","organizations_url":"https://api.github.com/users/DANS-KNAW/orgs","repos_url":"https://api.github.com/users/DANS-KNAW/repos","events_url":"https://api.github.com/users/DANS-KNAW/events{/privacy}","received_events_url":"https://api.github.com/users/DANS-KNAW/received_events","type":"Organization","site_admin":false},"repo":{"id":38121794,"node_id":"MDEwOlJlcG9zaXRvcnkzODEyMTc5NA==","name":"easy-sword2","full_name":"DANS-KNAW/easy-sword2","private":false,"owner":{"login":"DANS-KNAW","id":7858446,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4NTg0NDY=","avatar_url":"https://avatars3.githubusercontent.com/u/7858446?v=4","gravatar_id":"","url":"https://api.github.com/users/DANS-KNAW","html_url":"https://github.com/DANS-KNAW","followers_url":"https://api.github.com/users/DANS-KNAW/followers","following_url":"https://api.github.com/users/DANS-KNAW/following{/other_user}","gists_url":"https://api.github.com/users/DANS-KNAW/gists{/gist_id}","starred_url":"https://api.github.com/users/DANS-KNAW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DANS-KNAW/subscriptions","organizations_url":"https://api.github.com/users/DANS-KNAW/orgs","repos_url":"https://api.github.com/users/DANS-KNAW/repos","events_url":"https://api.github.com/users/DANS-KNAW/events{/privacy}","received_events_url":"https://api.github.com/users/DANS-KNAW/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DANS-KNAW/easy-sword2","description":"SWORD v2.0 based deposit service","fork":false,"url":"https://api.github.com/repos/DANS-KNAW/easy-sword2","forks_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/forks","keys_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/teams","hooks_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/hooks","issue_events_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/issues/events{/number}","events_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/events","assignees_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/assignees{/user}","branches_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/branches{/branch}","tags_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/tags","blobs_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/git/refs{/sha}","trees_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/statuses/{sha}","languages_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/languages","stargazers_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/stargazers","contributors_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/contributors","subscribers_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/subscribers","subscription_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/subscription","commits_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/commits{/sha}","git_commits_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/git/commits{/sha}","comments_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/comments{/number}","issue_comment_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/issues/comments{/number}","contents_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/contents/{+path}","compare_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/merges","archive_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/downloads","issues_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/issues{/number}","pulls_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/pulls{/number}","milestones_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/milestones{/number}","notifications_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/labels{/name}","releases_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/releases{/id}","deployments_url":"https://api.github.com/repos/DANS-KNAW/easy-sword2/deployments","created_at":"2015-06-26T16:34:36Z","updated_at":"2019-01-31T15:44:28Z","pushed_at":"2019-02-05T10:27:13Z","git_url":"git://github.com/DANS-KNAW/easy-sword2.git","ssh_url":"git@github.com:DANS-KNAW/easy-sword2.git","clone_url":"https://github.com/DANS-KNAW/easy-sword2.git","svn_url":"https://github.com/DANS-KNAW/easy-sword2","homepage":"","size":4109,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":9,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DANS-KNAW/easy-sword2/pulls/123"},"html":{"href":"https://github.com/DANS-KNAW/easy-sword2/pull/123"},"issue":{"href":"https://api.github.com/repos/DANS-KNAW/easy-sword2/issues/123"},"comments":{"href":"https://api.github.com/repos/DANS-KNAW/easy-sword2/issues/123/comments"},"review_comments":{"href":"https://api.github.com/repos/DANS-KNAW/easy-sword2/pulls/123/comments"},"review_comment":{"href":"https://api.github.com/repos/DANS-KNAW/easy-sword2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DANS-KNAW/easy-sword2/pulls/123/commits"},"statuses":{"href":"https://api.github.com/repos/DANS-KNAW/easy-sword2/statuses/15f81a356a6e0b15fcc54db8bac7c86312b6cc30"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rvanheest"}}