feat(integrations): add labels integration and expose shared IntegrationApi

Add a new labels integration (src-tauri/src/integrations/labels.rs) that implements listing,
reading and updating issue labels for multiple providers (GitHub, Gitea, GitLab and Azure
DevOps). The new module provides Tauri commands:
- list_integration_labels
- get_integration_issue_labels
- set_integration_issue_labels

Refactor assignees integration to make core HTTP helpers reusable:
- Rename AssignmentApi -> IntegrationApi and make its fields/methods pub(super).
- Make helper functions api_url, repository_parts and target_url pub(super) so labels.rs
  can construct and call provider endpoints.
- Adjust wording of a few error messages (e.g. "Assignment request..." -> "Integration request...")
  and genericize some page/result error text.

Export the new labels module from integrations.rs and relax test helper visibility
(pub(crate)) so the labels tests can reuse the existing fixture utilities.

This commit introduces provider-specific parsing and payload logic for labels and
reuses the shared IntegrationApi to perform authenticated requests.
This commit is contained in:
2026-09-22 11:28:33 +02:00
parent 8e63f2a939
commit aec0d431f9
9 changed files with 720 additions and 27 deletions
+10
View File
@@ -767,3 +767,13 @@ export function getIntegrationAssignees(provider: GitIntegrationProvider, baseUr
export function setIntegrationAssignees(provider: GitIntegrationProvider, baseUrl: string, username: string, token: string, target: import("./types").AssignmentTarget, users: import("./types").IntegrationAssignee[]): Promise<import("./types").IntegrationAssignee[]> {
return invoke("set_integration_assignees", { provider, baseUrl, username, token, target, users });
}
export function listIntegrationLabels(provider: GitIntegrationProvider, baseUrl: string, username: string, token: string, repository: string): Promise<import("./types").IntegrationLabel[]> {
return invoke("list_integration_labels", { provider, baseUrl, username, token, repository });
}
export function getIntegrationIssueLabels(provider: GitIntegrationProvider, baseUrl: string, username: string, token: string, repository: string, number: number): Promise<import("./types").IntegrationLabel[]> {
return invoke("get_integration_issue_labels", { provider, baseUrl, username, token, repository, number });
}
export function setIntegrationIssueLabels(provider: GitIntegrationProvider, baseUrl: string, username: string, token: string, repository: string, number: number, labels: import("./types").IntegrationLabel[], expected: string[] | null = null): Promise<import("./types").IntegrationLabel[]> {
return invoke("set_integration_issue_labels", { provider, baseUrl, username, token, repository, number, labels, expected });
}