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:
Marshall Bowers 2026-03-10 18:53:38 -04:00 committed by GitHub
parent 51ba321b4a
commit 7bf73098a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"];