Fix 33_triage_ops database seed
What does this MR do and why?
One of our seed scripts creates a personal_access_token but errors out because of issues with hooks inside of transactions.
This MR wraps the seed in Sidekiq::Worker.skipping_transaction_check
to prevent the error.
How to set up and validate locally
Run:
bundle exec rake db:seed_fu FILTER=33_triage_ops SEED_TRIAGE_OPS=true
On master (watch it explode).
Now run it on this branch (and celebrate
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.2
assigned to @leetickett
Hey @leetickett!
Thank you for your contribution to GitLab. Please refer to the contribution flow documentation for a quick overview of the process, and the merge request (MR) guidelines for the detailed process.
When you're ready for a first review, post
@gitlab-bot ready
. If you know a relevant reviewer(s) (for example, someone that was involved in a related issue), you can also assign them directly with@gitlab-bot ready @user1 @user2
.At any time, if you need help moving the MR forward, feel free to post
@gitlab-bot help
. Read more on how to get help.To enable automated checks on your MR, please configure Danger for your fork.
You can comment
@gitlab-bot label <label1> <label2>
to add labels to your MR. Please see the list of allowed labels in thelabel
command documentation.This message was generated automatically. You're welcome to improve it.
added Community contribution workflowin dev labels
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 @rymai
,@alyubenkov
,@ebaque
,@godfat-gitlab
,@atroschinetz
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 label
1 Warning Please add a merge request type to this merge request. 1 Message CHANGELOG missing: If you want to create a changelog entry for GitLab FOSS, add the
Changelog
trailer to the commit message you want to add to the changelog.If you want to create a changelog entry for GitLab EE, also add the
EE: true
trailer to your commit message.If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
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 Mehmet Emin Inac ( @minac
) (UTC+3)Dylan Griffith ( @DylanGriffith
) (UTC+10)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/cc @tle_gitlab @eread
Thank you for helping out earlier
- Resolved by Lee Tickett
@serenafang would you mind reviewing please?
requested review from @serenafang
@serenafang
, thanks for approving this merge request.This is the first time the merge request is approved. To ensure full test coverage, a new pipeline has been started.
For more info, please refer to the following links:
requested review from @engwan
added 591 commits
-
316ba878...5ad85764 - 590 commits from branch
master
- b9876dfe - Add PAT CreateService do_not_email param
-
316ba878...5ad85764 - 590 commits from branch
mentioned in issue gitlab-org/quality/triage-reports#8216 (closed)
- Resolved by Heinrich Lee Yu
@leetickett what do you think if we just do something like this:
diff --git a/db/fixtures/development/33_triage_ops.rb b/db/fixtures/development/33_triage_ops.rb index aaf92315125..b2dd3861169 100644 --- a/db/fixtures/development/33_triage_ops.rb +++ b/db/fixtures/development/33_triage_ops.rb @@ -11,29 +11,31 @@ def seed! puts "Updating settings to allow web hooks to localhost" ApplicationSetting.current_without_cache.update!(allow_local_requests_from_web_hooks_and_services: true) - Sidekiq::Testing.inline! do - puts "Ensuring required groups" - ensure_group('gitlab-com') - ensure_group('gitlab-com/gl-security/appsec') - ensure_group('gitlab-jh/jh-team') - ensure_group('gitlab-org') - ensure_group('gitlab-org/gitlab-core-team/community-members') - ensure_group('gitlab-org/security') - - puts "Ensuring required projects" - ensure_project('gitlab-org/gitlab') - ensure_project('gitlab-org/security/gitlab') - - puts "Ensuring required bot user" - ensure_bot_user - - puts "Setting up webhooks" - ensure_webhook_for('gitlab-com') - ensure_webhook_for('gitlab-org') - - puts "Ensuring work type labels" - ensure_work_type_labels_for('gitlab-com') - ensure_work_type_labels_for('gitlab-org') + Sidekiq::Worker.skipping_transaction_check do + Sidekiq::Testing.inline! do + puts "Ensuring required groups" + ensure_group('gitlab-com') + ensure_group('gitlab-com/gl-security/appsec') + ensure_group('gitlab-jh/jh-team') + ensure_group('gitlab-org') + ensure_group('gitlab-org/gitlab-core-team/community-members') + ensure_group('gitlab-org/security') + + puts "Ensuring required projects" + ensure_project('gitlab-org/gitlab') + ensure_project('gitlab-org/security/gitlab') + + puts "Ensuring required bot user" + ensure_bot_user + + puts "Setting up webhooks" + ensure_webhook_for('gitlab-com') + ensure_webhook_for('gitlab-org') + + puts "Ensuring work type labels" + ensure_work_type_labels_for('gitlab-com') + ensure_work_type_labels_for('gitlab-org') + end end end
The error here was actually incorrect because we're using
Sidekiq::Testing.inline!
so they're not actually enqueued to Redis. Which means it's fine to run it inside the transaction.This is also similar to other seeds where we use
Sidekiq::Worker.skipping_transaction_check
.I think it's a bit cleaner to alter the seed than adding an extra param to the service that's only used for seeds.
Edited by Heinrich Lee Yu
removed review request for @engwan
requested review from @engwan
added workflowready for review label and removed workflowin dev label
@engwan @serenafang, this Community contribution is ready for review.
- Do you have capacity and domain expertise to review this? We are mindful of your time, so if you are not able to take this on, please re-assign to one or more other reviewers.
- Add the workflowin dev label if the merge request needs action from the author.
enabled an automatic merge when the pipeline for 204b4379 succeeds
added typebug label
@leetickett, how was your code review experience with this merge request? Please tell us how we can continue to iterate and improve:
- Leave a
or a on this comment to describe your experience. - Create a new comment starting with
@gitlab-bot feedback
below, and leave any additional feedback you have for us in the comment.
Have five minutes? Take our survey to give us even more feedback on how GitLab can improve the contributor experience.
Thanks for your help!
- Leave a
mentioned in commit dba4b31a
added workflowstaging-canary label and removed workflowready for review label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added workflowpost-deploy-db-staging label and removed workflowproduction label
added workflowpost-deploy-db-production label and removed workflowpost-deploy-db-staging label
added releasedcandidate label
added releasedpublished label and removed releasedcandidate label