troutbot/config.example.ts
NotAShelf ad491d69e8
meta: move config files to typescript
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I60de4abb5b81c4b14d95d7b6f1da8aa66a6a6964
2026-02-01 17:17:34 +03:00

122 lines
3.5 KiB
TypeScript

import type { Config } from './src/types';
const config: Config = {
server: {
port: 3000,
// host: '0.0.0.0', // Uncomment to bind to all interfaces (default is localhost only)
},
// Dashboard configuration (optional)
// dashboard: {
// enabled: true,
// // Authentication options (choose one):
// auth: {
// // Option 1: Basic HTTP authentication
// type: 'basic',
// username: 'admin',
// password: 'changeme',
// // Option 2: Bearer token authentication
// // type: 'token',
// // token: 'your-secret-token-here',
// },
// },
repositories: [
// Leave empty to accept webhooks from any repo.
// { owner: "myorg", repo: "myrepo" },
],
filters: {
labels: {
include: [],
exclude: ['bot-ignore'],
},
authors: {
exclude: ['dependabot', 'renovate[bot]'],
},
branches: {
include: [], // empty = all branches
},
},
engine: {
backends: {
// Queries GitHub Checks API for CI results (ESLint, Clippy, tests, builds).
// Requires GITHUB_TOKEN.
checks: { enabled: true },
// Analyzes PR diff: size, file count, test coverage, net additions/deletions.
// Requires GITHUB_TOKEN. Only applies to pull_request events.
diff: {
enabled: true,
maxChanges: 1000, // PRs above this line count are flagged as too large
requireTests: false, // set true to flag PRs with no test file changes
},
// Analyzes issue/PR body for structural quality: description length,
// code blocks, reproduction steps, linked issues, test plans.
// Works without a token (pure text analysis).
quality: {
enabled: true,
minBodyLength: 50, // minimum characters for an "adequate" description
},
},
// Relative importance of each backend when combining results.
weights: {
checks: 0.4,
diff: 0.3,
quality: 0.3,
},
// Below this combined confidence, classify as neutral.
confidenceThreshold: 0.1,
},
response: {
includeConfidence: true,
includeReasoning: true,
// One message is picked at random from the list matching the impact.
// Placeholders:
// - {type} (issue/pull request),
// - {impact} (positive/negative/neutral)
messages: {
positive: [
'This {type} looks great for the trout! All signals point upstream.',
'The trout approve of this {type}. Swim on!',
'Splashing good news - this {type} is looking healthy.',
],
negative: [
'This {type} is muddying the waters. The trout are concerned.',
'Warning: the trout sense trouble in this {type}.',
'Something smells fishy about this {type}. Please review.',
],
neutral: [
'The trout have no strong feelings about this {type}.',
'This {type} is neither upstream nor downstream. Neutral waters.',
'The trout are watching this {type} with mild interest.',
],
},
commentMarker: '<!-- troutbot -->',
allowUpdates: false, // set true to update comments when CI finishes (requires check_suite webhook)
},
logging: {
level: 'info',
file: 'troutbot.log',
},
// Polling mode: Watch for @troutbot mentions without webhooks.
// Useful for monitoring multiple repos without needing webhook configuration.
polling: {
enabled: false,
intervalMinutes: 5, // how often to check for new comments
lookbackMinutes: 10, // how far back to look for comments on each poll
},
};
export default config;