{"action":"created","comment":{"url":"https://api.github.com/repos/grafana/grafana/pulls/comments/191229076","pull_request_review_id":123762100,"id":191229076,"diff_hunk":"@@ -192,3 +222,42 @@ func UpdateAlertNotification(cmd *m.UpdateAlertNotificationCommand) error {\n \t\treturn nil\n \t})\n }\n+\n+func RecordNotificationJournal(cmd *m.RecordNotificationJournalCommand) error {\n+\treturn inTransaction(func(sess *DBSession) error {\n+\t\tjournalEntry := &m.NotificationJournal{\n+\t\t\tOrgId:      cmd.OrgId,\n+\t\t\tAlertId:    cmd.AlertId,\n+\t\t\tNotifierId: cmd.NotifierId,\n+\t\t\tSentAt:     cmd.SentAt,\n+\t\t\tSuccess:    cmd.Success,\n+\t\t}\n+\n+\t\tif _, err := sess.Insert(journalEntry); err != nil {\n+\t\t\treturn err\n+\t\t}\n+\n+\t\treturn nil\n+\t})\n+}\n+\n+func GetLatestNotification(cmd *m.GetLatestNotificationQuery) error {","path":"pkg/services/sqlstore/alert_notification.go","position":114,"original_position":114,"commit_id":"7aad7d85fa2523f339ce7742ef3c5a0d440f94c8","original_commit_id":"7aad7d85fa2523f339ce7742ef3c5a0d440f94c8","user":{"login":"jbaublitz","id":4952094,"avatar_url":"https://avatars1.githubusercontent.com/u/4952094?v=4","gravatar_id":"","url":"https://api.github.com/users/jbaublitz","html_url":"https://github.com/jbaublitz","followers_url":"https://api.github.com/users/jbaublitz/followers","following_url":"https://api.github.com/users/jbaublitz/following{/other_user}","gists_url":"https://api.github.com/users/jbaublitz/gists{/gist_id}","starred_url":"https://api.github.com/users/jbaublitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbaublitz/subscriptions","organizations_url":"https://api.github.com/users/jbaublitz/orgs","repos_url":"https://api.github.com/users/jbaublitz/repos","events_url":"https://api.github.com/users/jbaublitz/events{/privacy}","received_events_url":"https://api.github.com/users/jbaublitz/received_events","type":"User","site_admin":false},"body":"Let me see if I can reproduce - before the changes I verified in the database that it was returning the correct entry so let me just make sure that it's my most recent commit that broke this.","created_at":"2018-05-28T15:08:29Z","updated_at":"2018-05-28T15:08:29Z","html_url":"https://github.com/grafana/grafana/pull/10528#discussion_r191229076","pull_request_url":"https://api.github.com/repos/grafana/grafana/pulls/10528","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/grafana/grafana/pulls/comments/191229076"},"html":{"href":"https://github.com/grafana/grafana/pull/10528#discussion_r191229076"},"pull_request":{"href":"https://api.github.com/repos/grafana/grafana/pulls/10528"}},"in_reply_to_id":191151890},"pull_request":{"url":"https://api.github.com/repos/grafana/grafana/pulls/10528","id":163196984,"html_url":"https://github.com/grafana/grafana/pull/10528","diff_url":"https://github.com/grafana/grafana/pull/10528.diff","patch_url":"https://github.com/grafana/grafana/pull/10528.patch","issue_url":"https://api.github.com/repos/grafana/grafana/issues/10528","number":10528,"state":"open","locked":false,"title":"Feature for alerting to allow notifications every number of alert evaluations","user":{"login":"jbaublitz","id":4952094,"avatar_url":"https://avatars1.githubusercontent.com/u/4952094?v=4","gravatar_id":"","url":"https://api.github.com/users/jbaublitz","html_url":"https://github.com/jbaublitz","followers_url":"https://api.github.com/users/jbaublitz/followers","following_url":"https://api.github.com/users/jbaublitz/following{/other_user}","gists_url":"https://api.github.com/users/jbaublitz/gists{/gist_id}","starred_url":"https://api.github.com/users/jbaublitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbaublitz/subscriptions","organizations_url":"https://api.github.com/users/jbaublitz/orgs","repos_url":"https://api.github.com/users/jbaublitz/repos","events_url":"https://api.github.com/users/jbaublitz/events{/privacy}","received_events_url":"https://api.github.com/users/jbaublitz/received_events","type":"User","site_admin":false},"body":"This is in response to issue #7330. This pull request adds UI support for both the legacy option of notifications on state change only and also for notifications every certain number of evaluations.\r\n\r\nPractical things I would like feedback on:\r\n1. The changes to the database schema. I think this was done properly to work with migrations so nothing breaks when updating but I am unsure.\r\n2. Should I add API support as well? If so I am happy to add that in.\r\n\r\nI've tested the notification strategy for webhooks and it updates the database when changing strategies and the behavior for notification frequency is as expected in both cases. If there are any other questions or concerns, please let me know. ","created_at":"2018-01-16T14:46:13Z","updated_at":"2018-05-28T15:08:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63a3884f2d7c7c7a6287dd05b7a5c11875159fe0","assignee":{"login":"bergquist","id":618863,"avatar_url":"https://avatars0.githubusercontent.com/u/618863?v=4","gravatar_id":"","url":"https://api.github.com/users/bergquist","html_url":"https://github.com/bergquist","followers_url":"https://api.github.com/users/bergquist/followers","following_url":"https://api.github.com/users/bergquist/following{/other_user}","gists_url":"https://api.github.com/users/bergquist/gists{/gist_id}","starred_url":"https://api.github.com/users/bergquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bergquist/subscriptions","organizations_url":"https://api.github.com/users/bergquist/orgs","repos_url":"https://api.github.com/users/bergquist/repos","events_url":"https://api.github.com/users/bergquist/events{/privacy}","received_events_url":"https://api.github.com/users/bergquist/received_events","type":"User","site_admin":false},"assignees":[{"login":"bergquist","id":618863,"avatar_url":"https://avatars0.githubusercontent.com/u/618863?v=4","gravatar_id":"","url":"https://api.github.com/users/bergquist","html_url":"https://github.com/bergquist","followers_url":"https://api.github.com/users/bergquist/followers","following_url":"https://api.github.com/users/bergquist/following{/other_user}","gists_url":"https://api.github.com/users/bergquist/gists{/gist_id}","starred_url":"https://api.github.com/users/bergquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bergquist/subscriptions","organizations_url":"https://api.github.com/users/bergquist/orgs","repos_url":"https://api.github.com/users/bergquist/repos","events_url":"https://api.github.com/users/bergquist/events{/privacy}","received_events_url":"https://api.github.com/users/bergquist/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/grafana/grafana/pulls/10528/commits","review_comments_url":"https://api.github.com/repos/grafana/grafana/pulls/10528/comments","review_comment_url":"https://api.github.com/repos/grafana/grafana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grafana/grafana/issues/10528/comments","statuses_url":"https://api.github.com/repos/grafana/grafana/statuses/7aad7d85fa2523f339ce7742ef3c5a0d440f94c8","head":{"label":"jbaublitz:alerting-feature","ref":"alerting-feature","sha":"7aad7d85fa2523f339ce7742ef3c5a0d440f94c8","user":{"login":"jbaublitz","id":4952094,"avatar_url":"https://avatars1.githubusercontent.com/u/4952094?v=4","gravatar_id":"","url":"https://api.github.com/users/jbaublitz","html_url":"https://github.com/jbaublitz","followers_url":"https://api.github.com/users/jbaublitz/followers","following_url":"https://api.github.com/users/jbaublitz/following{/other_user}","gists_url":"https://api.github.com/users/jbaublitz/gists{/gist_id}","starred_url":"https://api.github.com/users/jbaublitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbaublitz/subscriptions","organizations_url":"https://api.github.com/users/jbaublitz/orgs","repos_url":"https://api.github.com/users/jbaublitz/repos","events_url":"https://api.github.com/users/jbaublitz/events{/privacy}","received_events_url":"https://api.github.com/users/jbaublitz/received_events","type":"User","site_admin":false},"repo":{"id":113898728,"name":"grafana","full_name":"jbaublitz/grafana","owner":{"login":"jbaublitz","id":4952094,"avatar_url":"https://avatars1.githubusercontent.com/u/4952094?v=4","gravatar_id":"","url":"https://api.github.com/users/jbaublitz","html_url":"https://github.com/jbaublitz","followers_url":"https://api.github.com/users/jbaublitz/followers","following_url":"https://api.github.com/users/jbaublitz/following{/other_user}","gists_url":"https://api.github.com/users/jbaublitz/gists{/gist_id}","starred_url":"https://api.github.com/users/jbaublitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbaublitz/subscriptions","organizations_url":"https://api.github.com/users/jbaublitz/orgs","repos_url":"https://api.github.com/users/jbaublitz/repos","events_url":"https://api.github.com/users/jbaublitz/events{/privacy}","received_events_url":"https://api.github.com/users/jbaublitz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jbaublitz/grafana","description":"The tool for beautiful monitoring and metric analytics & dashboards for Graphite, InfluxDB & Prometheus & More","fork":true,"url":"https://api.github.com/repos/jbaublitz/grafana","forks_url":"https://api.github.com/repos/jbaublitz/grafana/forks","keys_url":"https://api.github.com/repos/jbaublitz/grafana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jbaublitz/grafana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jbaublitz/grafana/teams","hooks_url":"https://api.github.com/repos/jbaublitz/grafana/hooks","issue_events_url":"https://api.github.com/repos/jbaublitz/grafana/issues/events{/number}","events_url":"https://api.github.com/repos/jbaublitz/grafana/events","assignees_url":"https://api.github.com/repos/jbaublitz/grafana/assignees{/user}","branches_url":"https://api.github.com/repos/jbaublitz/grafana/branches{/branch}","tags_url":"https://api.github.com/repos/jbaublitz/grafana/tags","blobs_url":"https://api.github.com/repos/jbaublitz/grafana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jbaublitz/grafana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jbaublitz/grafana/git/refs{/sha}","trees_url":"https://api.github.com/repos/jbaublitz/grafana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jbaublitz/grafana/statuses/{sha}","languages_url":"https://api.github.com/repos/jbaublitz/grafana/languages","stargazers_url":"https://api.github.com/repos/jbaublitz/grafana/stargazers","contributors_url":"https://api.github.com/repos/jbaublitz/grafana/contributors","subscribers_url":"https://api.github.com/repos/jbaublitz/grafana/subscribers","subscription_url":"https://api.github.com/repos/jbaublitz/grafana/subscription","commits_url":"https://api.github.com/repos/jbaublitz/grafana/commits{/sha}","git_commits_url":"https://api.github.com/repos/jbaublitz/grafana/git/commits{/sha}","comments_url":"https://api.github.com/repos/jbaublitz/grafana/comments{/number}","issue_comment_url":"https://api.github.com/repos/jbaublitz/grafana/issues/comments{/number}","contents_url":"https://api.github.com/repos/jbaublitz/grafana/contents/{+path}","compare_url":"https://api.github.com/repos/jbaublitz/grafana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jbaublitz/grafana/merges","archive_url":"https://api.github.com/repos/jbaublitz/grafana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jbaublitz/grafana/downloads","issues_url":"https://api.github.com/repos/jbaublitz/grafana/issues{/number}","pulls_url":"https://api.github.com/repos/jbaublitz/grafana/pulls{/number}","milestones_url":"https://api.github.com/repos/jbaublitz/grafana/milestones{/number}","notifications_url":"https://api.github.com/repos/jbaublitz/grafana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jbaublitz/grafana/labels{/name}","releases_url":"https://api.github.com/repos/jbaublitz/grafana/releases{/id}","deployments_url":"https://api.github.com/repos/jbaublitz/grafana/deployments","created_at":"2017-12-11T19:21:13Z","updated_at":"2017-12-11T19:21:19Z","pushed_at":"2018-05-25T18:14:59Z","git_url":"git://github.com/jbaublitz/grafana.git","ssh_url":"git@github.com:jbaublitz/grafana.git","clone_url":"https://github.com/jbaublitz/grafana.git","svn_url":"https://github.com/jbaublitz/grafana","homepage":"https://grafana.com","size":162927,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"grafana:master","ref":"master","sha":"c40b0ea1dfbb824eb3c444cc39ee982c0dab04a7","user":{"login":"grafana","id":7195757,"avatar_url":"https://avatars0.githubusercontent.com/u/7195757?v=4","gravatar_id":"","url":"https://api.github.com/users/grafana","html_url":"https://github.com/grafana","followers_url":"https://api.github.com/users/grafana/followers","following_url":"https://api.github.com/users/grafana/following{/other_user}","gists_url":"https://api.github.com/users/grafana/gists{/gist_id}","starred_url":"https://api.github.com/users/grafana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grafana/subscriptions","organizations_url":"https://api.github.com/users/grafana/orgs","repos_url":"https://api.github.com/users/grafana/repos","events_url":"https://api.github.com/users/grafana/events{/privacy}","received_events_url":"https://api.github.com/users/grafana/received_events","type":"Organization","site_admin":false},"repo":{"id":15111821,"name":"grafana","full_name":"grafana/grafana","owner":{"login":"grafana","id":7195757,"avatar_url":"https://avatars0.githubusercontent.com/u/7195757?v=4","gravatar_id":"","url":"https://api.github.com/users/grafana","html_url":"https://github.com/grafana","followers_url":"https://api.github.com/users/grafana/followers","following_url":"https://api.github.com/users/grafana/following{/other_user}","gists_url":"https://api.github.com/users/grafana/gists{/gist_id}","starred_url":"https://api.github.com/users/grafana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grafana/subscriptions","organizations_url":"https://api.github.com/users/grafana/orgs","repos_url":"https://api.github.com/users/grafana/repos","events_url":"https://api.github.com/users/grafana/events{/privacy}","received_events_url":"https://api.github.com/users/grafana/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grafana/grafana","description":"The tool for beautiful monitoring and metric analytics & dashboards for Graphite, InfluxDB & Prometheus & More","fork":false,"url":"https://api.github.com/repos/grafana/grafana","forks_url":"https://api.github.com/repos/grafana/grafana/forks","keys_url":"https://api.github.com/repos/grafana/grafana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grafana/grafana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grafana/grafana/teams","hooks_url":"https://api.github.com/repos/grafana/grafana/hooks","issue_events_url":"https://api.github.com/repos/grafana/grafana/issues/events{/number}","events_url":"https://api.github.com/repos/grafana/grafana/events","assignees_url":"https://api.github.com/repos/grafana/grafana/assignees{/user}","branches_url":"https://api.github.com/repos/grafana/grafana/branches{/branch}","tags_url":"https://api.github.com/repos/grafana/grafana/tags","blobs_url":"https://api.github.com/repos/grafana/grafana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grafana/grafana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grafana/grafana/git/refs{/sha}","trees_url":"https://api.github.com/repos/grafana/grafana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grafana/grafana/statuses/{sha}","languages_url":"https://api.github.com/repos/grafana/grafana/languages","stargazers_url":"https://api.github.com/repos/grafana/grafana/stargazers","contributors_url":"https://api.github.com/repos/grafana/grafana/contributors","subscribers_url":"https://api.github.com/repos/grafana/grafana/subscribers","subscription_url":"https://api.github.com/repos/grafana/grafana/subscription","commits_url":"https://api.github.com/repos/grafana/grafana/commits{/sha}","git_commits_url":"https://api.github.com/repos/grafana/grafana/git/commits{/sha}","comments_url":"https://api.github.com/repos/grafana/grafana/comments{/number}","issue_comment_url":"https://api.github.com/repos/grafana/grafana/issues/comments{/number}","contents_url":"https://api.github.com/repos/grafana/grafana/contents/{+path}","compare_url":"https://api.github.com/repos/grafana/grafana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grafana/grafana/merges","archive_url":"https://api.github.com/repos/grafana/grafana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grafana/grafana/downloads","issues_url":"https://api.github.com/repos/grafana/grafana/issues{/number}","pulls_url":"https://api.github.com/repos/grafana/grafana/pulls{/number}","milestones_url":"https://api.github.com/repos/grafana/grafana/milestones{/number}","notifications_url":"https://api.github.com/repos/grafana/grafana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grafana/grafana/labels{/name}","releases_url":"https://api.github.com/repos/grafana/grafana/releases{/id}","deployments_url":"https://api.github.com/repos/grafana/grafana/deployments","created_at":"2013-12-11T15:59:56Z","updated_at":"2018-05-28T14:46:03Z","pushed_at":"2018-05-28T14:59:40Z","git_url":"git://github.com/grafana/grafana.git","ssh_url":"git@github.com:grafana/grafana.git","clone_url":"https://github.com/grafana/grafana.git","svn_url":"https://github.com/grafana/grafana","homepage":"https://grafana.com","size":181204,"stargazers_count":21862,"watchers_count":21862,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3901,"mirror_url":null,"archived":false,"open_issues_count":1429,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":3901,"open_issues":1429,"watchers":21862,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grafana/grafana/pulls/10528"},"html":{"href":"https://github.com/grafana/grafana/pull/10528"},"issue":{"href":"https://api.github.com/repos/grafana/grafana/issues/10528"},"comments":{"href":"https://api.github.com/repos/grafana/grafana/issues/10528/comments"},"review_comments":{"href":"https://api.github.com/repos/grafana/grafana/pulls/10528/comments"},"review_comment":{"href":"https://api.github.com/repos/grafana/grafana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grafana/grafana/pulls/10528/commits"},"statuses":{"href":"https://api.github.com/repos/grafana/grafana/statuses/7aad7d85fa2523f339ce7742ef3c5a0d440f94c8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jbaublitz"}}