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:
@@ -1182,13 +1182,65 @@ export interface paths {
|
||||
path?: never;
|
||||
cookie?: never;
|
||||
};
|
||||
/** Whether the Git webhook is on (and its secret, for admins) */
|
||||
/** The project's repositories and the webhook URL they share (secrets, for admins) */
|
||||
get: operations["GitController_integration"];
|
||||
put?: never;
|
||||
/** Turn the Git webhook on with a new secret (or rotate it) */
|
||||
post: operations["GitController_enable"];
|
||||
/** Turn the Git webhook off */
|
||||
delete: operations["GitController_disable"];
|
||||
post?: never;
|
||||
delete?: never;
|
||||
options?: never;
|
||||
head?: never;
|
||||
patch?: never;
|
||||
trace?: never;
|
||||
};
|
||||
"/api/projects/{project}/git-integration/repositories": {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path?: never;
|
||||
cookie?: never;
|
||||
};
|
||||
get?: never;
|
||||
put?: never;
|
||||
/**
|
||||
* Add a repository, with its own secret (owners and admins)
|
||||
* @description Turns the integration on with the first one. Every repository uses the same webhook URL; its secret tells them apart.
|
||||
*/
|
||||
post: operations["GitController_addRepository"];
|
||||
delete?: never;
|
||||
options?: never;
|
||||
head?: never;
|
||||
patch?: never;
|
||||
trace?: never;
|
||||
};
|
||||
"/api/projects/{project}/git-integration/repositories/{repository}/secret": {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path?: never;
|
||||
cookie?: never;
|
||||
};
|
||||
get?: never;
|
||||
put?: never;
|
||||
/** Give a repository a new secret (the old one stops working) */
|
||||
post: operations["GitController_rotateSecret"];
|
||||
delete?: never;
|
||||
options?: never;
|
||||
head?: never;
|
||||
patch?: never;
|
||||
trace?: never;
|
||||
};
|
||||
"/api/projects/{project}/git-integration/repositories/{repository}": {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path?: never;
|
||||
cookie?: never;
|
||||
};
|
||||
get?: never;
|
||||
put?: never;
|
||||
post?: never;
|
||||
/** Remove a repository: its webhooks are refused, what it linked stays */
|
||||
delete: operations["GitController_removeRepository"];
|
||||
options?: never;
|
||||
head?: never;
|
||||
patch?: never;
|
||||
@@ -1205,7 +1257,7 @@ export interface paths {
|
||||
put?: never;
|
||||
/**
|
||||
* Webhook for GitHub, Gitea or GitLab (called by the Git host)
|
||||
* @description Push and pull/merge request events. GitHub and Gitea sign the body with the secret (HMAC-SHA256); GitLab sends it as X-Gitlab-Token. Other events are acknowledged and ignored.
|
||||
* @description Push and pull/merge request events from any repository of the project; the secret it signs with says which (GitHub and Gitea: HMAC-SHA256 of the body; GitLab: X-Gitlab-Token). Other events are acknowledged and ignored.
|
||||
*/
|
||||
post: operations["GitController_receive"];
|
||||
delete?: never;
|
||||
@@ -1672,6 +1724,11 @@ export interface components {
|
||||
state: components["schemas"]["DevLinkState"] | null;
|
||||
/** @example gitea */
|
||||
provider: string;
|
||||
/**
|
||||
* @description The project's name for the repository it came from
|
||||
* @example api
|
||||
*/
|
||||
repository: string | null;
|
||||
author: string | null;
|
||||
/** Format: date-time */
|
||||
at: string;
|
||||
@@ -2380,12 +2437,32 @@ export interface components {
|
||||
*/
|
||||
sprintId: string | null;
|
||||
};
|
||||
GitIntegrationDto: {
|
||||
enabled: boolean;
|
||||
/** @description Webhook secret; only owners and admins see it */
|
||||
GitRepositoryDto: {
|
||||
/** Format: uuid */
|
||||
id: string;
|
||||
/** @example api */
|
||||
name: string;
|
||||
/** @description Webhook secret of this repository; only owners and admins see it */
|
||||
secret: string | null;
|
||||
/** @example /api/webhooks/git/3f2c… */
|
||||
/** Format: date-time */
|
||||
createdAt: string;
|
||||
};
|
||||
GitIntegrationDto: {
|
||||
/** @description On while there is at least one repository */
|
||||
enabled: boolean;
|
||||
/**
|
||||
* @description The same for every repository of the project
|
||||
* @example /api/webhooks/git/3f2c…
|
||||
*/
|
||||
webhookPath: string;
|
||||
repositories: components["schemas"]["GitRepositoryDto"][];
|
||||
};
|
||||
AddGitRepositoryDto: {
|
||||
/**
|
||||
* @description The project's name for it (api, web, admin…); unique
|
||||
* @example api
|
||||
*/
|
||||
name: string;
|
||||
};
|
||||
GitDeliveryResultDto: {
|
||||
/** @description Tickets that got something new */
|
||||
@@ -8054,7 +8131,7 @@ export interface operations {
|
||||
};
|
||||
};
|
||||
};
|
||||
GitController_enable: {
|
||||
GitController_addRepository: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
@@ -8064,14 +8141,18 @@ export interface operations {
|
||||
};
|
||||
cookie?: never;
|
||||
};
|
||||
requestBody?: never;
|
||||
requestBody: {
|
||||
content: {
|
||||
"application/json": components["schemas"]["AddGitRepositoryDto"];
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
201: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["GitIntegrationDto"];
|
||||
"application/json": components["schemas"]["GitRepositoryDto"];
|
||||
};
|
||||
};
|
||||
/** @description Invalid input */
|
||||
@@ -8130,13 +8211,93 @@ export interface operations {
|
||||
};
|
||||
};
|
||||
};
|
||||
GitController_disable: {
|
||||
GitController_rotateSecret: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path: {
|
||||
/** @description Project id or key */
|
||||
project: string;
|
||||
/** @description Repository id */
|
||||
repository: string;
|
||||
};
|
||||
cookie?: never;
|
||||
};
|
||||
requestBody?: never;
|
||||
responses: {
|
||||
201: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["GitRepositoryDto"];
|
||||
};
|
||||
};
|
||||
/** @description Invalid input */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["ApiErrorDto"];
|
||||
};
|
||||
};
|
||||
/** @description Missing or rejected Pireon token */
|
||||
401: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["ApiErrorDto"];
|
||||
};
|
||||
};
|
||||
/** @description Not a member of the project (or not allowed) */
|
||||
403: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["ApiErrorDto"];
|
||||
};
|
||||
};
|
||||
/** @description Not found */
|
||||
404: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["ApiErrorDto"];
|
||||
};
|
||||
};
|
||||
/** @description Someone changed it at the same time: retry */
|
||||
409: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["ApiErrorDto"];
|
||||
};
|
||||
};
|
||||
/** @description Business rule (e.g. a transition the workflow forbids) */
|
||||
422: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["ApiErrorDto"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
GitController_removeRepository: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path: {
|
||||
/** @description Project id or key */
|
||||
project: string;
|
||||
/** @description Repository id */
|
||||
repository: string;
|
||||
};
|
||||
cookie?: never;
|
||||
};
|
||||
|
||||
@@ -250,6 +250,7 @@ export class IssuesResolver {
|
||||
links: issue.links,
|
||||
devLinks: issue.devLinks.map((d) => ({
|
||||
kind: d.kind,
|
||||
repository: d.repository,
|
||||
ref: d.ref,
|
||||
title: d.title,
|
||||
state: d.state,
|
||||
|
||||
Reference in New Issue
Block a user