Backfill internal column on notes
What does this MR do and why?
Issue: #374527 (closed)
As we rename confidential
to internal
we now need to backfill existing data to the new column.
We already sync new confidential notes with !97253 (merged).
We need to use a background migration as Notes is a large & high traffic table.
- Migration on Postgres.ai: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/12215/commands/43396 (internal)
- Database migration test: !98433 (comment 1107393230)
Database migration
r db:migrate
main: == 20220920124709 BackfillInternalOnNotes: migrating ==========================
main: == 20220920124709 BackfillInternalOnNotes: migrated (0.0583s) =================
ci: == 20220920124709 BackfillInternalOnNotes: migrating ==========================
ci: -- The migration is skipped since it modifies the schemas: [:gitlab_main].
ci: -- This database can only apply migrations in one of the following schemas: [:gitlab_ci, :gitlab_shared, :gitlab_internal].
ci: == 20220920124709 BackfillInternalOnNotes: migrated (0.0001s) =================
r db:rollback:ci db:rollback:main
ci: == 20220920124709 BackfillInternalOnNotes: reverting ==========================
ci: -- The migration is skipped since it modifies the schemas: [:gitlab_main].
ci: -- This database can only apply migrations in one of the following schemas: [:gitlab_ci, :gitlab_shared, :gitlab_internal].
ci: == 20220920124709 BackfillInternalOnNotes: reverted (0.0001s) =================
main: == 20220920124709 BackfillInternalOnNotes: reverting ==========================
main: == 20220920124709 BackfillInternalOnNotes: reverted (0.0132s) =================
How to set up and validate locally
- Create a non-confidential comment on an issue (or find one)
bin/rails c
- Replicate existing confidential notes that are not synced:
-
Note.last.update_attribute(:confidential, true)
(We need to skip validations, as existing notes can't be set toconfidential
) Note.last.confidential #=> true
Note.last.internal #=> false
-
- Run the migration in this MR
-
Note.last.internal
should betrue
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
changed milestone to %15.5
added devopsplan groupproduct planning sectiondev labels
assigned to @nicolasdular
Suggested Reviewers (beta)
The individuals below may be good candidates to participate in the review based on various factors.
You can use slash commands in comments to quickly assign
/assign_reviewer @user1
.Suggested Reviewers @dzaporozhets
,@eugielimpin
,@tigerwnz
,@ck3g
,@mayra-cabrera
If you do not believe these suggestions are useful, please apply the label Bad Suggested Reviewer. You can also provide feedback for this feature on this issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/357923
.Automatically generated by Suggested Reviewers Bot - an experimental ML-based recommendation engine created by ~"group::applied ml".
Edited by GitLab Reviewer-Recommender Bot- A deleted user
added backend database databasereview pending labels
1 Warning New migrations added but db/structure.sql wasn't updated Usually, when adding new migrations, db/structure.sql should be
updated too (unless the migration isn't changing the DB schema
and isn't the most recent one).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 backend Aman Luthra ( @aluthra2
) (UTC+5.5, 3.5 hours ahead of@nicolasdular
)Stan Hu ( @stanhu
) (UTC-7, 9 hours behind@nicolasdular
)database Matt Kasa ( @mattkasa
) (UTC-7, 9 hours behind@nicolasdular
)Adam Hegyi ( @ahegyi
) (UTC+2, same timezone as@nicolasdular
)~"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
DangerEdited by Ghost User- Resolved by 🤖 GitLab Bot 🤖
Proper labels assigned to this merge request. Please ignore me.
@nicolasdular - please see the following guidance and update this merge request.1 Error, 1 Warning Please add typebug typefeature, or typemaintenance label to this merge request. Please add a subtype label to this merge request. If you have added a type label and do not feel the purpose of this merge request matches one of the subtypes labels, please resolve this discussion.
Edited by 🤖 GitLab Bot 🤖
removed backend database databasereview pending labels
added maintenancerefactor typemaintenance labels
added backend database databasereview pending labels
- Resolved by Matthias Käppler
- Resolved by Matthias Käppler
requested review from @aluthra2
- Resolved by Steve Abrams
requested review from @euko