Speed up migration squasher
What does this MR do and why?
This speeds up the migration squasher (rake gitlab:db:squash) by skipping to pass files that don’t exist to 'git rm'.
On my laptop, the task takes about 265s before the change, which drops down to about 38.033s ± 0.658s after the change. I didn’t measure a full hyperfine run because it would've taken over half an hour. About a 86% drop should be significant enough though.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Run
bundle exec rake gitlab:db:squash\[origin/16-3-stable-ee\]
- See that it finishes in less than half a minute
Merge request reports
Activity
added Engineering Productivity database maintenancerefactor labels
assigned to @kkloss
added typemaintenance label
added pipelinetier-1 label
- A deleted user
added backend databasereview pending labels
1 Warning The master pipeline status page reported failures in If these jobs fail in your merge request with the same errors, then they are not caused by your changes.
Please check for any on-going incidents in the incident issue tracker or in the#master-broken
Slack channel.1 Message This merge request adds or changes files that require a review from the Database team. This merge request requires a database review. To make sure these changes are reviewed, take the following steps:
- Ensure the merge request has database and databasereview pending labels. If the merge request modifies database files, Danger will do this for you.
- Prepare your MR for database review according to the docs.
- Assign and mention the database reviewer suggested by Reviewer Roulette.
If you no longer require a database review, you can remove this suggestion by removing the database label and re-running the
danger-review
job.Reviewer roulette
Category Reviewer Maintainer backend @ahegyi
(UTC+2, same timezone as author)
@maddievn
(UTC+2, same timezone as author)
database @johnmason
(UTC-4, 6 hours behind author)
@ahegyi
(UTC+2, same timezone as author)
Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
DangerEdited by Ghost Userchanged milestone to %17.5
- Resolved by Omar Qunsul
@OmarQunsulGitlab, could you please review this small MR?
requested review from @OmarQunsulGitlab
mentioned in issue gitlab-org/quality/engineering-productivity/team#564 (closed)
added pipeline:mr-approved label
added databasereviewed label and removed databasereview pending label
added pipelinetier-2 label and removed pipelinetier-1 label
Before you set this MR to auto-merge
This merge request will progress on pipeline tiers until it reaches the last tier: pipelinetier-3. We will trigger a new pipeline for each transition to a higher tier.
Before you set this MR to auto-merge, please check the following:
- You are the last maintainer of this merge request
- The latest pipeline for this merge request is pipelinetier-3 (You can find which tier it is in the pipeline name)
- This pipeline is recent enough (created in the last 8 hours)
If all the criteria above apply, please set auto-merge for this merge request.
See pipeline tiers and merging a merge request for more details.
E2E Test Result Summary
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for d9bd3cdcexpand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Verify | 45 | 0 | 2 | 0 | 47 | ✅ | | Secure | 4 | 0 | 0 | 0 | 4 | ✅ | | Create | 128 | 0 | 18 | 0 | 146 | ✅ | | Data Stores | 33 | 0 | 1 | 0 | 34 | ✅ | | Package | 24 | 0 | 11 | 0 | 35 | ✅ | | Plan | 76 | 0 | 0 | 1 | 76 | ✅ | | Govern | 73 | 0 | 0 | 0 | 73 | ✅ | | Manage | 1 | 0 | 1 | 0 | 2 | ✅ | | Fulfillment | 2 | 0 | 0 | 0 | 2 | ✅ | | Analytics | 2 | 0 | 0 | 0 | 2 | ✅ | | Monitor | 8 | 0 | 0 | 0 | 8 | ✅ | | Release | 5 | 0 | 0 | 0 | 5 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 401 | 0 | 33 | 1 | 434 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+
Edited by Ghost User- Resolved by Kev Kloss
note: turns out,
git.remove
accepts an array, which would make this more than 10x times faster than the previous version (265s to 16s). I pushed the change.kev@MBPsomtllhorKev gitlab % hyperfine -p 'git reset && git checkout db' 'bundle exec rake "gitlab:db:squash[origin/16-3-stable-ee]"' Benchmark 1: bundle exec rake "gitlab:db:squash[origin/16-3-stable-ee]" Time (mean ± σ): 16.243 s ± 1.433 s [User: 6.246 s, System: 4.336 s] Range (min … max): 12.812 s … 18.277 s 10 runs
@morefice, could you take a look again, please?
requested review from @morefice