feat: several Git repositories per project
A project keeps a list of repositories (api, web, admin…), each with its own secret, instead of a single webhook secret. They all call the same URL; the secret that verifies the signature tells which one it was, and every commit, branch or pull request is linked with its repository's name (shown on the ticket and in the MCP). Rotating or removing one leaves the others alone, and what it linked stays. A project that had turned the single webhook on keeps its secret, as a repository named "principal". API: the enable/disable endpoints and mutations give way to adding a repository, rotating its secret and removing it (REST and GraphQL). The web settings card lists the repositories. Docs, Word and PDF updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1106,3 +1106,17 @@ export class NotificationSettingsDto {
|
||||
@IsBoolean()
|
||||
email!: boolean;
|
||||
}
|
||||
|
||||
// ---- Git --------------------------------------------------------------------
|
||||
|
||||
export class AddGitRepositoryDto {
|
||||
@ApiProperty({
|
||||
example: 'api',
|
||||
maxLength: 40,
|
||||
description: "The project's name for it (api, web, admin…); unique",
|
||||
})
|
||||
@IsString()
|
||||
@MinLength(1)
|
||||
@MaxLength(40)
|
||||
name!: string;
|
||||
}
|
||||
|
||||
@@ -162,19 +162,40 @@ export class DevLinkDto {
|
||||
})
|
||||
state!: string | null;
|
||||
@ApiProperty({ example: 'gitea' }) provider!: string;
|
||||
@ApiProperty({
|
||||
type: String,
|
||||
nullable: true,
|
||||
example: 'api',
|
||||
description: "The project's name for the repository it came from",
|
||||
})
|
||||
repository!: string | null;
|
||||
@ApiProperty({ type: String, nullable: true }) author!: string | null;
|
||||
@ApiProperty({ format: 'date-time' }) at!: string;
|
||||
}
|
||||
|
||||
export class GitIntegrationDto {
|
||||
@ApiProperty() enabled!: boolean;
|
||||
export class GitRepositoryDto {
|
||||
@ApiProperty({ format: 'uuid' }) id!: string;
|
||||
@ApiProperty({ example: 'api' }) name!: string;
|
||||
@ApiProperty({
|
||||
type: String,
|
||||
nullable: true,
|
||||
description: 'Webhook secret; only owners and admins see it',
|
||||
description:
|
||||
'Webhook secret of this repository; only owners and admins see it',
|
||||
})
|
||||
secret!: string | null;
|
||||
@ApiProperty({ example: '/api/webhooks/git/3f2c…' }) webhookPath!: string;
|
||||
@ApiProperty({ format: 'date-time' }) createdAt!: string;
|
||||
}
|
||||
|
||||
export class GitIntegrationDto {
|
||||
@ApiProperty({ description: 'On while there is at least one repository' })
|
||||
enabled!: boolean;
|
||||
@ApiProperty({
|
||||
example: '/api/webhooks/git/3f2c…',
|
||||
description: 'The same for every repository of the project',
|
||||
})
|
||||
webhookPath!: string;
|
||||
@ApiProperty({ type: [GitRepositoryDto] })
|
||||
repositories!: GitRepositoryDto[];
|
||||
}
|
||||
|
||||
export class WebhookDeliveryDto {
|
||||
|
||||
Reference in New Issue
Block a user