- Notifications
You must be signed in to change notification settings - Fork928
feat: create database tables and queries for notifications#13536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
dannykopping commentedJun 11, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This stack of pull requests is managed by Graphite.Learn more about stacking. Join@dannykopping and the rest of your teammates on |
1cb776a
to25636ec
CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
coderd/database/migrations/testdata/fixtures/000219_notifications.up.sql OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Some comments below, but nothing blocking.
1c4046c
to538bc42
Comparecoderd/database/migrations/testdata/fixtures/000219_notifications.up.sql OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
538bc42
to438bcba
CompareSigned-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
This has the unfortunate side-effect of not allowing the AcquireNotificationMessagesRow.Payload type to be overriden to []byte as it was previously, but it does not change the semanticsSigned-off-by: Danny Kopping <danny@coder.com>
438bcba
toc1a3010
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@spikecurtis I'm back from PTO. I believe I've addressed all of your comments.
Can you please have another look?
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
One comment inline, but I don't need to review again.
WHEN (attempt_count + 1 < @max_attempts::int) | ||
THEN NOW() + CONCAT(@retry_interval::int, ' seconds')::interval END | ||
FROM (SELECT id, status, status_reason, failed_at | ||
FROM new_values) AS subquery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This query is also doing theWITH new_values
thing where we then essentially renamenew_values
tosubquery
. Can be simplified to remove theWITH
clause and unnest the values here in theFROM
clause.
Signed-off-by: Danny Kopping <danny@coder.com>
0a221e8
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Creates two new tables:
notification_templates
: templates are used to create notifications from, and specify a unique event in the systemnotification_messages
: each record corresponds to a separate notification which must be delivered to a userAcquireNotificationMessages
)coderd/database/migrations/000219_notifications.up.sql
inserts a single template ("Workspace Deleted"), for which we are creating this vertical slice in this initial stack of PRs.