Add ticket-driven branch creation flow

This commit is contained in:
2026-03-26 09:39:18 +01:00
parent 789675f83f
commit 92dfe3840c
47 changed files with 1332 additions and 50 deletions
+1
View File
@@ -202,6 +202,7 @@ Git integration foundation:
- Gitea repository connections
- Branch correlation
- Pull request correlation
- Ticket-driven branch creation
### Phase 4
+6
View File
@@ -220,6 +220,12 @@ Required properties:
- Repository connection
- Branch name
Behavior:
- Branch matching is based on the ticket key prefix.
- The branch list may also be the entry point for creating a new branch from the ticket detail view.
- Branch creation depends on the current user's personal Git credentials for the selected repository connection.
### PullRequestReference
Represents a pull request associated with a ticket through a repository connection.
+10
View File
@@ -252,11 +252,21 @@ Initial expectations:
- The first supported provider is Gitea.
- Later providers should include GitHub and potentially GitLab.
- Tickets will later expose branch and pull request sections.
- The ticket branch section should eventually allow users to create a new branch directly from the ticket detail view.
Ticket-to-Git matching rule:
- A branch or pull request belongs to a ticket when its branch name starts with the ticket key.
Branch creation expectations:
- The ticket detail view may expose a branch creation action inside the branch section.
- The branch creation flow should let the user choose from all project-linked repositories.
- Repository choices remain visible even when the current user has no matching personal Git connection.
- If the user lacks access to the selected repository, branch creation fields must stay disabled and guide the user to their Git connection settings.
- The suggested branch name should start from the ticket key plus a title-derived suffix and remain editable before creation.
- The UI should validate that the proposed branch name is syntactically acceptable and not already taken before creation is submitted.
Example:
- Ticket key: `AUTH-42`
@@ -0,0 +1,41 @@
# 05 Ticket Branch Creation from Ticket Detail
## Goal
Allow users to create a new repository branch directly from the ticket detail view while preserving the existing project-linked repository model and per-user Git credentials.
## Requirements
- Add a branch creation action to the ticket branch section.
- Opening the action must show a modal dialog.
- The dialog must list all repositories linked to the project.
- The repository dropdown must still show repositories the current user cannot access through their own Git connection.
- If the selected repository is not accessible for the current user:
- the branch name field must be disabled
- the final create button must be disabled
- the UI must guide the user to their Git connection settings
- If the selected repository is accessible:
- prefill the branch name with the ticket key plus the ticket title
- convert the suggestion to lowercase
- replace spaces with `-`
- allow the user to edit the branch name before creation
- The dialog must show a validation state with a positive or negative indicator and a human-readable message.
- Validation must cover both:
- branch name syntax
- branch name uniqueness for the selected repository
- The create action must create the branch in Gitea.
## Acceptance Criteria
- The ticket branch section exposes a branch creation button.
- Clicking the button opens a modal with a repository dropdown.
- Selecting an inaccessible repository disables the rest of the flow and points the user to Git connection settings.
- Selecting an accessible repository prepopulates the branch name using the ticket key and title pattern.
- The validation message updates before creation and prevents creating an already existing branch.
- Submitting the dialog creates the branch in the selected repository and returns the user to the ticket detail view.
## Out of Scope
- Choosing a custom source branch inside the UI
- Branch creation for providers other than Gitea
- Automatic pull request creation after branch creation