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

@@ -0,0 +1,32 @@
import { inject, Injectable } from '@angular/core';
import { GitGateway, GitIntegration } from '@task-stream/web/tracker/domain';
import { map, Observable } from 'rxjs';
import {
DisableGitIntegrationDocument,
EnableGitIntegrationDocument,
GitIntegrationDocument,
} from '../graphql/generated';
import { GraphqlOperations } from './graphql-operations';
@Injectable()
export class GraphqlGitGateway extends GitGateway {
private readonly gql = inject(GraphqlOperations);
integration(projectId: string): Observable<GitIntegration> {
return this.gql
.query(GitIntegrationDocument, { projectId })
.pipe(map((d) => d.gitIntegration));
}
enable(projectId: string): Observable<GitIntegration> {
return this.gql
.mutate(EnableGitIntegrationDocument, { projectId })
.pipe(map((d) => d.enableGitIntegration));
}
disable(projectId: string): Observable<void> {
return this.gql
.mutate(DisableGitIntegrationDocument, { projectId })
.pipe(map(() => undefined));
}
}