codemonitors: Clean up CodeMonitorStore
There are no commits yet
Push commits to the source branch or add previously merged commits to review them.
Created by: camdencheek
Welcome to this monster housecleaning PR for CodeMonitor store. I started making small housecleaning PRs to bring our CodeMonitorStore up to current standards and make it a more idiomatic store, but there were many changes, so I decided it was better to rip off the band-aid and make one massive PR with all the changes. I could make these commits all separate PRs, but then it would take all week to get them reviewed, rebased, and merged.
A brief tour of what you'll find in this PR:
QueryRow
where applicable for easier scanning/error handlinginteger
/serial
-> int32
and bigint
/bigserial
-> int64
)*sql.Rows
in the function where it was createdGlossary:
Trigger
: an event that "triggers" a set of code monitor actions. Currently our only trigger is a QueryTrigger
.Action
: a response to a trigger event. Currently, our only action is EmailAction
, but this will be expanded very soon to include Webhook
and SlackWebhook
.Job
: an asynchronously scheduled task that is executed by a worker. In the context of code monitors, this will be either a trigger job (execute a search and see if there are results) or an action job (send an email, execute a webhook, etc.)TriggerJob
: an execution of a trigger check to see if there are any new events. In this case, all trigger jobs are search executions.ActionJob
: an execution of a configured Action
. Currently, only "send an email".QueryTrigger
: a Trigger
that checks if the results of a commit or diff search returns any new resultsEmailAction
: an Action
that sends an email to the configured recipient in response to an event from a Trigger
Review notes:
What this PR does not cover:
graphqlbackend
packageenterprise/internal/database
(dependent on the removal of graphqlbackend
dependency)workerutil
packagedbconn.Global
in testsnow()
rather than passing it in the query. This might not be reasonable depending on tests.
Push commits to the source branch or add previously merged commits to review them.