Closed matthinz closed 1 month ago
Over on #11254 there was a great suggestion to log an event when a certain step's preconditions fail. The problem was that
step_info
is implemented as a static method on controllers, andanalytics
is only available to individual instances.So this PR updates the signature of the
preconditions
proc to include ananalytics:
argument, and ensures that it is passed properly byIdvStepConcern
.
I skimmed that PR and didn't see a good thread to follow onto... so some overall feedback:
I am skeptical of this approach! preconditions
seems like a pure method that we would expect to be free of side-effects, and logging analytics is inherently a side effect. I feel like if we are actively doing a check and expecting something to happen after, that seems like a great candidate for a controller. Or maybe there's some sort of other "event" step we could create a hook for? Like on_precondition_check_fail
or something? But to me, preconditions
seems like a spot I would not expect this in.
@zachmargolis Yeah, that's a fair point. Lemme noodle on this
🎫 Ticket
Relates to work for LG-14393
🛠Summary of changes
Over on #11254 there was a great suggestion to log an event when a certain step's preconditions fail. The problem was that
step_info
is implemented as a static method on controllers, andanalytics
is only available to individual instances.So this PR updates the signature of the
preconditions
proc to include ananalytics:
argument, and ensures that it is passed properly byIdvStepConcern
.