Skip to content

Commit

Permalink
🐝 (baking) report explorers with missing variable IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Apr 30, 2024
1 parent b17518d commit 81fbe0a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions baker/siteRenderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,18 @@ export const renderExplorerPage = async (
`SELECT id, grapherConfigETL, grapherConfigAdmin FROM variables WHERE id IN (?)`,
[requiredVariableIds]
)

// check if all required variable IDs exist in the database
const missingIds = requiredVariableIds.filter(
(id) => !partialGrapherConfigRows.find((row) => row.id === id)
)
if (missingIds.length > 0) {
void logErrorAndMaybeSendToBugsnag(
new JsonError(
`Referenced variable IDs do not exist in the database for explorer ${program.slug}: ${missingIds.join(", ")}.`
)
)
}
}

const parseGrapherConfigFromRow = (row: ChartRow): GrapherInterface => {
Expand Down

0 comments on commit 81fbe0a

Please sign in to comment.