Make migrations skipped in production a no-op
What does this MR do and why?
Make migrations skipped in production on the ci database as a no-op
Migrations
- db/post_migrate/20230524135750_replace_ci_job_artifacts_foreign_key.rb
- db/post_migrate/20230524135803_replace_ci_running_builds_foreign_key.rb
- db/post_migrate/20230524135815_replace_ci_job_variables_foreign_key.rb
- db/post_migrate/20230524135828_replace_p_ci_builds_metadata_foreign_key.rb
- db/post_migrate/20230524135840_replace_p_ci_runner_machine_builds_foreign_key.rb
were skipped in production on the ci database as part of gitlab-com/gl-infra/production#14888 (closed).
Mark them as no-op so that they do not execute in other environments.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Merge request reports
Activity
assigned to @stomlinson
- A deleted user
added database databasereview pending labels
2 Warnings 35a19ede: The commit body should not contain more than 72 characters per line. For more information, take a look at our Commit message guidelines. You've made some app changes, but didn't add any tests.
That's OK as long as you're refactoring existing code,
but please consider adding any of the maintenancepipelines, maintenancerefactor, maintenanceworkflow, documentation, QA labels.Notification to the Data Team about changes to files with possible impact on Data Warehouse, add label
Data Warehouse::Impact Check
.The following files require a review:
db/structure.sql
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer database Gregory Havenga (
@ghavenga
) (UTC+2, 7 hours ahead of@stomlinson
)Adam Hegyi (
@ahegyi
) (UTC+2, 7 hours ahead of@stomlinson
)~"migration" No reviewer available No maintainer available To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Danger- Resolved by Simon Tomlinson
@stomlinson - please see the following guidance and update this merge request.1 Error Please add typebug typefeature, or typemaintenance label to this merge request.
added bugavailability groupdatabase typebug labels
added devopsdata stores sectioncore platform labels
- Resolved by Mayra Cabrera
@mayra-cabrera could you please give this a database review? Thanks!
requested review from @mayra-cabrera
@mayra-cabrera
, thanks for approving this merge request.This is the first time the merge request is approved. To ensure full test coverage, a new pipeline will be started shortly.
For more info, please refer to the following links:
added pipeline:mr-approved label
enabled an automatic merge when the pipeline for 7b112d34 succeeds
added databaseapproved label and removed databasereview pending label
Allure report
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for 1cc36915expand test summary
+-----------------------------------------------------------------------+ | suites summary | +------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +------------------+--------+--------+---------+-------+-------+--------+ | Monitor | 4 | 0 | 0 | 0 | 4 | ✅ | | Create | 8 | 0 | 1 | 0 | 9 | ✅ | | Data Stores | 2 | 0 | 0 | 1 | 2 | ❗ | | Plan | 4 | 0 | 0 | 0 | 4 | ✅ | | Framework sanity | 0 | 0 | 1 | 0 | 1 | ➖ | | Govern | 2 | 0 | 0 | 0 | 2 | ✅ | | Manage | 1 | 0 | 0 | 0 | 1 | ✅ | +------------------+--------+--------+---------+-------+-------+--------+ | Total | 21 | 0 | 2 | 1 | 23 | ❗ | +------------------+--------+--------+---------+-------+-------+--------+
Setting label(s) Category:Database based on groupdatabase.
added Category:Database label
added CI data partitioning label
changed milestone to %16.1
- A deleted user
added Data WarehouseImpact Check label
mentioned in merge request !123353 (merged)
mentioned in epic &7522
- Resolved by Mayra Cabrera
added Data WarehouseNot Impacted label and removed Data WarehouseImpact Check label
@mayra-cabrera, did you forget to run a pipeline before you merged this work? Based on our code review process, if the latest pipeline was created more than 6 hours ago OR finished more than 2 hours ago, you should:
- Ensure the merge request is not in Draft status.
- Start a pipeline (especially important for Community contribution merge requests).
- Set the merge request to auto-merge.
This is a guideline, not a rule. Please consider replying to this comment for transparency.
This message was generated automatically. You're welcome to improve it.
I'm aware of this dear bot. I intentionally didn't run a pipeline to save some CI resources, because this MR is making database migrations non-operational and doesn't require a full suite to run for this, this just the
db:*
jobs that were successfully executed in the last run (these jobs are not updated often)
Hello @stomlinson
The database team is looking for ways to improve the database review process and we would love your help!
If you'd be open to someone on the database team reaching out to you for a chat, or if you'd like to leave some feedback asynchronously, just post a reply to this comment mentioning:
@gitlab-org/database-team
And someone will be by shortly!
Thanks for your help!
This message was generated automatically. You're welcome to improve it.
mentioned in commit f0481b9e
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label
@stomlinson This results in the following diff for
structure.sql
diff --git a/db/structure.sql b/db/structure.sql index 49f272810366..4727e1040d3a 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -37975,6 +37978,9 @@ ALTER TABLE ONLY ci_sources_pipelines ALTER TABLE ONLY ci_resources ADD CONSTRAINT temp_fk_e169a8e3d5_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE SET NULL; +ALTER TABLE ONLY ci_builds_metadata + ADD CONSTRAINT temp_fk_e20479742e_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID; + ALTER TABLE ONLY ci_build_report_results ADD CONSTRAINT temp_fk_rails_16cb1ff064_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; @@ -37990,6 +37996,15 @@ ALTER TABLE ONLY ci_pending_builds ALTER TABLE ONLY ci_build_trace_metadata ADD CONSTRAINT temp_fk_rails_aebc78111f_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY ci_job_artifacts + ADD CONSTRAINT temp_fk_rails_c5137cb2c1_p FOREIGN KEY (partition_id, job_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID; + +ALTER TABLE ONLY ci_running_builds + ADD CONSTRAINT temp_fk_rails_da45cfa165_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID; + +ALTER TABLE ONLY ci_job_variables + ADD CONSTRAINT temp_fk_rails_fbf3b34792_p FOREIGN KEY (partition_id, job_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID; + ALTER TABLE ONLY user_follow_users ADD CONSTRAINT user_follow_users_followee_id_fkey FOREIGN KEY (followee_id) REFERENCES users(id) ON DELETE CASCADE;
Should we clean up local databases manually?
@krasio I'm re-adding them in !123355 (merged) and I hope that they will be merged today/tomorrow.
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
mentioned in merge request !123355 (merged)
added workflowpost-deploy-db-production label and removed workflowproduction label
added releasedcandidate label
mentioned in merge request kubitus-project/kubitus-installer!2224 (merged)
mentioned in merge request mbobin/headway!1 (closed)
mentioned in merge request gitlab-org/ci-cd/ops-eng-managers/headway!1 (merged)
added releasedpublished label and removed releasedcandidate label
added groupdatabase frameworks label and removed groupdatabase [DEPRECATED] label