Skip to content
Open
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
11 changes: 8 additions & 3 deletions src/escrow/dto/fund-escrow.dto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import {
IsDateString,
IsDate,
IsOptional,
IsString,
IsUUID,
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
16 changes: 11 additions & 5 deletions src/github/github-sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down