feat: vk/xxxx-xxxx-xxxx branch naming convention (#535)
* use vk/xxxx-xxxx... branch name format * add refetch interval for taskAttempts query
This commit is contained in:
committed by
GitHub
parent
97c3226ac0
commit
15eae338fa
@@ -465,6 +465,11 @@ impl LocalContainerService {
|
||||
format!("vk-{}-{}", short_uuid(attempt_id), task_title_id)
|
||||
}
|
||||
|
||||
pub fn git_branch_from_task_attempt(attempt_id: &Uuid, task_title: &str) -> String {
|
||||
let task_title_id = git_branch_id(task_title);
|
||||
format!("vk/{}-{}", short_uuid(attempt_id), task_title_id)
|
||||
}
|
||||
|
||||
async fn track_child_msgs_in_store(&self, id: Uuid, child: &mut AsyncGroupChild) {
|
||||
let store = Arc::new(MsgStore::new());
|
||||
|
||||
@@ -720,9 +725,12 @@ impl ContainerService for LocalContainerService {
|
||||
.await?
|
||||
.ok_or(sqlx::Error::RowNotFound)?;
|
||||
|
||||
let task_branch_name =
|
||||
let worktree_dir_name =
|
||||
LocalContainerService::dir_name_from_task_attempt(&task_attempt.id, &task.title);
|
||||
let worktree_path = WorktreeManager::get_worktree_base_dir().join(&task_branch_name);
|
||||
let worktree_path = WorktreeManager::get_worktree_base_dir().join(&worktree_dir_name);
|
||||
|
||||
let git_branch_name =
|
||||
LocalContainerService::git_branch_from_task_attempt(&task_attempt.id, &task.title);
|
||||
|
||||
let project = task
|
||||
.parent_project(&self.db.pool)
|
||||
@@ -731,7 +739,7 @@ impl ContainerService for LocalContainerService {
|
||||
|
||||
WorktreeManager::create_worktree(
|
||||
&project.git_repo_path,
|
||||
&task_branch_name,
|
||||
&git_branch_name,
|
||||
&worktree_path,
|
||||
&task_attempt.base_branch,
|
||||
true, // create new branch
|
||||
@@ -766,7 +774,7 @@ impl ContainerService for LocalContainerService {
|
||||
)
|
||||
.await?;
|
||||
|
||||
TaskAttempt::update_branch(&self.db.pool, task_attempt.id, &task_branch_name).await?;
|
||||
TaskAttempt::update_branch(&self.db.pool, task_attempt.id, &git_branch_name).await?;
|
||||
|
||||
Ok(worktree_path.to_string_lossy().to_string())
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ export function ProjectTasks() {
|
||||
queryKey: ['taskAttempts', selectedTask?.id],
|
||||
queryFn: () => attemptsApi.getAll(selectedTask!.id),
|
||||
enabled: !!selectedTask?.id,
|
||||
refetchInterval: 5000,
|
||||
});
|
||||
|
||||
// Selected attempt logic
|
||||
|
||||
Reference in New Issue
Block a user