Support multiple columns in column copy triggers
What does this MR do?
Relates to #326569 (closed)
In migration helpers we use "rename" triggers for certain migrations, whenever we need to ensure a destination column keeps the same value as a source column. We need to extend this functionality to support multiple source and destination columns, for migrations where we need to update more than one column at a time. At the same time, we need to maintain backwards compatibility with existing behavior to not break any existing migrations.
That means the install_rename_triggers
and related functions should:
- Create triggers with the same names, same behavior, and same syntax (to prevent diff in
structure.sql
) - Retain compatibility with their existing method signature, while also supporting arrays of column names
Does this MR meet the acceptance criteria?
Conformity
-
Does this MR need a changelog?- [-] I have included a changelog entry.
- [-] I have not included a changelog entry because _____.
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides - [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Merge request reports
Activity
changed milestone to %13.11
added database groupdatabase labels
added databasereview pending label
added backend label
2 Messages CHANGELOG missing: If you want to create a changelog entry for GitLab FOSS, run the following:
bin/changelog -m 58177 "Support multiple columns in column copy triggers"
If you want to create a changelog entry for GitLab EE, run the following instead:
bin/changelog --ee -m 58177 "Support multiple columns in column copy triggers"
If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
We are in the process of rolling out a new workflow for adding changelog entries. This new workflow uses Git commit subjects and Git trailers to generate changelogs. This new approach will soon replace the current YAML based approach. To ease the transition process, we recommend you start using both the old and new approach in parallel. This is not required at this time, but will make it easier to transition to the new approach in the future. To do so, pick the commit that should go in the changelog and add a
Changelog
trailer to it. For example:This is my commit's subject line This is the optional commit body. Changelog: added
The value of the
Changelog
trailer should be one of the following: added, fixed, changed, deprecated, removed, security, performance, other.For more information, take a look at the following resources:
- gitlab-com/gl-infra/delivery#1564 (closed)
- https://docs.gitlab.com/ee/api/repositories.html#generate-changelog-data
If you'd like to see the new approach in action, take a look at the commits in the Omnibus repository.
Reviewer roulette
Changes that require review have been detected! A merge request is normally reviewed by both a reviewer and a maintainer in its primary category (e.g. frontend or backend), and by a maintainer in all other categories.
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.
Category Reviewer Maintainer backend Subashis Chakraborty ( @subashis
) (UTC-6, 2 hours behind@pbair
)Gabriel Mazetto ( @brodock
) (UTC+1, 5 hours ahead of@pbair
)database Maxime Orefice ( @morefice
) (UTC-4, same timezone as@pbair
)Toon Claes ( @toon
) (UTC+2, 6 hours ahead of@pbair
)If needed, you can retry the
danger-review
job that generated this comment.Generated by
DangerEdited by 🤖 GitLab Bot 🤖added 1 commit
- b996a3e9 - Support multiple columns in column copy triggers
Setting label(s) Category:Database devopsenablement sectionenablement based on groupdatabase.
added Category:Database devopssystems sectioncore platform labels
added typemaintenance label
added typefeature label
- Resolved by Mayra Cabrera
requested review from @minac
mentioned in merge request !58409 (merged)
- Resolved by Patrick Bair
- Resolved by Patrick Bair
- Resolved by Patrick Bair
- Resolved by Mayra Cabrera
- Resolved by Mayra Cabrera
- Resolved by Mayra Cabrera
added 462 commits
-
b996a3e9...63b285ee - 461 commits from branch
master
- 66f74541 - Support multiple columns in column copy triggers
-
b996a3e9...63b285ee - 461 commits from branch
- Resolved by Andreas Brandl
@abrandl could you check this one?
requested review from @abrandl
requested review from @mayra-cabrera and removed review request for @cablett
- Resolved by Mayra Cabrera
- Resolved by Mayra Cabrera
- Resolved by Mayra Cabrera
- Resolved by Mayra Cabrera
- Resolved by Mayra Cabrera
removed review request for @mayra-cabrera
removed review request for @abrandl
requested review from @mayra-cabrera
requested review from @abrandl
mentioned in commit af86e8bd
mentioned in commit 2846849e
added 2637 commits
-
66f74541...6194c76a - 2634 commits from branch
master
- 3754bc0b - Support multiple columns in column copy triggers
- af86e8bd - Make trigger name optional for install_rename_triggers_for_postgresql
- 2846849e - Update UnidirectionalCopyTrigger to applu code review sugegstions
Toggle commit list-
66f74541...6194c76a - 2634 commits from branch
@krasio While looking here, I created !59638 (closed) to prepare the next migration on
ci_build_artifacts
, which is needs this change at hand.I'll use it to execute a few jobs on a thin clone. Let me know if you have this inflight already, so not to duplicate your work.
@abrandl Nope, I don't. Thanks for doing this!
mentioned in issue #326569 (closed)
- Resolved by Mayra Cabrera
@krasio Thanks for picking this up! I've been testing this in !59638 (closed) and it looks great - LGTM!
@mayra-cabrera Once backend looks good, please feel free to merge.