The code will be published later.
The ddl-breaking-change
application identifies potential breaking changes in SQL migrations that might impact downstream consumer scripts (ClickHouse, Greenplum, Tableau, Metabase, etc.). It analyzes changes in Merge Requests, detects specific DDL commands (e.g., DROP COLUMN
, RENAME COLUMN
), and sends notifications to GitLab and Mattermost.
To provide precise information about potentially affected consumers, the application leverages the DataHub platform. It utilizes DataHub's API to retrieve a list of dependent tables and columns for every detected breaking change. This integration ensures that the notifications sent are relevant and targeted, allowing downstream teams to take appropriate action.
- Producer Team modifies the Operational microservice code, including DDL migrations, and creates a Merge Request (MR) in the repository.
- Upon MR creation, a GitLab CI Job (ddl-breaking-change) analyzes the MR's changes for potential DDL breaking changes.
- The CI Job consults a local SQLite database to check if identical DDL breaking changes were detected in previous commits.
- If new DDL breaking changes are found, the CI Job queries DataHub's API to identify dependent tables and columns impacted by the changes.
- Using the information from DataHub, the CI Job sends notifications (alerts) to the designated Mattermost alert channel, specifying the affected tables and columns, notifying their Owners on the Consumer side.
- The CI Job also adds a comment to the MR commit, detailing the detected DDL breaking changes and the downstream impact identified via DataHub. Depending on the configuration, the CI Job might block the MR or simply notify about potential issues.
- The CI Job persists information about the detected DDL breaking changes in the local SQLite database to prevent duplicate notifications in the future.
- After the MR is reviewed and approved, the DDL migrations are applied to the Operational microservice database using migration tools.
- The Consumer Team analyzes the DDL breaking changes and updates their scripts if necessary to ensure compatibility with the new database changes.
- The Consumer Team, utilizing data from the Operational database and whose scripts might be affected by DDL breaking changes, monitors new alerts in the designated Mattermost alert channel and adjusts their ingestion scripts, coordinating the timeline for changes.