Fix TypeScript errors in Gitea provider

This commit is contained in:
2025-12-23 10:37:13 +01:00
parent b6d5f0f399
commit 65dd97e46b
5 changed files with 12 additions and 12 deletions

View File

@@ -102,8 +102,8 @@ export class GiteaWebhookProvider implements WebhookProvider<GiteaWebhookEvent>
giteaEvent,
giteaDelivery,
action: payload.action,
repository: payload.repository,
sender: payload.sender,
repository: payload.repository as unknown as GiteaRepository | undefined,
sender: payload.sender as unknown as GiteaUser | undefined,
data: payload
};
}

View File

@@ -169,7 +169,7 @@ export const issueCommentCreatedHandler: WebhookEventHandler<GiteaWebhookEvent>
event: 'issue_comment.created',
priority: 100,
canHandle(payload: GiteaWebhookEvent, context: WebhookContext): boolean {
canHandle(payload: GiteaWebhookEvent, _context: WebhookContext): boolean {
const data = payload.data as GiteaIssueCommentPayload;
// Check if comment mentions the bot

View File

@@ -21,7 +21,7 @@ export const pullRequestOpenedHandler: WebhookEventHandler<GiteaWebhookEvent> =
event: 'pull_request.opened',
priority: 80,
canHandle(payload: GiteaWebhookEvent, context: WebhookContext): boolean {
canHandle(payload: GiteaWebhookEvent, _context: WebhookContext): boolean {
// Check if auto-review is enabled
const enableAutoReview = process.env.ENABLE_AUTO_PR_REVIEW === 'true';
if (!enableAutoReview) {
@@ -147,7 +147,7 @@ export const pullRequestCommentCreatedHandler: WebhookEventHandler<GiteaWebhookE
event: /^pull_request.*\.created$/,
priority: 100,
canHandle(payload: GiteaWebhookEvent, context: WebhookContext): boolean {
canHandle(payload: GiteaWebhookEvent, _context: WebhookContext): boolean {
// This handler catches PR review comments
// The issue_comment handler catches PR thread comments
@@ -275,14 +275,14 @@ export const pullRequestSynchronizedHandler: WebhookEventHandler<GiteaWebhookEve
event: 'pull_request.synchronized',
priority: 50,
canHandle(payload: GiteaWebhookEvent, context: WebhookContext): boolean {
canHandle(_payload: GiteaWebhookEvent, _context: WebhookContext): boolean {
// Check if re-review on push is enabled
return process.env.ENABLE_PR_PUSH_REVIEW === 'true';
},
async handle(
payload: GiteaWebhookEvent,
context: WebhookContext
_context: WebhookContext
): Promise<WebhookHandlerResponse> {
const data = payload.data as GiteaPullRequestPayload;
const pr = data.pull_request;

View File

@@ -36,7 +36,7 @@ function extractWorkflowRunInfo(payload: GiteaWorkflowRunPayload) {
*/
async function handleWorkflowRunCompleted(
payload: GiteaWebhookEvent,
context: WebhookContext
_context: WebhookContext
): Promise<WebhookHandlerResponse> {
const data = payload.data as GiteaWorkflowRunPayload;
const workflowInfo = extractWorkflowRunInfo(data);
@@ -233,7 +233,7 @@ Be concise and focused. Only fix what's broken, don't refactor or improve unrela
*/
async function handleWorkflowJobCompleted(
payload: GiteaWebhookEvent,
context: WebhookContext
_context: WebhookContext
): Promise<WebhookHandlerResponse> {
const data = payload.data as GiteaWorkflowJobPayload;
@@ -266,7 +266,7 @@ export const workflowRunCompletedHandler: WebhookEventHandler<GiteaWebhookEvent>
event: 'workflow_run.completed',
priority: 100, // High priority for CI failures
canHandle(payload: GiteaWebhookEvent, context: WebhookContext): boolean {
canHandle(payload: GiteaWebhookEvent, _context: WebhookContext): boolean {
const data = payload.data as GiteaWorkflowRunPayload;
// Only handle if it's a completed workflow run
@@ -294,7 +294,7 @@ export const workflowJobCompletedHandler: WebhookEventHandler<GiteaWebhookEvent>
event: 'workflow_job.completed',
priority: 50,
canHandle(payload: GiteaWebhookEvent, context: WebhookContext): boolean {
canHandle(payload: GiteaWebhookEvent, _context: WebhookContext): boolean {
const data = payload.data as GiteaWorkflowJobPayload;
return payload.giteaEvent === 'workflow_job' && data.action === 'completed';
},

View File

@@ -159,7 +159,7 @@ export interface MetricsSnapshot {
timestamp: string;
performance: PerformanceMetrics;
claude: ClaudeExecutionMetrics;
github: GitHubAPIMetrics;
gitea: GiteaAPIMetrics;
docker: DockerMetrics;
timeSeries: TimeSeries[];
}