Repository navigation
feat: move the app home from ~/.superset to ~/.paradev (SUPER-2985) #9158
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
saddlepaddle
merged 2 commits into
main
from
saddlepaddle/super-2985-move-home-to-paradev
Nov 1, 2026
Merged
Changes from all commits
Commits
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
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
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
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
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
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
22 changes: 22 additions & 0 deletions
22
apps/desktop/src/main/lib/local-db/legacy-home-paths.test.ts
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,22 @@ | ||
| import { describe, expect, test } from "bun:test"; | ||
| import { is } from "drizzle-orm"; | ||
| import { getTableConfig, SQLiteTable } from "drizzle-orm/sqlite-core"; | ||
| import * as schema from "../../../../../../packages/local-db/src/schema/schema"; | ||
| import { PATH_COLUMNS } from "./legacy-home-paths"; | ||
|
|
||
| describe("local.db legacy home paths", () => { | ||
| test("every rewritten column exists in the schema", () => { | ||
| const columnsByTable = new Map( | ||
| (Object.values(schema) as unknown[]) | ||
| .filter((value): value is SQLiteTable => is(value, SQLiteTable)) | ||
| .map((table) => { | ||
| const config = getTableConfig(table); | ||
| return [config.name, config.columns.map((column) => column.name)]; | ||
| }), | ||
| ); | ||
|
|
||
| for (const [table, column] of PATH_COLUMNS) { | ||
| expect(columnsByTable.get(table)).toContain(column); | ||
| } | ||
| }); | ||
| }); |
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,44 @@ | ||
| import { | ||
| readLegacyHomeMove, | ||
| repairGitWorktrees, | ||
| rewriteLegacyHomePaths, | ||
| type SqliteRunner, | ||
| } from "@superset/agent-setup/legacy-home-move"; | ||
| import { projects, worktrees } from "@superset/local-db"; | ||
| import { eq } from "drizzle-orm"; | ||
| import type { BaseSQLiteDatabase } from "drizzle-orm/sqlite-core"; | ||
|
|
||
| export const PATH_COLUMNS = [ | ||
| ["projects", "main_repo_path"], | ||
| ["projects", "worktree_base_dir"], | ||
| ["worktrees", "path"], | ||
| ["settings", "worktree_base_dir"], | ||
| ["downloads", "save_path"], | ||
| ["screenshots", "save_path"], | ||
| ] as const; | ||
|
|
||
| /** | ||
| * After the app home moved, rewrites local.db's absolute paths to it and | ||
| * repairs git's worktree records in the background. Never throws: a failure | ||
| * leaves the old paths, which still work through the `~/.superset` symlink. | ||
| */ | ||
| export async function applyLegacyHomeMove( | ||
| sqlite: SqliteRunner, | ||
| db: BaseSQLiteDatabase<"sync", unknown, Record<string, unknown>>, | ||
| appHomeDir: string, | ||
| ): Promise<void> { | ||
| const move = readLegacyHomeMove(appHomeDir); | ||
| if (!move) return; | ||
| try { | ||
| if (rewriteLegacyHomePaths(sqlite, PATH_COLUMNS, move) === 0) return; | ||
| const moved = db | ||
| .select({ repoPath: projects.mainRepoPath, worktreePath: worktrees.path }) | ||
| .from(worktrees) | ||
| .innerJoin(projects, eq(worktrees.projectId, projects.id)) | ||
| .all() | ||
| .filter(({ worktreePath }) => worktreePath.startsWith(`${move.to}/`)); | ||
| await repairGitWorktrees(moved); | ||
| } catch (error) { | ||
| console.error("[local-db] Could not rewrite moved paths:", error); | ||
| } | ||
| } |
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
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
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
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
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
Oops, something went wrong.
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.
Use the active home when migration has failed.
If migration fails, the app continues in
.superset, but this path creates new projects in.paradev/projects. If the legacy home already has aprojectsdirectory, the next migration attempt rejects the duplicate and cannot recover automatically. Use the active home for the fallback in this page and the three project modals. (raw.githubusercontent.com)