-
Notifications
You must be signed in to change notification settings - Fork 69
Rename workspace to task throughout codebase #487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
9cf4d0d
refactor: rename workspace to task in renderer
rabanspiegel 2de539e
refactor: rename workspaceId to taskId throughout codebase
rabanspiegel a93f43a
refactor: rename workspacePath to taskPath
rabanspiegel 9b71ee4
refactor: rename workspaceName to taskName
rabanspiegel ef7f8d5
refactor: rename workspaceMetadata to taskMetadata
rabanspiegel 5a6b63d
refactor: rename workspace handler functions to task
rabanspiegel 92f8eec
refactor: rename workspace state variables to task
rabanspiegel abbcb74
refactor: rename workspace IPC methods to task
rabanspiegel d2b66b4
refactor: rename project.workspaces to project.tasks
rabanspiegel 394b27a
refactor: rename remaining workspace variables and messages to task
rabanspiegel 4873ab1
refactor: rename workspace to task in main process
rabanspiegel c23812d
refactor: rename workspace HTML IDs to task
rabanspiegel 584bd9b
refactor: rename workspace CSS classes to task
rabanspiegel b9ba8ae
refactor: update workspace fallback strings and comments to task
rabanspiegel a265d31
refactor: rename workspace relation to task in schema
rabanspiegel aec7a99
db: rename workspaces table to tasks
rabanspiegel aa4ed25
refactor: rename workspace internal variables and functions to task
rabanspiegel ac76146
refactor: rename workspace refs to task in renderer components
rabanspiegel 86f45d6
refactor: rename workspace types and functions to task in main process
rabanspiegel 974a5db
test: update tests for renamed workspace functions
rabanspiegel 81c1898
refactor: rename workspace telemetry events and components to task
rabanspiegel 5dfc6cb
test: update workspace paths to task in test files
rabanspiegel 5635602
docs: update workspace references to task in comments
rabanspiegel 52156b0
refactor: update workspace UI strings to task
rabanspiegel 3dbd9ac
refactor: rename absWorkspace to absTaskPath
rabanspiegel 3e1891c
refactor: rename workspace storage keys to task
rabanspiegel 0772b32
refactor: rename workspace local variables to task
rabanspiegel f0b3f54
refactor: rename workspace PTY IDs to task
rabanspiegel 94ac7d0
refactor: rename c7WorkspaceEnabled to c7TaskEnabled
rabanspiegel c0badf2
Merge origin/main into refactor/workspace-to-task-rename
rabanspiegel 44b741c
format
rabanspiegel 6ea4e3f
refactor: rename generatePrContent workspacePath to taskPath
rabanspiegel b8823fb
fix: revert Linear workspaceName rename
rabanspiegel 40a1fb0
format
rabanspiegel d8047e6
Merge origin/main into refactor/workspace-to-task-rename
rabanspiegel dcbae42
fix: rename remaining workspace references to task
rabanspiegel 277f8fa
format
rabanspiegel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| ALTER TABLE `workspaces` RENAME TO `tasks`;--> statement-breakpoint | ||
| PRAGMA foreign_keys=OFF;--> statement-breakpoint | ||
| CREATE TABLE `__new_tasks` ( | ||
| `id` text PRIMARY KEY NOT NULL, | ||
| `project_id` text NOT NULL, | ||
| `name` text NOT NULL, | ||
| `branch` text NOT NULL, | ||
| `path` text NOT NULL, | ||
| `status` text DEFAULT 'idle' NOT NULL, | ||
| `agent_id` text, | ||
| `metadata` text, | ||
| `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
| `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
| FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE cascade | ||
| ); | ||
| --> statement-breakpoint | ||
| INSERT INTO `__new_tasks`("id", "project_id", "name", "branch", "path", "status", "agent_id", "metadata", "created_at", "updated_at") SELECT "id", "project_id", "name", "branch", "path", "status", "agent_id", "metadata", "created_at", "updated_at" FROM `tasks`;--> statement-breakpoint | ||
| DROP TABLE `tasks`;--> statement-breakpoint | ||
| ALTER TABLE `__new_tasks` RENAME TO `tasks`;--> statement-breakpoint | ||
| PRAGMA foreign_keys=ON;--> statement-breakpoint | ||
| CREATE INDEX `idx_tasks_project_id` ON `tasks` (`project_id`);--> statement-breakpoint | ||
| CREATE TABLE `__new_conversations` ( | ||
| `id` text PRIMARY KEY NOT NULL, | ||
| `task_id` text NOT NULL, | ||
| `title` text NOT NULL, | ||
| `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
| `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
| FOREIGN KEY (`task_id`) REFERENCES `tasks`(`id`) ON UPDATE no action ON DELETE cascade | ||
| ); | ||
| --> statement-breakpoint | ||
| INSERT INTO `__new_conversations`("id", "task_id", "title", "created_at", "updated_at") SELECT "id", "workspace_id", "title", "created_at", "updated_at" FROM `conversations`;--> statement-breakpoint | ||
| DROP TABLE `conversations`;--> statement-breakpoint | ||
| ALTER TABLE `__new_conversations` RENAME TO `conversations`;--> statement-breakpoint | ||
| CREATE INDEX `idx_conversations_task_id` ON `conversations` (`task_id`); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,347 @@ | ||
| { | ||
| "version": "6", | ||
| "dialect": "sqlite", | ||
| "id": "f61fcd81-f000-4e2d-84f2-2f79133ae5d6", | ||
| "prevId": "ec5ad35e-22ec-4c0b-9d48-cfb1033d9d93", | ||
| "tables": { | ||
| "conversations": { | ||
| "name": "conversations", | ||
| "columns": { | ||
| "id": { | ||
| "name": "id", | ||
| "type": "text", | ||
| "primaryKey": true, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "task_id": { | ||
| "name": "task_id", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "title": { | ||
| "name": "title", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "created_at": { | ||
| "name": "created_at", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false, | ||
| "default": "CURRENT_TIMESTAMP" | ||
| }, | ||
| "updated_at": { | ||
| "name": "updated_at", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false, | ||
| "default": "CURRENT_TIMESTAMP" | ||
| } | ||
| }, | ||
| "indexes": { | ||
| "idx_conversations_task_id": { | ||
| "name": "idx_conversations_task_id", | ||
| "columns": ["task_id"], | ||
| "isUnique": false | ||
| } | ||
| }, | ||
| "foreignKeys": { | ||
| "conversations_task_id_tasks_id_fk": { | ||
| "name": "conversations_task_id_tasks_id_fk", | ||
| "tableFrom": "conversations", | ||
| "tableTo": "tasks", | ||
| "columnsFrom": ["task_id"], | ||
| "columnsTo": ["id"], | ||
| "onDelete": "cascade", | ||
| "onUpdate": "no action" | ||
| } | ||
| }, | ||
| "compositePrimaryKeys": {}, | ||
| "uniqueConstraints": {}, | ||
| "checkConstraints": {} | ||
| }, | ||
| "messages": { | ||
| "name": "messages", | ||
| "columns": { | ||
| "id": { | ||
| "name": "id", | ||
| "type": "text", | ||
| "primaryKey": true, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "conversation_id": { | ||
| "name": "conversation_id", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "content": { | ||
| "name": "content", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "sender": { | ||
| "name": "sender", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "timestamp": { | ||
| "name": "timestamp", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false, | ||
| "default": "CURRENT_TIMESTAMP" | ||
| }, | ||
| "metadata": { | ||
| "name": "metadata", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": false, | ||
| "autoincrement": false | ||
| } | ||
| }, | ||
| "indexes": { | ||
| "idx_messages_conversation_id": { | ||
| "name": "idx_messages_conversation_id", | ||
| "columns": ["conversation_id"], | ||
| "isUnique": false | ||
| }, | ||
| "idx_messages_timestamp": { | ||
| "name": "idx_messages_timestamp", | ||
| "columns": ["timestamp"], | ||
| "isUnique": false | ||
| } | ||
| }, | ||
| "foreignKeys": { | ||
| "messages_conversation_id_conversations_id_fk": { | ||
| "name": "messages_conversation_id_conversations_id_fk", | ||
| "tableFrom": "messages", | ||
| "tableTo": "conversations", | ||
| "columnsFrom": ["conversation_id"], | ||
| "columnsTo": ["id"], | ||
| "onDelete": "cascade", | ||
| "onUpdate": "no action" | ||
| } | ||
| }, | ||
| "compositePrimaryKeys": {}, | ||
| "uniqueConstraints": {}, | ||
| "checkConstraints": {} | ||
| }, | ||
| "projects": { | ||
| "name": "projects", | ||
| "columns": { | ||
| "id": { | ||
| "name": "id", | ||
| "type": "text", | ||
| "primaryKey": true, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "name": { | ||
| "name": "name", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "path": { | ||
| "name": "path", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "git_remote": { | ||
| "name": "git_remote", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": false, | ||
| "autoincrement": false | ||
| }, | ||
| "git_branch": { | ||
| "name": "git_branch", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": false, | ||
| "autoincrement": false | ||
| }, | ||
| "base_ref": { | ||
| "name": "base_ref", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": false, | ||
| "autoincrement": false | ||
| }, | ||
| "github_repository": { | ||
| "name": "github_repository", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": false, | ||
| "autoincrement": false | ||
| }, | ||
| "github_connected": { | ||
| "name": "github_connected", | ||
| "type": "integer", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false, | ||
| "default": 0 | ||
| }, | ||
| "created_at": { | ||
| "name": "created_at", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false, | ||
| "default": "CURRENT_TIMESTAMP" | ||
| }, | ||
| "updated_at": { | ||
| "name": "updated_at", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false, | ||
| "default": "CURRENT_TIMESTAMP" | ||
| } | ||
| }, | ||
| "indexes": { | ||
| "idx_projects_path": { | ||
| "name": "idx_projects_path", | ||
| "columns": ["path"], | ||
| "isUnique": true | ||
| } | ||
| }, | ||
| "foreignKeys": {}, | ||
| "compositePrimaryKeys": {}, | ||
| "uniqueConstraints": {}, | ||
| "checkConstraints": {} | ||
| }, | ||
| "tasks": { | ||
| "name": "tasks", | ||
| "columns": { | ||
| "id": { | ||
| "name": "id", | ||
| "type": "text", | ||
| "primaryKey": true, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "project_id": { | ||
| "name": "project_id", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "name": { | ||
| "name": "name", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "branch": { | ||
| "name": "branch", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "path": { | ||
| "name": "path", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false | ||
| }, | ||
| "status": { | ||
| "name": "status", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false, | ||
| "default": "'idle'" | ||
| }, | ||
| "agent_id": { | ||
| "name": "agent_id", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": false, | ||
| "autoincrement": false | ||
| }, | ||
| "metadata": { | ||
| "name": "metadata", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": false, | ||
| "autoincrement": false | ||
| }, | ||
| "created_at": { | ||
| "name": "created_at", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false, | ||
| "default": "CURRENT_TIMESTAMP" | ||
| }, | ||
| "updated_at": { | ||
| "name": "updated_at", | ||
| "type": "text", | ||
| "primaryKey": false, | ||
| "notNull": true, | ||
| "autoincrement": false, | ||
| "default": "CURRENT_TIMESTAMP" | ||
| } | ||
| }, | ||
| "indexes": { | ||
| "idx_tasks_project_id": { | ||
| "name": "idx_tasks_project_id", | ||
| "columns": ["project_id"], | ||
| "isUnique": false | ||
| } | ||
| }, | ||
| "foreignKeys": { | ||
| "tasks_project_id_projects_id_fk": { | ||
| "name": "tasks_project_id_projects_id_fk", | ||
| "tableFrom": "tasks", | ||
| "tableTo": "projects", | ||
| "columnsFrom": ["project_id"], | ||
| "columnsTo": ["id"], | ||
| "onDelete": "cascade", | ||
| "onUpdate": "no action" | ||
| } | ||
| }, | ||
| "compositePrimaryKeys": {}, | ||
| "uniqueConstraints": {}, | ||
| "checkConstraints": {} | ||
| } | ||
| }, | ||
| "views": {}, | ||
| "enums": {}, | ||
| "_meta": { | ||
| "schemas": {}, | ||
| "tables": { | ||
| "\"workspaces\"": "\"tasks\"" | ||
| }, | ||
| "columns": { | ||
| "\"conversations\".\"workspace_id\"": "\"conversations\".\"task_id\"" | ||
| } | ||
| }, | ||
| "internal": { | ||
| "indexes": {} | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: SQLite migration drops table with FKs enabled
PRAGMA foreign_keys=ONis re-enabled before recreatingconversations, but the migration later executesDROP TABLE conversationswhilemessagesstill has a foreign key referencingconversations. With foreign keys enforced, SQLite commonly rejects dropping the referenced table, causing the migration (and app startup) to fail.