diff --git a/backend/.sqlx/query-045124ed7dd9765b61eba67f15555f33fa86d0dabebc9cd845f06c2c28ec16d7.json b/backend/.sqlx/query-045124ed7dd9765b61eba67f15555f33fa86d0dabebc9cd845f06c2c28ec16d7.json new file mode 100644 index 00000000..9a91a15d --- /dev/null +++ b/backend/.sqlx/query-045124ed7dd9765b61eba67f15555f33fa86d0dabebc9cd845f06c2c28ec16d7.json @@ -0,0 +1,64 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, task_id, worktree_path, base_commit, merge_commit, executor_config, created_at, updated_at \n FROM task_attempts \n WHERE task_id = $1 \n ORDER BY created_at DESC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "task_id", + "type_info": "Uuid" + }, + { + "ordinal": 2, + "name": "worktree_path", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "base_commit", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "merge_commit", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "executor_config", + "type_info": "Jsonb" + }, + { + "ordinal": 6, + "name": "created_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "updated_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + true, + true, + true, + false, + false + ] + }, + "hash": "045124ed7dd9765b61eba67f15555f33fa86d0dabebc9cd845f06c2c28ec16d7" +} diff --git a/backend/.sqlx/query-0b5beec7f93c798c0de7089cb119438461d303e06dcea6db8facec1280362ef4.json b/backend/.sqlx/query-0b5beec7f93c798c0de7089cb119438461d303e06dcea6db8facec1280362ef4.json new file mode 100644 index 00000000..1fe9ac6a --- /dev/null +++ b/backend/.sqlx/query-0b5beec7f93c798c0de7089cb119438461d303e06dcea6db8facec1280362ef4.json @@ -0,0 +1,64 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, task_id, worktree_path, base_commit, merge_commit, executor_config, created_at, updated_at \n FROM task_attempts \n WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "task_id", + "type_info": "Uuid" + }, + { + "ordinal": 2, + "name": "worktree_path", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "base_commit", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "merge_commit", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "executor_config", + "type_info": "Jsonb" + }, + { + "ordinal": 6, + "name": "created_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "updated_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + true, + true, + true, + false, + false + ] + }, + "hash": "0b5beec7f93c798c0de7089cb119438461d303e06dcea6db8facec1280362ef4" +} diff --git a/backend/.sqlx/query-1fbd0dbbc876ac609d7fe7462a816fe3ab68b1d8711b4099daae54530d1703b1.json b/backend/.sqlx/query-2b199ed09a8fa6e04e948afbab2400ffe768abc754434331108edfdf54a9fca7.json similarity index 80% rename from backend/.sqlx/query-1fbd0dbbc876ac609d7fe7462a816fe3ab68b1d8711b4099daae54530d1703b1.json rename to backend/.sqlx/query-2b199ed09a8fa6e04e948afbab2400ffe768abc754434331108edfdf54a9fca7.json index 83e199a4..2e0460a8 100644 --- a/backend/.sqlx/query-1fbd0dbbc876ac609d7fe7462a816fe3ab68b1d8711b4099daae54530d1703b1.json +++ b/backend/.sqlx/query-2b199ed09a8fa6e04e948afbab2400ffe768abc754434331108edfdf54a9fca7.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "UPDATE users SET email = $2, password_hash = $3, is_admin = $4, updated_at = $5 WHERE id = $1 RETURNING id, email, password_hash, is_admin, created_at, updated_at", + "query": "UPDATE users SET email = $2, password_hash = $3, is_admin = $4 WHERE id = $1 RETURNING id, email, password_hash, is_admin, created_at, updated_at", "describe": { "columns": [ { @@ -39,8 +39,7 @@ "Uuid", "Varchar", "Varchar", - "Bool", - "Timestamptz" + "Bool" ] }, "nullable": [ @@ -52,5 +51,5 @@ false ] }, - "hash": "1fbd0dbbc876ac609d7fe7462a816fe3ab68b1d8711b4099daae54530d1703b1" + "hash": "2b199ed09a8fa6e04e948afbab2400ffe768abc754434331108edfdf54a9fca7" } diff --git a/backend/.sqlx/query-34e5edf8ee8452e436a3a45837def86f078ab5b95c994b082ca48ca18154fe5f.json b/backend/.sqlx/query-2db913b960a2fbba75c68bd8c7f2a370a3d012b5d726d03c05e27306c2e1d0cf.json similarity index 77% rename from backend/.sqlx/query-34e5edf8ee8452e436a3a45837def86f078ab5b95c994b082ca48ca18154fe5f.json rename to backend/.sqlx/query-2db913b960a2fbba75c68bd8c7f2a370a3d012b5d726d03c05e27306c2e1d0cf.json index 73d9268c..9a6f8c7c 100644 --- a/backend/.sqlx/query-34e5edf8ee8452e436a3a45837def86f078ab5b95c994b082ca48ca18154fe5f.json +++ b/backend/.sqlx/query-2db913b960a2fbba75c68bd8c7f2a370a3d012b5d726d03c05e27306c2e1d0cf.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "INSERT INTO users (id, email, password_hash, is_admin, created_at, updated_at) VALUES ($1, $2, $3, $4, $5, $6) RETURNING id, email, password_hash, is_admin, created_at, updated_at", + "query": "INSERT INTO users (id, email, password_hash, is_admin) VALUES ($1, $2, $3, $4) RETURNING id, email, password_hash, is_admin, created_at, updated_at", "describe": { "columns": [ { @@ -39,9 +39,7 @@ "Uuid", "Varchar", "Varchar", - "Bool", - "Timestamptz", - "Timestamptz" + "Bool" ] }, "nullable": [ @@ -53,5 +51,5 @@ false ] }, - "hash": "34e5edf8ee8452e436a3a45837def86f078ab5b95c994b082ca48ca18154fe5f" + "hash": "2db913b960a2fbba75c68bd8c7f2a370a3d012b5d726d03c05e27306c2e1d0cf" } diff --git a/backend/.sqlx/query-672ac4faaee68f6108f30c80ffd5d5ab73fe3e6368db416cc951a8cc67161281.json b/backend/.sqlx/query-672ac4faaee68f6108f30c80ffd5d5ab73fe3e6368db416cc951a8cc67161281.json new file mode 100644 index 00000000..b483a8f1 --- /dev/null +++ b/backend/.sqlx/query-672ac4faaee68f6108f30c80ffd5d5ab73fe3e6368db416cc951a8cc67161281.json @@ -0,0 +1,53 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, name, git_repo_path, owner_id, created_at, updated_at FROM projects WHERE git_repo_path = $1 AND id != $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "name", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "git_repo_path", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "owner_id", + "type_info": "Uuid" + }, + { + "ordinal": 4, + "name": "created_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 5, + "name": "updated_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false + ] + }, + "hash": "672ac4faaee68f6108f30c80ffd5d5ab73fe3e6368db416cc951a8cc67161281" +} diff --git a/backend/.sqlx/query-c120fcd1c3a0bef4640164a3d97d6dad0f11af048cca51b8acc90d8e9791abc7.json b/backend/.sqlx/query-710c66fbde8e0c36fa0d138ba9c7e5875524ca2cbcd4fa8ddcf86d093b52349a.json similarity index 56% rename from backend/.sqlx/query-c120fcd1c3a0bef4640164a3d97d6dad0f11af048cca51b8acc90d8e9791abc7.json rename to backend/.sqlx/query-710c66fbde8e0c36fa0d138ba9c7e5875524ca2cbcd4fa8ddcf86d093b52349a.json index fac2fab8..45eda4f2 100644 --- a/backend/.sqlx/query-c120fcd1c3a0bef4640164a3d97d6dad0f11af048cca51b8acc90d8e9791abc7.json +++ b/backend/.sqlx/query-710c66fbde8e0c36fa0d138ba9c7e5875524ca2cbcd4fa8ddcf86d093b52349a.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "INSERT INTO users (id, email, password_hash, is_admin, created_at, updated_at) VALUES ($1, $2, $3, $4, $5, $6)", + "query": "INSERT INTO users (id, email, password_hash, is_admin) VALUES ($1, $2, $3, $4)", "describe": { "columns": [], "parameters": { @@ -8,12 +8,10 @@ "Uuid", "Varchar", "Varchar", - "Bool", - "Timestamptz", - "Timestamptz" + "Bool" ] }, "nullable": [] }, - "hash": "c120fcd1c3a0bef4640164a3d97d6dad0f11af048cca51b8acc90d8e9791abc7" + "hash": "710c66fbde8e0c36fa0d138ba9c7e5875524ca2cbcd4fa8ddcf86d093b52349a" } diff --git a/backend/.sqlx/query-7a9cb99ac1f3aa3926fa592c5261af9a3a8f56c2dba7195c6d733e7036c81019.json b/backend/.sqlx/query-7a9cb99ac1f3aa3926fa592c5261af9a3a8f56c2dba7195c6d733e7036c81019.json new file mode 100644 index 00000000..98414583 --- /dev/null +++ b/backend/.sqlx/query-7a9cb99ac1f3aa3926fa592c5261af9a3a8f56c2dba7195c6d733e7036c81019.json @@ -0,0 +1,69 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO task_attempts (id, task_id, worktree_path, base_commit, merge_commit, executor_config) \n VALUES ($1, $2, $3, $4, $5, $6) \n RETURNING id, task_id, worktree_path, base_commit, merge_commit, executor_config, created_at, updated_at", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "task_id", + "type_info": "Uuid" + }, + { + "ordinal": 2, + "name": "worktree_path", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "base_commit", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "merge_commit", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "executor_config", + "type_info": "Jsonb" + }, + { + "ordinal": 6, + "name": "created_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 7, + "name": "updated_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid", + "Varchar", + "Varchar", + "Varchar", + "Jsonb" + ] + }, + "nullable": [ + false, + false, + false, + true, + true, + true, + false, + false + ] + }, + "hash": "7a9cb99ac1f3aa3926fa592c5261af9a3a8f56c2dba7195c6d733e7036c81019" +} diff --git a/backend/.sqlx/query-84df316d94c83b9189ab76a41521bf6bc60ea6ae530f00cf544ac87c120f50c2.json b/backend/.sqlx/query-84df316d94c83b9189ab76a41521bf6bc60ea6ae530f00cf544ac87c120f50c2.json new file mode 100644 index 00000000..a8b05ea5 --- /dev/null +++ b/backend/.sqlx/query-84df316d94c83b9189ab76a41521bf6bc60ea6ae530f00cf544ac87c120f50c2.json @@ -0,0 +1,24 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT ta.id FROM task_attempts ta \n JOIN tasks t ON ta.task_id = t.id \n WHERE ta.id = $1 AND t.id = $2 AND t.project_id = $3", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid", + "Uuid" + ] + }, + "nullable": [ + false + ] + }, + "hash": "84df316d94c83b9189ab76a41521bf6bc60ea6ae530f00cf544ac87c120f50c2" +} diff --git a/backend/.sqlx/query-e6d8bb56195fb3c6a297c69bd69053cebfc486acd6368de53945adf31ffc707f.json b/backend/.sqlx/query-9159bad45228f6ca30d0b50cc69259634ad9a5532bd3f288ec289f25498b3ce8.json similarity index 68% rename from backend/.sqlx/query-e6d8bb56195fb3c6a297c69bd69053cebfc486acd6368de53945adf31ffc707f.json rename to backend/.sqlx/query-9159bad45228f6ca30d0b50cc69259634ad9a5532bd3f288ec289f25498b3ce8.json index 2d9941c3..a071d4bf 100644 --- a/backend/.sqlx/query-e6d8bb56195fb3c6a297c69bd69053cebfc486acd6368de53945adf31ffc707f.json +++ b/backend/.sqlx/query-9159bad45228f6ca30d0b50cc69259634ad9a5532bd3f288ec289f25498b3ce8.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "UPDATE projects SET name = $2, updated_at = $3 WHERE id = $1 RETURNING id, name, owner_id, created_at, updated_at", + "query": "SELECT id, name, git_repo_path, owner_id, created_at, updated_at FROM projects WHERE git_repo_path = $1", "describe": { "columns": [ { @@ -15,25 +15,28 @@ }, { "ordinal": 2, + "name": "git_repo_path", + "type_info": "Varchar" + }, + { + "ordinal": 3, "name": "owner_id", "type_info": "Uuid" }, { - "ordinal": 3, + "ordinal": 4, "name": "created_at", "type_info": "Timestamptz" }, { - "ordinal": 4, + "ordinal": 5, "name": "updated_at", "type_info": "Timestamptz" } ], "parameters": { "Left": [ - "Uuid", - "Varchar", - "Timestamptz" + "Text" ] }, "nullable": [ @@ -41,8 +44,9 @@ false, false, false, + false, false ] }, - "hash": "e6d8bb56195fb3c6a297c69bd69053cebfc486acd6368de53945adf31ffc707f" + "hash": "9159bad45228f6ca30d0b50cc69259634ad9a5532bd3f288ec289f25498b3ce8" } diff --git a/backend/.sqlx/query-b7dcce1a1dca74bdebca528fbd03cd26293430587af27798c3297d95e06c99af.json b/backend/.sqlx/query-b7dcce1a1dca74bdebca528fbd03cd26293430587af27798c3297d95e06c99af.json new file mode 100644 index 00000000..e2a376dc --- /dev/null +++ b/backend/.sqlx/query-b7dcce1a1dca74bdebca528fbd03cd26293430587af27798c3297d95e06c99af.json @@ -0,0 +1,71 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, project_id, title, description, status as \"status!: TaskStatus\", created_at, updated_at \n FROM tasks \n WHERE project_id = $1 \n ORDER BY created_at DESC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "project_id", + "type_info": "Uuid" + }, + { + "ordinal": 2, + "name": "title", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "description", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "status!: TaskStatus", + "type_info": { + "Custom": { + "name": "task_status", + "kind": { + "Enum": [ + "todo", + "inprogress", + "done", + "cancelled", + "inreview" + ] + } + } + } + }, + { + "ordinal": 5, + "name": "created_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 6, + "name": "updated_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + true, + false, + false, + false + ] + }, + "hash": "b7dcce1a1dca74bdebca528fbd03cd26293430587af27798c3297d95e06c99af" +} diff --git a/backend/.sqlx/query-c293c87bbe20976357fd8fb433351ea8998828df6e1e30f7ae5f9984d0d05f8b.json b/backend/.sqlx/query-c395009379487778ea43d0bdef7bd9d28f4755bcefb775ca036523aa88a4a3d8.json similarity index 82% rename from backend/.sqlx/query-c293c87bbe20976357fd8fb433351ea8998828df6e1e30f7ae5f9984d0d05f8b.json rename to backend/.sqlx/query-c395009379487778ea43d0bdef7bd9d28f4755bcefb775ca036523aa88a4a3d8.json index a7fdaf01..33a0ffb6 100644 --- a/backend/.sqlx/query-c293c87bbe20976357fd8fb433351ea8998828df6e1e30f7ae5f9984d0d05f8b.json +++ b/backend/.sqlx/query-c395009379487778ea43d0bdef7bd9d28f4755bcefb775ca036523aa88a4a3d8.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "INSERT INTO tasks (id, project_id, title, description, status, created_at, updated_at) \n VALUES ($1, $2, $3, $4, $5, $6, $7) \n RETURNING id, project_id, title, description, status as \"status!: TaskStatus\", created_at, updated_at", + "query": "INSERT INTO tasks (id, project_id, title, description, status) \n VALUES ($1, $2, $3, $4, $5) \n RETURNING id, project_id, title, description, status as \"status!: TaskStatus\", created_at, updated_at", "describe": { "columns": [ { @@ -71,9 +71,7 @@ ] } } - }, - "Timestamptz", - "Timestamptz" + } ] }, "nullable": [ @@ -86,5 +84,5 @@ false ] }, - "hash": "c293c87bbe20976357fd8fb433351ea8998828df6e1e30f7ae5f9984d0d05f8b" + "hash": "c395009379487778ea43d0bdef7bd9d28f4755bcefb775ca036523aa88a4a3d8" } diff --git a/backend/.sqlx/query-77d49aa68ae8cb1a44cb28582ebb7e817058b704a173ca6122e93a5eb829ff62.json b/backend/.sqlx/query-cb377c76e9e7271d620e6e380fdf8b24da4ba3dcc7f481a884ad0a2746aea252.json similarity index 70% rename from backend/.sqlx/query-77d49aa68ae8cb1a44cb28582ebb7e817058b704a173ca6122e93a5eb829ff62.json rename to backend/.sqlx/query-cb377c76e9e7271d620e6e380fdf8b24da4ba3dcc7f481a884ad0a2746aea252.json index c23cba9f..8f6d2388 100644 --- a/backend/.sqlx/query-77d49aa68ae8cb1a44cb28582ebb7e817058b704a173ca6122e93a5eb829ff62.json +++ b/backend/.sqlx/query-cb377c76e9e7271d620e6e380fdf8b24da4ba3dcc7f481a884ad0a2746aea252.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT id, name, owner_id, created_at, updated_at FROM projects WHERE id = $1", + "query": "SELECT id, name, git_repo_path, owner_id, created_at, updated_at FROM projects WHERE id = $1", "describe": { "columns": [ { @@ -15,16 +15,21 @@ }, { "ordinal": 2, + "name": "git_repo_path", + "type_info": "Varchar" + }, + { + "ordinal": 3, "name": "owner_id", "type_info": "Uuid" }, { - "ordinal": 3, + "ordinal": 4, "name": "created_at", "type_info": "Timestamptz" }, { - "ordinal": 4, + "ordinal": 5, "name": "updated_at", "type_info": "Timestamptz" } @@ -39,8 +44,9 @@ false, false, false, + false, false ] }, - "hash": "77d49aa68ae8cb1a44cb28582ebb7e817058b704a173ca6122e93a5eb829ff62" + "hash": "cb377c76e9e7271d620e6e380fdf8b24da4ba3dcc7f481a884ad0a2746aea252" } diff --git a/backend/.sqlx/query-ce48496b80a462d440deb60661ac0a22b6ac18de38fcc772ef0f4fe2b44fa289.json b/backend/.sqlx/query-ce7a3bd6c160c3eda73600590737c2082f9d772adefc5b32c784a337f4b49065.json similarity index 80% rename from backend/.sqlx/query-ce48496b80a462d440deb60661ac0a22b6ac18de38fcc772ef0f4fe2b44fa289.json rename to backend/.sqlx/query-ce7a3bd6c160c3eda73600590737c2082f9d772adefc5b32c784a337f4b49065.json index 712fac38..d9b9ddd1 100644 --- a/backend/.sqlx/query-ce48496b80a462d440deb60661ac0a22b6ac18de38fcc772ef0f4fe2b44fa289.json +++ b/backend/.sqlx/query-ce7a3bd6c160c3eda73600590737c2082f9d772adefc5b32c784a337f4b49065.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "UPDATE tasks \n SET title = $3, description = $4, status = $5, updated_at = $6 \n WHERE id = $1 AND project_id = $2 \n RETURNING id, project_id, title, description, status as \"status!: TaskStatus\", created_at, updated_at", + "query": "UPDATE tasks \n SET title = $3, description = $4, status = $5 \n WHERE id = $1 AND project_id = $2 \n RETURNING id, project_id, title, description, status as \"status!: TaskStatus\", created_at, updated_at", "describe": { "columns": [ { @@ -71,8 +71,7 @@ ] } } - }, - "Timestamptz" + } ] }, "nullable": [ @@ -85,5 +84,5 @@ false ] }, - "hash": "ce48496b80a462d440deb60661ac0a22b6ac18de38fcc772ef0f4fe2b44fa289" + "hash": "ce7a3bd6c160c3eda73600590737c2082f9d772adefc5b32c784a337f4b49065" } diff --git a/backend/.sqlx/query-d2574d14252ead485e5db4e0eb84afa2fa3e12422f4e6ef6d623b768316e5ef4.json b/backend/.sqlx/query-d2574d14252ead485e5db4e0eb84afa2fa3e12422f4e6ef6d623b768316e5ef4.json new file mode 100644 index 00000000..39fdbc61 --- /dev/null +++ b/backend/.sqlx/query-d2574d14252ead485e5db4e0eb84afa2fa3e12422f4e6ef6d623b768316e5ef4.json @@ -0,0 +1,71 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO task_attempt_activities (id, task_attempt_id, status, note) \n VALUES ($1, $2, $3, $4) \n RETURNING id, task_attempt_id, status as \"status!: TaskAttemptStatus\", note, created_at", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "task_attempt_id", + "type_info": "Uuid" + }, + { + "ordinal": 2, + "name": "status!: TaskAttemptStatus", + "type_info": { + "Custom": { + "name": "task_attempt_status", + "kind": { + "Enum": [ + "init", + "inprogress", + "paused" + ] + } + } + } + }, + { + "ordinal": 3, + "name": "note", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "created_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid", + { + "Custom": { + "name": "task_attempt_status", + "kind": { + "Enum": [ + "init", + "inprogress", + "paused" + ] + } + } + }, + "Text" + ] + }, + "nullable": [ + false, + false, + false, + true, + false + ] + }, + "hash": "d2574d14252ead485e5db4e0eb84afa2fa3e12422f4e6ef6d623b768316e5ef4" +} diff --git a/backend/.sqlx/query-db4598a1164ee77414e789445f5da2384153bbade8ae677f60ea52d62875d23c.json b/backend/.sqlx/query-db4598a1164ee77414e789445f5da2384153bbade8ae677f60ea52d62875d23c.json new file mode 100644 index 00000000..538eb917 --- /dev/null +++ b/backend/.sqlx/query-db4598a1164ee77414e789445f5da2384153bbade8ae677f60ea52d62875d23c.json @@ -0,0 +1,57 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, task_attempt_id, status as \"status!: TaskAttemptStatus\", note, created_at \n FROM task_attempt_activities \n WHERE task_attempt_id = $1 \n ORDER BY created_at DESC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "task_attempt_id", + "type_info": "Uuid" + }, + { + "ordinal": 2, + "name": "status!: TaskAttemptStatus", + "type_info": { + "Custom": { + "name": "task_attempt_status", + "kind": { + "Enum": [ + "init", + "inprogress", + "paused" + ] + } + } + } + }, + { + "ordinal": 3, + "name": "note", + "type_info": "Text" + }, + { + "ordinal": 4, + "name": "created_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + true, + false + ] + }, + "hash": "db4598a1164ee77414e789445f5da2384153bbade8ae677f60ea52d62875d23c" +} diff --git a/backend/.sqlx/query-fe9803c8acc05d6642190955801b86c73aef2e2d3ed3bf86d12a2ec2ee97f60c.json b/backend/.sqlx/query-e7ec1292c5b93809f42eaf661779352efc8da4c52c1cb79811805240341bdf92.json similarity index 69% rename from backend/.sqlx/query-fe9803c8acc05d6642190955801b86c73aef2e2d3ed3bf86d12a2ec2ee97f60c.json rename to backend/.sqlx/query-e7ec1292c5b93809f42eaf661779352efc8da4c52c1cb79811805240341bdf92.json index 83a27966..63c4ee4f 100644 --- a/backend/.sqlx/query-fe9803c8acc05d6642190955801b86c73aef2e2d3ed3bf86d12a2ec2ee97f60c.json +++ b/backend/.sqlx/query-e7ec1292c5b93809f42eaf661779352efc8da4c52c1cb79811805240341bdf92.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT id, name, owner_id, created_at, updated_at FROM projects ORDER BY created_at DESC", + "query": "SELECT id, name, git_repo_path, owner_id, created_at, updated_at FROM projects ORDER BY created_at DESC", "describe": { "columns": [ { @@ -15,16 +15,21 @@ }, { "ordinal": 2, + "name": "git_repo_path", + "type_info": "Varchar" + }, + { + "ordinal": 3, "name": "owner_id", "type_info": "Uuid" }, { - "ordinal": 3, + "ordinal": 4, "name": "created_at", "type_info": "Timestamptz" }, { - "ordinal": 4, + "ordinal": 5, "name": "updated_at", "type_info": "Timestamptz" } @@ -37,8 +42,9 @@ false, false, false, + false, false ] }, - "hash": "fe9803c8acc05d6642190955801b86c73aef2e2d3ed3bf86d12a2ec2ee97f60c" + "hash": "e7ec1292c5b93809f42eaf661779352efc8da4c52c1cb79811805240341bdf92" } diff --git a/backend/.sqlx/query-d181fee1b69314810a3a9d4590a5f9e8df741ec19b58372c812137474b16891b.json b/backend/.sqlx/query-f4d24cec6142ffb70bf1008235921035d310c452da78128420c93707485c0d7f.json similarity index 86% rename from backend/.sqlx/query-d181fee1b69314810a3a9d4590a5f9e8df741ec19b58372c812137474b16891b.json rename to backend/.sqlx/query-f4d24cec6142ffb70bf1008235921035d310c452da78128420c93707485c0d7f.json index a9edca99..cc53bec7 100644 --- a/backend/.sqlx/query-d181fee1b69314810a3a9d4590a5f9e8df741ec19b58372c812137474b16891b.json +++ b/backend/.sqlx/query-f4d24cec6142ffb70bf1008235921035d310c452da78128420c93707485c0d7f.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT id, project_id, title, description, status as \"status!: TaskStatus\", created_at, updated_at \n FROM tasks \n WHERE id = $1 AND project_id = $2", + "query": "SELECT id, project_id, title, description, status as \"status!: TaskStatus\", created_at, updated_at \n FROM tasks \n WHERE id = $1 AND project_id = $2", "describe": { "columns": [ { @@ -68,5 +68,5 @@ false ] }, - "hash": "d181fee1b69314810a3a9d4590a5f9e8df741ec19b58372c812137474b16891b" + "hash": "f4d24cec6142ffb70bf1008235921035d310c452da78128420c93707485c0d7f" } diff --git a/backend/.sqlx/query-f5bfc8412c83b850fc0e686babfac68a358734a9dd9ff65fee96aa5f5b4d50d9.json b/backend/.sqlx/query-f5bfc8412c83b850fc0e686babfac68a358734a9dd9ff65fee96aa5f5b4d50d9.json new file mode 100644 index 00000000..2d1abad1 --- /dev/null +++ b/backend/.sqlx/query-f5bfc8412c83b850fc0e686babfac68a358734a9dd9ff65fee96aa5f5b4d50d9.json @@ -0,0 +1,55 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO projects (id, name, git_repo_path, owner_id) VALUES ($1, $2, $3, $4) RETURNING id, name, git_repo_path, owner_id, created_at, updated_at", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "name", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "git_repo_path", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "owner_id", + "type_info": "Uuid" + }, + { + "ordinal": 4, + "name": "created_at", + "type_info": "Timestamptz" + }, + { + "ordinal": 5, + "name": "updated_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Varchar", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false + ] + }, + "hash": "f5bfc8412c83b850fc0e686babfac68a358734a9dd9ff65fee96aa5f5b4d50d9" +} diff --git a/backend/.sqlx/query-f72efcb41e92e03b8f8b988017d3b1c509322dc560742e9ef77fb9532b748fce.json b/backend/.sqlx/query-f72efcb41e92e03b8f8b988017d3b1c509322dc560742e9ef77fb9532b748fce.json new file mode 100644 index 00000000..33bc664a --- /dev/null +++ b/backend/.sqlx/query-f72efcb41e92e03b8f8b988017d3b1c509322dc560742e9ef77fb9532b748fce.json @@ -0,0 +1,33 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT DISTINCT ta.id \n FROM task_attempts ta\n INNER JOIN (\n SELECT task_attempt_id, MAX(created_at) as latest_created_at\n FROM task_attempt_activities\n GROUP BY task_attempt_id\n ) latest_activity ON ta.id = latest_activity.task_attempt_id\n INNER JOIN task_attempt_activities taa ON ta.id = taa.task_attempt_id \n AND taa.created_at = latest_activity.latest_created_at\n WHERE taa.status = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + } + ], + "parameters": { + "Left": [ + { + "Custom": { + "name": "task_attempt_status", + "kind": { + "Enum": [ + "init", + "inprogress", + "paused" + ] + } + } + } + ] + }, + "nullable": [ + false + ] + }, + "hash": "f72efcb41e92e03b8f8b988017d3b1c509322dc560742e9ef77fb9532b748fce" +} diff --git a/backend/.sqlx/query-f7fd2f5022cbb587b5162b3444be71aa8337538356b8a278043b969b4375e576.json b/backend/.sqlx/query-f7fd2f5022cbb587b5162b3444be71aa8337538356b8a278043b969b4375e576.json new file mode 100644 index 00000000..db11e97c --- /dev/null +++ b/backend/.sqlx/query-f7fd2f5022cbb587b5162b3444be71aa8337538356b8a278043b969b4375e576.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO task_attempt_activities (id, task_attempt_id, status, note) \n VALUES ($1, $2, $3, $4)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Uuid", + { + "Custom": { + "name": "task_attempt_status", + "kind": { + "Enum": [ + "init", + "inprogress", + "paused" + ] + } + } + }, + "Text" + ] + }, + "nullable": [] + }, + "hash": "f7fd2f5022cbb587b5162b3444be71aa8337538356b8a278043b969b4375e576" +} diff --git a/backend/.sqlx/query-c9cb2594edb93c9cc75f0fc952c48fed263c536a1bf3b2e177e4a74cd3b4b30f.json b/backend/.sqlx/query-f945f1d2ffb4458739c4e98c6dc35c215b5bc3ce1d59d5dd4948b032ab461cd9.json similarity index 67% rename from backend/.sqlx/query-c9cb2594edb93c9cc75f0fc952c48fed263c536a1bf3b2e177e4a74cd3b4b30f.json rename to backend/.sqlx/query-f945f1d2ffb4458739c4e98c6dc35c215b5bc3ce1d59d5dd4948b032ab461cd9.json index f6afe979..048335b1 100644 --- a/backend/.sqlx/query-c9cb2594edb93c9cc75f0fc952c48fed263c536a1bf3b2e177e4a74cd3b4b30f.json +++ b/backend/.sqlx/query-f945f1d2ffb4458739c4e98c6dc35c215b5bc3ce1d59d5dd4948b032ab461cd9.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "INSERT INTO projects (id, name, owner_id, created_at, updated_at) VALUES ($1, $2, $3, $4, $5) RETURNING id, name, owner_id, created_at, updated_at", + "query": "UPDATE projects SET name = $2, git_repo_path = $3 WHERE id = $1 RETURNING id, name, git_repo_path, owner_id, created_at, updated_at", "describe": { "columns": [ { @@ -15,16 +15,21 @@ }, { "ordinal": 2, + "name": "git_repo_path", + "type_info": "Varchar" + }, + { + "ordinal": 3, "name": "owner_id", "type_info": "Uuid" }, { - "ordinal": 3, + "ordinal": 4, "name": "created_at", "type_info": "Timestamptz" }, { - "ordinal": 4, + "ordinal": 5, "name": "updated_at", "type_info": "Timestamptz" } @@ -33,9 +38,7 @@ "Left": [ "Uuid", "Varchar", - "Uuid", - "Timestamptz", - "Timestamptz" + "Varchar" ] }, "nullable": [ @@ -43,8 +46,9 @@ false, false, false, + false, false ] }, - "hash": "c9cb2594edb93c9cc75f0fc952c48fed263c536a1bf3b2e177e4a74cd3b4b30f" + "hash": "f945f1d2ffb4458739c4e98c6dc35c215b5bc3ce1d59d5dd4948b032ab461cd9" } diff --git a/backend/.sqlx/query-fe4ce947b9df88ed2bc30f2a202d34b65d6f85c997fcc94ad35270d7492ed3a4.json b/backend/.sqlx/query-fe4ce947b9df88ed2bc30f2a202d34b65d6f85c997fcc94ad35270d7492ed3a4.json new file mode 100644 index 00000000..450d95fe --- /dev/null +++ b/backend/.sqlx/query-fe4ce947b9df88ed2bc30f2a202d34b65d6f85c997fcc94ad35270d7492ed3a4.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id FROM tasks WHERE id = $1 AND project_id = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid" + ] + }, + "nullable": [ + false + ] + }, + "hash": "fe4ce947b9df88ed2bc30f2a202d34b65d6f85c997fcc94ad35270d7492ed3a4" +} diff --git a/backend/.sqlx/query-2d134000c4bfb65ca088a1463146262e25ed053855e6cba5f72adc05d1ed9e85.json b/backend/.sqlx/query-ff38912305d2082b153f12e0d59f0be12177a626b170b3ed3b41049b235cc57c.json similarity index 85% rename from backend/.sqlx/query-2d134000c4bfb65ca088a1463146262e25ed053855e6cba5f72adc05d1ed9e85.json rename to backend/.sqlx/query-ff38912305d2082b153f12e0d59f0be12177a626b170b3ed3b41049b235cc57c.json index a9be775b..8a391939 100644 --- a/backend/.sqlx/query-2d134000c4bfb65ca088a1463146262e25ed053855e6cba5f72adc05d1ed9e85.json +++ b/backend/.sqlx/query-ff38912305d2082b153f12e0d59f0be12177a626b170b3ed3b41049b235cc57c.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT id, project_id, title, description, status as \"status!: TaskStatus\", created_at, updated_at \n FROM tasks \n WHERE project_id = $1 \n ORDER BY created_at DESC", + "query": "SELECT id, project_id, title, description, status as \"status!: TaskStatus\", created_at, updated_at \n FROM tasks \n WHERE id = $1", "describe": { "columns": [ { @@ -67,5 +67,5 @@ false ] }, - "hash": "2d134000c4bfb65ca088a1463146262e25ed053855e6cba5f72adc05d1ed9e85" + "hash": "ff38912305d2082b153f12e0d59f0be12177a626b170b3ed3b41049b235cc57c" } diff --git a/backend/migrations/008_add_stdout_stderr_to_task_attempts.sql b/backend/migrations/008_add_stdout_stderr_to_task_attempts.sql new file mode 100644 index 00000000..e7730cf3 --- /dev/null +++ b/backend/migrations/008_add_stdout_stderr_to_task_attempts.sql @@ -0,0 +1,4 @@ +-- Add stdout and stderr columns to task_attempts table +ALTER TABLE task_attempts +ADD COLUMN stdout TEXT, +ADD COLUMN stderr TEXT; diff --git a/backend/src/models/task_attempt.rs b/backend/src/models/task_attempt.rs index cb95f3ad..b71a2f75 100644 --- a/backend/src/models/task_attempt.rs +++ b/backend/src/models/task_attempt.rs @@ -64,6 +64,8 @@ pub struct TaskAttempt { #[serde(skip_serializing_if = "Option::is_none")] #[ts(skip)] pub executor_config: Option, // JSON field for ExecutorConfig + pub stdout: Option, + pub stderr: Option, pub created_at: DateTime, pub updated_at: DateTime, } @@ -90,7 +92,7 @@ impl TaskAttempt { pub async fn find_by_id(pool: &PgPool, id: Uuid) -> Result, sqlx::Error> { sqlx::query_as!( TaskAttempt, - r#"SELECT id, task_id, worktree_path, base_commit, merge_commit, executor_config, created_at, updated_at + r#"SELECT id, task_id, worktree_path, base_commit, merge_commit, executor_config, stdout, stderr, created_at, updated_at FROM task_attempts WHERE id = $1"#, id @@ -102,7 +104,7 @@ impl TaskAttempt { pub async fn find_by_task_id(pool: &PgPool, task_id: Uuid) -> Result, sqlx::Error> { sqlx::query_as!( TaskAttempt, - r#"SELECT id, task_id, worktree_path, base_commit, merge_commit, executor_config, created_at, updated_at + r#"SELECT id, task_id, worktree_path, base_commit, merge_commit, executor_config, stdout, stderr, created_at, updated_at FROM task_attempts WHERE task_id = $1 ORDER BY created_at DESC"#, @@ -145,15 +147,17 @@ impl TaskAttempt { // Insert the record into the database let task_attempt = sqlx::query_as!( TaskAttempt, - r#"INSERT INTO task_attempts (id, task_id, worktree_path, base_commit, merge_commit, executor_config) - VALUES ($1, $2, $3, $4, $5, $6) - RETURNING id, task_id, worktree_path, base_commit, merge_commit, executor_config, created_at, updated_at"#, + r#"INSERT INTO task_attempts (id, task_id, worktree_path, base_commit, merge_commit, executor_config, stdout, stderr) + VALUES ($1, $2, $3, $4, $5, $6, $7, $8) + RETURNING id, task_id, worktree_path, base_commit, merge_commit, executor_config, stdout, stderr, created_at, updated_at"#, attempt_id, data.task_id, data.worktree_path, data.base_commit, data.merge_commit, - executor_config_json + executor_config_json, + None::, // stdout + None:: // stderr ) .fetch_one(pool) .await?; diff --git a/shared/types.ts b/shared/types.ts index 6427eb77..5fe3cc47 100644 --- a/shared/types.ts +++ b/shared/types.ts @@ -21,7 +21,7 @@ export type UpdateTask = { title: string | null, description: string | null, sta export type TaskAttemptStatus = "init" | "inprogress" | "paused"; -export type TaskAttempt = { id: string, task_id: string, worktree_path: string, base_commit: string | null, merge_commit: string | null, created_at: string, updated_at: string, }; +export type TaskAttempt = { id: string, task_id: string, worktree_path: string, base_commit: string | null, merge_commit: string | null, stdout: string | null, stderr: string | null, created_at: string, updated_at: string, }; export type CreateTaskAttempt = { task_id: string, worktree_path: string, base_commit: string | null, merge_commit: string | null, executor_config: ExecutorConfig | null, };