Skip to content
Merged
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
7 changes: 7 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"rank": "everyone",
"leaderboard": "everyone",
"profile": "everyone",
"review": "everyone",
"showcase": "everyone"
}
},
Expand Down Expand Up @@ -204,5 +205,11 @@
"announceChannelId": null,
"levelThresholds": [100, 300, 600, 1000, 1500, 2500, 4000, 6000, 8500, 12000],
"roleRewards": {}
},
"review": {
"enabled": false,
"channelId": null,
"staleAfterDays": 7,
"xpReward": 50
}
}
49 changes: 49 additions & 0 deletions migrations/010_reviews.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Migration 010 — Code Review Requests
* Creates the reviews table for the /review command.
*
* @see https://github.com/VolvoxLLC/volvox-bot/issues/49
*/

'use strict';

/**
* @param {import('pg').Pool} pool
*/
async function up(pool) {
await pool.query(`
CREATE TABLE IF NOT EXISTS reviews (
id SERIAL PRIMARY KEY,
guild_id TEXT NOT NULL,
requester_id TEXT NOT NULL,
reviewer_id TEXT,
url TEXT NOT NULL,
description TEXT NOT NULL,
language TEXT,
status TEXT DEFAULT 'open' CHECK (status IN ('open', 'claimed', 'completed', 'stale')),
message_id TEXT,
channel_id TEXT,
thread_id TEXT,
feedback TEXT,
created_at TIMESTAMPTZ DEFAULT NOW(),
claimed_at TIMESTAMPTZ,
completed_at TIMESTAMPTZ
);

CREATE INDEX IF NOT EXISTS idx_reviews_guild ON reviews(guild_id);
CREATE INDEX IF NOT EXISTS idx_reviews_status ON reviews(guild_id, status);
`);
Comment on lines +10 to +35
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This migration doesn’t follow the node-pg-migrate signature used by the rest of the repo (exports.up/exports.down with a MigrationBuilder pgm). With the current async function up(pool) + module.exports = { up, down }, pnpm migrate (node-pg-migrate) will not execute this migration.

Copilot uses AI. Check for mistakes.
}

/**
* @param {import('pg').Pool} pool
*/
async function down(pool) {
await pool.query(`
DROP INDEX IF EXISTS idx_reviews_status;
DROP INDEX IF EXISTS idx_reviews_guild;
DROP TABLE IF EXISTS reviews;
`);
}

module.exports = { up, down };
1 change: 1 addition & 0 deletions src/api/utils/configAllowlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const SAFE_CONFIG_KEYS = new Set([
'reputation',
'engagement',
'github',
'review',
]);

export const READABLE_CONFIG_KEYS = [...SAFE_CONFIG_KEYS, 'logging'];
Expand Down
Loading
Loading