feat: link commits, branches and pull requests to tickets

A project can turn on a webhook for GitHub, Gitea or GitLab. Pushes and
pull or merge requests that name a ticket key show on that ticket under
Desarrollo, with the state of each pull request; the secret is shown and
rotated from the project settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 15:28:12 +02:00
parent 24b37b6628
commit 046d77c813
48 changed files with 2638 additions and 12 deletions

View File

@@ -9,6 +9,7 @@ import {
IssueChecklistItemRemovedEvent,
IssueChecklistItemUpdatedEvent,
IssueParentChangedEvent,
IssueDevLinkRecordedEvent,
IssueCreatedEvent,
IssueLinkedEvent,
IssueLinkType,
@@ -162,6 +163,19 @@ export function describeEvent(
? `${actor} metió ${issueKey} en ${sprint}`
: `${actor} sacó ${issueKey} de ${sprint}`;
}
if (event instanceof IssueDevLinkRecordedEvent) {
const { kind, ref, state, author } = event.link;
const who = author ? ` (${author})` : '';
if (kind === 'COMMIT') return `Commit ${ref} sobre ${issueKey}${who}`;
if (kind === 'BRANCH') return `Rama ${ref} para ${issueKey}${who}`;
const verb =
state === 'MERGED'
? 'fusionada'
: state === 'CLOSED'
? 'cerrada'
: 'abierta';
return `Pull request ${ref} ${verb} para ${issueKey}${who}`;
}
if (event instanceof IssueParentChangedEvent) {
return event.parentKey
? `${actor} colocó ${issueKey} bajo ${event.parentKey}`