Skip to content
← Public packages

@kody/kody-factory

Forkable multi-project software factory: signals, priority queue, project UI, sweep job. Agent runners and Sentry reach it by events.

FollowFork

Files

daily-all-issues.ts

21 lines · 890 B · TypeScript
import allIssues from '../all-issues.ts'

/**
 * No-arg scheduled wrapper for the all-issues sweep. Not registered as a job
 * by default; point a job's `entry` here to run all-issues on a schedule
 * (it covers everything the friction `daily` job covers). Throws after the
 * whole run when any repo listing or session start failed, so
 * the job run is red.
 */
export default async function dailyAllIssues() {
	const result = await allIssues({ dryRun: false })
	if (result.ok === false) {
		const failedRepos =
			'repos' in result ? result.repos.filter((entry) => entry.listError).map((entry) => `${entry.repo}: ${entry.listError}`) : []
		const sessionErrors = 'errors' in result && Array.isArray(result.errors) ? result.errors : []
		throw new Error(
			`friction-log all-issues sweep failed: ${JSON.stringify({ failedRepos, sessionErrors }).slice(0, 2000)}`,
		)
	}
	return result
}