Something went wrong while fetching comments. Please try again.
Created by: camdencheek
This is an "RFC PR." I'm making this a PR because attempting the refactor was easier than trying to write up the idea. I want to get people's take on the direction this is going. I'm happy to abandon this or make a replacement PR if this isn't a direction we want to go.
This PR attempts begins a refactor of our search alerts with a few goals in mind:
internal/search/alert
The motivation for this is twofold:
graphqlbackend, but that is difficult to do since alertFromError referenced error types defined in graphqlbackend. This is blocks moving alertObserver and, by proxy, aggregator.The solution presented by this PR:
internal/search/alert.Alert and cmd/frontend/graphqlbackend.searchAlertResolver. This makes the resolver a thin wrapper type around the alert.internal/search/alert.AlertableError. This is an error type that can be unwrapped, yielding the original error and an alert that is defined at the time AlertableError is created. This allows us to create our alerts at the source.alertFromError so that attempts to unwrap into an AlertableError, then return the alert if it succeeds.alertFromError to not reference any specific error types in graphqlbackend, so it can live in internal/search/alert.Observer
Stacked on #20915