From e891c211f4b1e79b47c52ffd69319543d731b767 Mon Sep 17 00:00:00 2001 From: Yggdrasil Date: Wed, 14 Oct 2026 02:20:34 -0400 Subject: [PATCH] fix: maintenance-labels include 'documentation' + deadline validates the Date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - #563: GitHub's default label is 'documentation' not 'docs' — docs issues were never isMaintenanceType and got rejected as ineligible. - #580: the global transform:true converted deadline to a Date before @IsDateString ran — it always rejected. Validate the transformed Date with @IsDate instead. Resolves #563, #580 --- src/escrow/dto/fund-escrow.dto.ts | 11 ++++++++--- src/github/github-sync.service.ts | 16 +++++++++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/escrow/dto/fund-escrow.dto.ts b/src/escrow/dto/fund-escrow.dto.ts index 0bc4508c..c1aea81d 100644 --- a/src/escrow/dto/fund-escrow.dto.ts +++ b/src/escrow/dto/fund-escrow.dto.ts @@ -1,7 +1,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { Type } from 'class-transformer'; import { - IsDateString, + IsDate, IsOptional, IsString, IsUUID, @@ -73,7 +73,8 @@ export class FundEscrowDto { @IsOptional() @IsString() @Matches(/^\d+$/, { - message: 'onChainIssueId must be the linked GitHub issue numeric id (digits only)', + message: + 'onChainIssueId must be the linked GitHub issue numeric id (digits only)', }) @MaxLength(20) onChainIssueId?: string; @@ -89,7 +90,11 @@ export class FundEscrowDto { 'ISO 8601 refund-deadline passed to escrow::fund (defaults to the configured window)', }) @IsOptional() - @IsDateString() + // The global ValidationPipe has transform:true — class-transformer's + // @Type(()=>Date) converts the string to a Date BEFORE class-validator + // runs, so @IsDateString() (which requires a string) always rejected it. + // Validate the transformed Date with @IsDate() instead (#580). + @IsDate() @Type(() => Date) deadline?: Date; } diff --git a/src/github/github-sync.service.ts b/src/github/github-sync.service.ts index 637795e3..0651a7ee 100644 --- a/src/github/github-sync.service.ts +++ b/src/github/github-sync.service.ts @@ -8,16 +8,22 @@ import { import { EventEmitter2 } from '@nestjs/event-emitter'; import { InjectRepository } from '@nestjs/typeorm'; import { Octokit } from '@octokit/rest'; -import { - FindOptionsRelations, - Repository as TypeOrmRepository, -} from 'typeorm'; +import { FindOptionsRelations, Repository as TypeOrmRepository } from 'typeorm'; import { ANALYTICS_PLATFORM_INVALIDATE_EVENT } from '../analytics/analytics.events'; import { Issue, Repository } from '../common/entities'; import { IssueState } from '../common/enums'; import { GITHUB_OCTOKIT } from './octokit.provider'; -const MAINTENANCE_LABELS = ['maintenance', 'dependencies', 'chore', 'docs']; +// GitHub's default label set (created in every new repo) uses `documentation`, +// not `docs` — without it, docs issues in most repos were never +// isMaintenanceType and assignReward rejected them as ineligible (#563). +const MAINTENANCE_LABELS = [ + 'maintenance', + 'dependencies', + 'chore', + 'docs', + 'documentation', +]; /** * Shape shared by a REST `issues.listForRepo` item and an `issues` webhook