mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-31 19:05:00 +07:00
danger: Add a check for changing Collab database schemas (#51234)
This PR adds a Danger check to remind contributors that any database changes for Collab need to be done via a migration in the Cloud repo: <img width="888" height="323" alt="Screenshot 2026-03-10 at 6 39 21 PM" src="https://github.com/user-attachments/assets/5b3bbc3d-1e9d-409a-837b-565e1ca36935" /> Release Notes: - N/A
This commit is contained in:
parent
51ba321b4a
commit
7bf73098a7
1 changed files with 19 additions and 0 deletions
|
|
@ -61,6 +61,25 @@ if (includesIssueUrl) {
|
|||
);
|
||||
}
|
||||
|
||||
const MIGRATION_SCHEMA_FILES = [
|
||||
"crates/collab/migrations/20251208000000_test_schema.sql",
|
||||
"crates/collab/migrations.sqlite/20221109000000_test_schema.sql",
|
||||
];
|
||||
|
||||
const modifiedSchemaFiles = danger.git.modified_files.filter((file) =>
|
||||
MIGRATION_SCHEMA_FILES.some((schemaFilePath) => file.endsWith(schemaFilePath)),
|
||||
);
|
||||
|
||||
if (modifiedSchemaFiles.length > 0) {
|
||||
warn(
|
||||
[
|
||||
"This PR modifies database schema files.",
|
||||
"",
|
||||
"If you are making database changes, a migration needs to be added in the Cloud repository.",
|
||||
].join("\n"),
|
||||
);
|
||||
}
|
||||
|
||||
const FIXTURE_CHANGE_ATTESTATION = "Changes to test fixtures are intentional and necessary.";
|
||||
|
||||
const FIXTURES_PATHS = ["crates/assistant_tools/src/edit_agent/evals/fixtures"];
|
||||
|
|
|
|||
Loading…
Reference in a new issue