Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions dashboard/src/lib/transfer-board.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { readFileSync } from 'node:fs'
import { describe, expect, it } from 'vitest'
import { RECOVERY_GUIDE, recoveryModeLabel, type RecoveryMode } from './transfer'

// The Grafana board (observability/) shows the same recovery commands as the
// SPA from its own copy: recovery-guide.json for the guide. These tests fail
// when the copy drifts from this file's builders.

const panels = new URL('../../../observability/liquidity-panels/', import.meta.url)

describe('board recovery-guide.json', () => {
it('matches RECOVERY_GUIDE and the mode labels', () => {
const guide = JSON.parse(readFileSync(new URL('recovery-guide.json', panels), 'utf8')) as {
modeLabels: Record<RecoveryMode, string>
groups: unknown
}
expect(guide.groups).toEqual(RECOVERY_GUIDE)
Comment thread
rain-marvin[bot] marked this conversation as resolved.
for (const mode of ['requires-bot', 'direct-db'] as const) {
expect(guide.modeLabels[mode]).toBe(recoveryModeLabel(mode))
}
})
})
12 changes: 12 additions & 0 deletions observability/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ every `liq_` selector and fails on one without it, because an unpinned selector
adds both sources together. Stage 4 of the migration makes `bot` the default
(`SOURCE_VAR` in the generator). See `docs/observability.md`, "Board source".

The header row is a Business Text panel (`marcusolsson-dynamictext-panel`): its
Comment thread
JuaniRios marked this conversation as resolved.
JavaScript and CSS live in `liquidity-panels/`, and the generator inlines them
into the board JSON. The plugin is installed on the box by `T0Trade/t0.devops`
(`GF_INSTALL_PLUGINS`); the PR check's throwaway Grafana does not have it, so it
Comment thread
rain-marvin[bot] marked this conversation as resolved.
loads these panels as "Panel plugin not found" and still passes.

The recovery commands in the header's guide (`recovery-guide.json`) are a copy
Comment thread
JuaniRios marked this conversation as resolved.
of the SPA's (`dashboard/src/lib/transfer.ts`), in the operations client form
for the environment the board shows. `dashboard/src/lib/transfer-board.test.ts`
fails when the copy drifts, so change the SPA and the copy together. It runs in
the dashboard build of CI.

`alerting/liquidity.rules.yml` is the alert rules, in the `Alerts` folder. Each
rule's `uid` is permanent and must be unique across every repo's file. Removing
a rule from the file does not remove it from Grafana: add its `uid` to
Expand Down
Loading
Loading