{"action":"created","comment":{"url":"https://api.github.com/repos/vinyldns/vinyldns/pulls/comments/289126563","pull_request_review_id":243970508,"id":289126563,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4OTEyNjU2Mw==","diff_hunk":"@@ -178,6 +178,23 @@ class BatchChangeService(\n     } yield ExistingRecordSets(recordSetsWithExistingZone)\n   }\n \n+  def doTtlMapping(\n+      changes: ValidatedBatch[ChangeForValidation],\n+      existingRecordSets: ExistingRecordSets): ValidatedBatch[ChangeForValidation] =\n+    changes.mapValid {\n+      case add: AddChangeForValidation =>\n+        existingRecordSets\n+          .get(add.recordKey)\n+          .map { rs =>\n+            val ttl = add.inputChange.ttl.getOrElse(rs.ttl)\n+            val changeWithTtl = add.inputChange.copy(ttl = Some(ttl))\n+            add.copy(inputChange = changeWithTtl)\n+          }\n+          .getOrElse(add)","path":"modules/api/src/main/scala/vinyldns/api/domain/batch/BatchChangeService.scala","position":16,"original_position":16,"commit_id":"5cda6aa097dea53c70e96090a055a00b198d67e3","original_commit_id":"5cda6aa097dea53c70e96090a055a00b198d67e3","user":{"login":"rebstar6","id":4467125,"node_id":"MDQ6VXNlcjQ0NjcxMjU=","avatar_url":"https://avatars3.githubusercontent.com/u/4467125?v=4","gravatar_id":"","url":"https://api.github.com/users/rebstar6","html_url":"https://github.com/rebstar6","followers_url":"https://api.github.com/users/rebstar6/followers","following_url":"https://api.github.com/users/rebstar6/following{/other_user}","gists_url":"https://api.github.com/users/rebstar6/gists{/gist_id}","starred_url":"https://api.github.com/users/rebstar6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebstar6/subscriptions","organizations_url":"https://api.github.com/users/rebstar6/orgs","repos_url":"https://api.github.com/users/rebstar6/repos","events_url":"https://api.github.com/users/rebstar6/events{/privacy}","received_events_url":"https://api.github.com/users/rebstar6/received_events","type":"User","site_admin":false},"body":"doing this all with copy is a little yucky. the alternative would be to add another trait/type for addchanges that is identical to AddChangeForValidation but has a required ttl. it's feels like a lot of overhead","created_at":"2019-05-30T18:58:41Z","updated_at":"2019-05-30T18:58:42Z","html_url":"https://github.com/vinyldns/vinyldns/pull/666#discussion_r289126563","pull_request_url":"https://api.github.com/repos/vinyldns/vinyldns/pulls/666","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/vinyldns/vinyldns/pulls/comments/289126563"},"html":{"href":"https://github.com/vinyldns/vinyldns/pull/666#discussion_r289126563"},"pull_request":{"href":"https://api.github.com/repos/vinyldns/vinyldns/pulls/666"}}},"pull_request":{"url":"https://api.github.com/repos/vinyldns/vinyldns/pulls/666","id":283684130,"node_id":"MDExOlB1bGxSZXF1ZXN0MjgzNjg0MTMw","html_url":"https://github.com/vinyldns/vinyldns/pull/666","diff_url":"https://github.com/vinyldns/vinyldns/pull/666.diff","patch_url":"https://github.com/vinyldns/vinyldns/pull/666.patch","issue_url":"https://api.github.com/repos/vinyldns/vinyldns/issues/666","number":666,"state":"open","locked":false,"title":"WIP - ttl defaults, do not update TTL if excluded","user":{"login":"rebstar6","id":4467125,"node_id":"MDQ6VXNlcjQ0NjcxMjU=","avatar_url":"https://avatars3.githubusercontent.com/u/4467125?v=4","gravatar_id":"","url":"https://api.github.com/users/rebstar6","html_url":"https://github.com/rebstar6","followers_url":"https://api.github.com/users/rebstar6/followers","following_url":"https://api.github.com/users/rebstar6/following{/other_user}","gists_url":"https://api.github.com/users/rebstar6/gists{/gist_id}","starred_url":"https://api.github.com/users/rebstar6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebstar6/subscriptions","organizations_url":"https://api.github.com/users/rebstar6/orgs","repos_url":"https://api.github.com/users/rebstar6/repos","events_url":"https://api.github.com/users/rebstar6/events{/privacy}","received_events_url":"https://api.github.com/users/rebstar6/received_events","type":"User","site_admin":false},"body":"- make batch ttl optional\r\n- if not provided, add should go to default, update should remain unchanged","created_at":"2019-05-30T14:47:39Z","updated_at":"2019-05-30T18:58:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e6c0efd622e46561a97c6f4fc798eeea32a26d0","assignee":{"login":"rebstar6","id":4467125,"node_id":"MDQ6VXNlcjQ0NjcxMjU=","avatar_url":"https://avatars3.githubusercontent.com/u/4467125?v=4","gravatar_id":"","url":"https://api.github.com/users/rebstar6","html_url":"https://github.com/rebstar6","followers_url":"https://api.github.com/users/rebstar6/followers","following_url":"https://api.github.com/users/rebstar6/following{/other_user}","gists_url":"https://api.github.com/users/rebstar6/gists{/gist_id}","starred_url":"https://api.github.com/users/rebstar6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebstar6/subscriptions","organizations_url":"https://api.github.com/users/rebstar6/orgs","repos_url":"https://api.github.com/users/rebstar6/repos","events_url":"https://api.github.com/users/rebstar6/events{/privacy}","received_events_url":"https://api.github.com/users/rebstar6/received_events","type":"User","site_admin":false},"assignees":[{"login":"rebstar6","id":4467125,"node_id":"MDQ6VXNlcjQ0NjcxMjU=","avatar_url":"https://avatars3.githubusercontent.com/u/4467125?v=4","gravatar_id":"","url":"https://api.github.com/users/rebstar6","html_url":"https://github.com/rebstar6","followers_url":"https://api.github.com/users/rebstar6/followers","following_url":"https://api.github.com/users/rebstar6/following{/other_user}","gists_url":"https://api.github.com/users/rebstar6/gists{/gist_id}","starred_url":"https://api.github.com/users/rebstar6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebstar6/subscriptions","organizations_url":"https://api.github.com/users/rebstar6/orgs","repos_url":"https://api.github.com/users/rebstar6/repos","events_url":"https://api.github.com/users/rebstar6/events{/privacy}","received_events_url":"https://api.github.com/users/rebstar6/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/vinyldns/vinyldns/milestones/7","html_url":"https://github.com/vinyldns/vinyldns/milestone/7","labels_url":"https://api.github.com/repos/vinyldns/vinyldns/milestones/7/labels","id":4343065,"node_id":"MDk6TWlsZXN0b25lNDM0MzA2NQ==","number":7,"title":"🎤","description":"Sprint K (emoji is microphone for Karaoke 😄)","creator":{"login":"britneywright","id":4439228,"node_id":"MDQ6VXNlcjQ0MzkyMjg=","avatar_url":"https://avatars2.githubusercontent.com/u/4439228?v=4","gravatar_id":"","url":"https://api.github.com/users/britneywright","html_url":"https://github.com/britneywright","followers_url":"https://api.github.com/users/britneywright/followers","following_url":"https://api.github.com/users/britneywright/following{/other_user}","gists_url":"https://api.github.com/users/britneywright/gists{/gist_id}","starred_url":"https://api.github.com/users/britneywright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/britneywright/subscriptions","organizations_url":"https://api.github.com/users/britneywright/orgs","repos_url":"https://api.github.com/users/britneywright/repos","events_url":"https://api.github.com/users/britneywright/events{/privacy}","received_events_url":"https://api.github.com/users/britneywright/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":5,"state":"open","created_at":"2019-05-23T19:13:04Z","updated_at":"2019-05-30T18:16:09Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/vinyldns/vinyldns/pulls/666/commits","review_comments_url":"https://api.github.com/repos/vinyldns/vinyldns/pulls/666/comments","review_comment_url":"https://api.github.com/repos/vinyldns/vinyldns/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vinyldns/vinyldns/issues/666/comments","statuses_url":"https://api.github.com/repos/vinyldns/vinyldns/statuses/5cda6aa097dea53c70e96090a055a00b198d67e3","head":{"label":"rebstar6:optionTtl2","ref":"optionTtl2","sha":"5cda6aa097dea53c70e96090a055a00b198d67e3","user":{"login":"rebstar6","id":4467125,"node_id":"MDQ6VXNlcjQ0NjcxMjU=","avatar_url":"https://avatars3.githubusercontent.com/u/4467125?v=4","gravatar_id":"","url":"https://api.github.com/users/rebstar6","html_url":"https://github.com/rebstar6","followers_url":"https://api.github.com/users/rebstar6/followers","following_url":"https://api.github.com/users/rebstar6/following{/other_user}","gists_url":"https://api.github.com/users/rebstar6/gists{/gist_id}","starred_url":"https://api.github.com/users/rebstar6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebstar6/subscriptions","organizations_url":"https://api.github.com/users/rebstar6/orgs","repos_url":"https://api.github.com/users/rebstar6/repos","events_url":"https://api.github.com/users/rebstar6/events{/privacy}","received_events_url":"https://api.github.com/users/rebstar6/received_events","type":"User","site_admin":false},"repo":{"id":142488818,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI0ODg4MTg=","name":"vinyldns","full_name":"rebstar6/vinyldns","private":false,"owner":{"login":"rebstar6","id":4467125,"node_id":"MDQ6VXNlcjQ0NjcxMjU=","avatar_url":"https://avatars3.githubusercontent.com/u/4467125?v=4","gravatar_id":"","url":"https://api.github.com/users/rebstar6","html_url":"https://github.com/rebstar6","followers_url":"https://api.github.com/users/rebstar6/followers","following_url":"https://api.github.com/users/rebstar6/following{/other_user}","gists_url":"https://api.github.com/users/rebstar6/gists{/gist_id}","starred_url":"https://api.github.com/users/rebstar6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebstar6/subscriptions","organizations_url":"https://api.github.com/users/rebstar6/orgs","repos_url":"https://api.github.com/users/rebstar6/repos","events_url":"https://api.github.com/users/rebstar6/events{/privacy}","received_events_url":"https://api.github.com/users/rebstar6/received_events","type":"User","site_admin":false},"html_url":"https://github.com/rebstar6/vinyldns","description":"DNS Management System","fork":true,"url":"https://api.github.com/repos/rebstar6/vinyldns","forks_url":"https://api.github.com/repos/rebstar6/vinyldns/forks","keys_url":"https://api.github.com/repos/rebstar6/vinyldns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rebstar6/vinyldns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rebstar6/vinyldns/teams","hooks_url":"https://api.github.com/repos/rebstar6/vinyldns/hooks","issue_events_url":"https://api.github.com/repos/rebstar6/vinyldns/issues/events{/number}","events_url":"https://api.github.com/repos/rebstar6/vinyldns/events","assignees_url":"https://api.github.com/repos/rebstar6/vinyldns/assignees{/user}","branches_url":"https://api.github.com/repos/rebstar6/vinyldns/branches{/branch}","tags_url":"https://api.github.com/repos/rebstar6/vinyldns/tags","blobs_url":"https://api.github.com/repos/rebstar6/vinyldns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rebstar6/vinyldns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rebstar6/vinyldns/git/refs{/sha}","trees_url":"https://api.github.com/repos/rebstar6/vinyldns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rebstar6/vinyldns/statuses/{sha}","languages_url":"https://api.github.com/repos/rebstar6/vinyldns/languages","stargazers_url":"https://api.github.com/repos/rebstar6/vinyldns/stargazers","contributors_url":"https://api.github.com/repos/rebstar6/vinyldns/contributors","subscribers_url":"https://api.github.com/repos/rebstar6/vinyldns/subscribers","subscription_url":"https://api.github.com/repos/rebstar6/vinyldns/subscription","commits_url":"https://api.github.com/repos/rebstar6/vinyldns/commits{/sha}","git_commits_url":"https://api.github.com/repos/rebstar6/vinyldns/git/commits{/sha}","comments_url":"https://api.github.com/repos/rebstar6/vinyldns/comments{/number}","issue_comment_url":"https://api.github.com/repos/rebstar6/vinyldns/issues/comments{/number}","contents_url":"https://api.github.com/repos/rebstar6/vinyldns/contents/{+path}","compare_url":"https://api.github.com/repos/rebstar6/vinyldns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rebstar6/vinyldns/merges","archive_url":"https://api.github.com/repos/rebstar6/vinyldns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rebstar6/vinyldns/downloads","issues_url":"https://api.github.com/repos/rebstar6/vinyldns/issues{/number}","pulls_url":"https://api.github.com/repos/rebstar6/vinyldns/pulls{/number}","milestones_url":"https://api.github.com/repos/rebstar6/vinyldns/milestones{/number}","notifications_url":"https://api.github.com/repos/rebstar6/vinyldns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rebstar6/vinyldns/labels{/name}","releases_url":"https://api.github.com/repos/rebstar6/vinyldns/releases{/id}","deployments_url":"https://api.github.com/repos/rebstar6/vinyldns/deployments","created_at":"2018-07-26T20:06:04Z","updated_at":"2019-05-20T18:37:17Z","pushed_at":"2019-05-30T18:57:09Z","git_url":"git://github.com/rebstar6/vinyldns.git","ssh_url":"git@github.com:rebstar6/vinyldns.git","clone_url":"https://github.com/rebstar6/vinyldns.git","svn_url":"https://github.com/rebstar6/vinyldns","homepage":null,"size":11113,"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,"disabled":false,"open_issues_count":1,"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":1,"watchers":0,"default_branch":"master"}},"base":{"label":"vinyldns:master","ref":"master","sha":"c3b437b377cb3de5531754f0f6debb450608f58e","user":{"login":"vinyldns","id":40363296,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMzYzMjk2","avatar_url":"https://avatars0.githubusercontent.com/u/40363296?v=4","gravatar_id":"","url":"https://api.github.com/users/vinyldns","html_url":"https://github.com/vinyldns","followers_url":"https://api.github.com/users/vinyldns/followers","following_url":"https://api.github.com/users/vinyldns/following{/other_user}","gists_url":"https://api.github.com/users/vinyldns/gists{/gist_id}","starred_url":"https://api.github.com/users/vinyldns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinyldns/subscriptions","organizations_url":"https://api.github.com/users/vinyldns/orgs","repos_url":"https://api.github.com/users/vinyldns/repos","events_url":"https://api.github.com/users/vinyldns/events{/privacy}","received_events_url":"https://api.github.com/users/vinyldns/received_events","type":"Organization","site_admin":false},"repo":{"id":142474323,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI0NzQzMjM=","name":"vinyldns","full_name":"vinyldns/vinyldns","private":false,"owner":{"login":"vinyldns","id":40363296,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMzYzMjk2","avatar_url":"https://avatars0.githubusercontent.com/u/40363296?v=4","gravatar_id":"","url":"https://api.github.com/users/vinyldns","html_url":"https://github.com/vinyldns","followers_url":"https://api.github.com/users/vinyldns/followers","following_url":"https://api.github.com/users/vinyldns/following{/other_user}","gists_url":"https://api.github.com/users/vinyldns/gists{/gist_id}","starred_url":"https://api.github.com/users/vinyldns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinyldns/subscriptions","organizations_url":"https://api.github.com/users/vinyldns/orgs","repos_url":"https://api.github.com/users/vinyldns/repos","events_url":"https://api.github.com/users/vinyldns/events{/privacy}","received_events_url":"https://api.github.com/users/vinyldns/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/vinyldns/vinyldns","description":"Vendor agnostic DNS front-end for streamlining DNS operations and enabling self-service for your DNS infrastructure","fork":false,"url":"https://api.github.com/repos/vinyldns/vinyldns","forks_url":"https://api.github.com/repos/vinyldns/vinyldns/forks","keys_url":"https://api.github.com/repos/vinyldns/vinyldns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vinyldns/vinyldns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vinyldns/vinyldns/teams","hooks_url":"https://api.github.com/repos/vinyldns/vinyldns/hooks","issue_events_url":"https://api.github.com/repos/vinyldns/vinyldns/issues/events{/number}","events_url":"https://api.github.com/repos/vinyldns/vinyldns/events","assignees_url":"https://api.github.com/repos/vinyldns/vinyldns/assignees{/user}","branches_url":"https://api.github.com/repos/vinyldns/vinyldns/branches{/branch}","tags_url":"https://api.github.com/repos/vinyldns/vinyldns/tags","blobs_url":"https://api.github.com/repos/vinyldns/vinyldns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vinyldns/vinyldns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vinyldns/vinyldns/git/refs{/sha}","trees_url":"https://api.github.com/repos/vinyldns/vinyldns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vinyldns/vinyldns/statuses/{sha}","languages_url":"https://api.github.com/repos/vinyldns/vinyldns/languages","stargazers_url":"https://api.github.com/repos/vinyldns/vinyldns/stargazers","contributors_url":"https://api.github.com/repos/vinyldns/vinyldns/contributors","subscribers_url":"https://api.github.com/repos/vinyldns/vinyldns/subscribers","subscription_url":"https://api.github.com/repos/vinyldns/vinyldns/subscription","commits_url":"https://api.github.com/repos/vinyldns/vinyldns/commits{/sha}","git_commits_url":"https://api.github.com/repos/vinyldns/vinyldns/git/commits{/sha}","comments_url":"https://api.github.com/repos/vinyldns/vinyldns/comments{/number}","issue_comment_url":"https://api.github.com/repos/vinyldns/vinyldns/issues/comments{/number}","contents_url":"https://api.github.com/repos/vinyldns/vinyldns/contents/{+path}","compare_url":"https://api.github.com/repos/vinyldns/vinyldns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vinyldns/vinyldns/merges","archive_url":"https://api.github.com/repos/vinyldns/vinyldns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vinyldns/vinyldns/downloads","issues_url":"https://api.github.com/repos/vinyldns/vinyldns/issues{/number}","pulls_url":"https://api.github.com/repos/vinyldns/vinyldns/pulls{/number}","milestones_url":"https://api.github.com/repos/vinyldns/vinyldns/milestones{/number}","notifications_url":"https://api.github.com/repos/vinyldns/vinyldns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vinyldns/vinyldns/labels{/name}","releases_url":"https://api.github.com/repos/vinyldns/vinyldns/releases{/id}","deployments_url":"https://api.github.com/repos/vinyldns/vinyldns/deployments","created_at":"2018-07-26T17:43:18Z","updated_at":"2019-05-30T15:46:53Z","pushed_at":"2019-05-30T18:57:10Z","git_url":"git://github.com/vinyldns/vinyldns.git","ssh_url":"git@github.com:vinyldns/vinyldns.git","clone_url":"https://github.com/vinyldns/vinyldns.git","svn_url":"https://github.com/vinyldns/vinyldns","homepage":"http://vinyldns.io/","size":12082,"stargazers_count":187,"watchers_count":187,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":53,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":105,"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":53,"open_issues":105,"watchers":187,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vinyldns/vinyldns/pulls/666"},"html":{"href":"https://github.com/vinyldns/vinyldns/pull/666"},"issue":{"href":"https://api.github.com/repos/vinyldns/vinyldns/issues/666"},"comments":{"href":"https://api.github.com/repos/vinyldns/vinyldns/issues/666/comments"},"review_comments":{"href":"https://api.github.com/repos/vinyldns/vinyldns/pulls/666/comments"},"review_comment":{"href":"https://api.github.com/repos/vinyldns/vinyldns/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vinyldns/vinyldns/pulls/666/commits"},"statuses":{"href":"https://api.github.com/repos/vinyldns/vinyldns/statuses/5cda6aa097dea53c70e96090a055a00b198d67e3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rebstar6"}}