Repository navigation
fix(projects): preserve grouped renames to repository names #25244
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
+202
−17
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1302791
fix(projects): preserve grouped renames to repository names
maria-rcks 054308c
fix(server): retain recorded project renames during upgrade
maria-rcks 3ba3004
fix(server): preserve project rename intent across baselines
maria-rcks 0df9727
test(server): cover custom title preservation during baseline replay
maria-rcks 420df3a
style(server): format baseline title assertion
maria-rcks 7c54a04
fix(server): keep custom project titles when baselines replay
maria-rcks 9cda445
fix(server): custom-title migration skips an existing column
maria-rcks b5f498c
Merge remote-tracking branch 'github/main' into maria/takeover-pr-23074
maria-rcks 8dee6e0
Merge remote-tracking branch 'origin/main' into maria/takeover-pr-23074
juliusmarminge 229a023
Merge remote-tracking branch 'origin/main' into maria/takeover-pr-23074
juliusmarminge 4ca2353
test(server): trim custom-title store test to the rename and replay
juliusmarminge 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
41 changes: 41 additions & 0 deletions
41
apps/server/src/persistence/Migrations/087_ProjectionProjectsCustomTitle.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,41 @@ | ||
| import { assert, it } from "@effect/vitest"; | ||
| import * as NodeSqliteClient from "@t3tools/shared/nodeSqliteClient"; | ||
| import * as Effect from "effect/Effect"; | ||
| import * as SqlClient from "effect/sql/SqlClient"; | ||
|
|
||
| import { runMigrations } from "../Migrations.ts"; | ||
|
|
||
| const layer = it.layer(NodeSqliteClient.layer({ filename: ":memory:" })); | ||
|
|
||
| layer("087_ProjectionProjectsCustomTitle", (it) => { | ||
| it.effect("marks projects with a recorded title update as renamed", () => | ||
| Effect.gen(function* () { | ||
| const sql = yield* SqlClient.SqlClient; | ||
| yield* runMigrations({ toMigrationInclusive: 86 }); | ||
| for (const projectId of ["renamed", "untouched"]) { | ||
| yield* sql` | ||
| INSERT INTO projection_projects | ||
| (project_id, title, workspace_root, scripts_json, created_at, updated_at) | ||
| VALUES (${projectId}, 'repo', ${"/tmp/" + projectId}, '[]', '2026-10-01', '2026-10-01') | ||
| `; | ||
| yield* sql` | ||
| INSERT INTO orchestration_events | ||
| (event_id, aggregate_kind, stream_id, stream_version, event_type, occurred_at, | ||
| actor_kind, payload_json, metadata_json, application_event_version) | ||
| VALUES (${projectId}, 'project', ${projectId}, 1, 'project.meta-updated', '2026-10-01', | ||
| 'client', ${JSON.stringify(projectId === "renamed" ? { title: "repo" } : { autoPull: true })}, '{}', 2) | ||
| `; | ||
| } | ||
| // Builds of this change before renumbering already added the column. | ||
| yield* sql`ALTER TABLE projection_projects ADD COLUMN has_custom_title INTEGER NOT NULL DEFAULT 0`; | ||
| yield* runMigrations(); | ||
| assert.deepStrictEqual( | ||
| yield* sql`SELECT project_id, has_custom_title FROM projection_projects ORDER BY project_id`, | ||
| [ | ||
| { project_id: "renamed", has_custom_title: 1 }, | ||
| { project_id: "untouched", has_custom_title: 0 }, | ||
| ], | ||
| ); | ||
| }), | ||
| ); | ||
| }); |
26 changes: 26 additions & 0 deletions
26
apps/server/src/persistence/Migrations/087_ProjectionProjectsCustomTitle.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,26 @@ | ||
| import * as Effect from "effect/Effect"; | ||
| import * as SqlClient from "effect/sql/SqlClient"; | ||
|
|
||
| export default Effect.gen(function* () { | ||
| const sql = yield* SqlClient.SqlClient; | ||
| // Earlier builds of this change shipped the column under another migration id. | ||
| const columns = yield* sql<{ readonly name: string }>` | ||
| PRAGMA table_info(projection_projects) | ||
| `; | ||
| if (!columns.some((column) => column.name === "has_custom_title")) { | ||
| yield* sql` | ||
| ALTER TABLE projection_projects | ||
| ADD COLUMN has_custom_title INTEGER NOT NULL DEFAULT 0 | ||
| `; | ||
| } | ||
| yield* sql` | ||
| UPDATE projection_projects | ||
| SET has_custom_title = 1 | ||
| WHERE project_id IN ( | ||
| SELECT stream_id FROM orchestration_events | ||
|
macroscopeapp[bot] marked this conversation as resolved.
Resolved
|
||
| WHERE aggregate_kind = 'project' | ||
| AND event_type = 'project.meta-updated' | ||
| AND json_type(payload_json, '$.title') = 'text' | ||
| ) | ||
| `; | ||
| }); | ||
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.
Uh oh!
There was an error while loading. Please reload this page.