Page MenuHomePhabricator

MPIC: Log "deployment-like" events when launching/removing instruments
Closed, ResolvedPublic3 Estimated Story Points

Description

Description

At the beginning we decided to use SA (Server Admin Log) with mwbot library to log instrument interactions (for example, when launching a new one) but, at this moment, there is an open discussion about how to deal with "deployment-like" events.

The code to log those events to SAL is already working (but disabled) when launching instruments but we should work on an abstraction layer to be ready for a change regarding the way of doing this.

Extracted from the Design Document:

@cming@wikimedia.org @Sfaci@wikimedia.org Be aware that there may be a need to abstract away precisely how we're logging to the SAL (or "deployment-like" events). For now, it might do to just put the SAL-updating logic behind an interface so that it can be varied later, e.g.
interface DeploymentLogger {
async logDeployment( instrumentName, message ): void;
}

Acceptance criteria

  • Create an abstraction layer to log "deployment-like" events
  • Implement the way of logging "deployment-like" events according to the decision we finally make

Required

  • Unit/Integration tests
  • Testing instructions
  • Documentation

Event Timeline

Sfaci set the point value for this task to 3.May 20 2024, 7:37 PM

At the time of writing this, some work has been already done. Compared with the first versions, the code has been decoupled and there is an actionLogger.js library where all the code regarding "deployment-like" logs is written. At this time there is a logAction function that is the one we use to log this kind of events when registering, updating or deleting an instrument.

At this time the work is roughly done. MPIC is logging, using SAL, some actions (when an instrument is registered or remove, for example) and the code was already refactored to have a single library/file (util/actionLogger.js) that provides all the functionality with a single function that can be used anywhere to log an action easily, but we haven't created yet the interface we described in the ticket description.

The pending work here would be to refactor that library to have a more elegant way of doing that, as it's described above in the ticket description.