Add group crm settings
What does this MR do and why?
Related to #2256
We need somewhere to store whether Customer relations (CRM) is enabled for a group.
I have a feeling adding columns to namespaces
might be challenging because of the size?
We also will probably want to add other settings moving forward- for example:
- instead of just off/on, we might want to set access level (e.g. report/developer+ etc)
- we may want to control who can "admin" crm records (e.g. create contacts/organizations)
Also, as it is likely to be a small number/%age of namespaces enabling this option, it seemed sensible to separate into it's own table
lee@cc-gdk-2:~/gitlab-development-kit/gitlab$ bundle exec rake db:migrate:up VERSION=20211216220939 RAILS_ENV=development
== 20211216220939 AddGroupCrmSettings: migrating ==========================
-- create_table(:group_crm_settings, {:id=>false})
-> 0.0136s
== 20211216220939 AddGroupCrmSettings: migrated (0.0137s) =================
lee@cc-gdk-2:~/gitlab-development-kit/gitlab$ bundle exec rake db:migrate:down VERSION=20211216220939 RAILS_ENV=development
== 20211216220939 AddGroupCrmSettings: reverting ==========================
-- drop_table(:group_crm_settings, {:id=>false})
-> 0.0033s
== 20211216220939 AddGroupCrmSettings: reverted (0.0045s) =================
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 %14.7
added CRM [deprecated] Accepting merge requests customer devopsplan groupproduct planning sectiondev typefeature + 1 deleted label
assigned to @leetickett
Thank you for your contribution to GitLab. We believe that everyone can contribute and contributions like yours are what make GitLab great!
- Our Merge Request Coaches will ensure your contribution is reviewed in a timely manner*.
- If you haven't, please set up a
DANGER_GITLAB_API_TOKEN
. - You can comment
@gitlab-bot label ~"group::"
to add a group label. - After a few days, feel free to ask
@gitlab-bot help
or ping a Merge Request Coach. - Read more on how to get help.
This message was generated automatically. You're welcome to improve it.
added Community contribution label
- A deleted user
added database databasereview pending labels
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 Ross Fuhrman ( @rossfuhrman
) (UTC-6)Tetiana Chupryna ( @brytannia
) (UTC+2)database Nikola Milojevic ( @nmilojevic1
) (UTC+1)Steve Abrams ( @sabrams
) (UTC-7)~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
Dangerremoved ~20757942 database databasereview pending labels
- Resolved by Lee Tickett
@dfrazao-gitlab and @johnhope would you mind giving this a quick review please (from an approach standpoint)?
Happy to sync up if easier.
If we agree it's the right approach, should we keep this migration on it's own? Or also include the backend and potentially frontend changes to expose the setting in the UI?
Thanks a mill
requested review from @dfrazao-gitlab and @johnhope
removed [deprecated] Accepting merge requests label
- A deleted user
added backend database databasereview pending labels
- Resolved by Lee Tickett
- Resolved by Lee Tickett
- Resolved by Lee Tickett
- Resolved by Lee Tickett
- Resolved by Lee Tickett
added pipeline:skip-undercoverage label
removed review request for @johnhope
requested review from @morefice and removed review request for @dfrazao-gitlab
added 486 commits
-
1e1ba2a8...68cfd774 - 485 commits from branch
master
- 90e3702d - Add group crm settings
-
1e1ba2a8...68cfd774 - 485 commits from branch
- Resolved by Lee Tickett
- Resolved by Lee Tickett
- Resolved by Lee Tickett
Thanks for your contribution
♂️Great work with this MR and thanks for the well detailed MR description!
Left 2 suggestions on the database, let me know what you think, back to you
removed review request for @morefice
requested review from @morefice
- Resolved by Dmitry Gruzd
requested review from @a_luna
- Resolved by Lee Tickett
removed review request for @a_luna
- Resolved by Steve Abrams
- Resolved by Steve Abrams
added databasereviewed label and removed databasereview pending label
@morefice
, 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:
added 167 commits
-
a5a2ca7d...32dd97c8 - 166 commits from branch
master
- 4efa74ad - Add group crm settings
-
a5a2ca7d...32dd97c8 - 166 commits from branch
requested review from @dgruzd
removed review request for @dgruzd
Database migrations
Migrations included in this change have been executed on gitlab.com data for testing purposes. For details, please see the migration testing pipeline (limited access).
Migration Type Total runtime Result DB size change 20211216220939 - AddGroupCrmSettings Regular 1.6 s +24.00 KiB Runtime Histogram for all migrations
Query Runtime Count 0 seconds - 0.01 seconds 0 0.01 seconds - 0.1 seconds 2 0.1 seconds - 1 second 1 1 second - 5 minutes 0 5 minutes + 0 Migration: 20211216220939 - AddGroupCrmSettings
- Type: Regular
- Duration: 1.6 s
- Database size change: +24.00 KiB
Query Calls Total Time Max Time Mean Time Rows CREATE TABLE "group_crm_settings" ("group_id" bigserial NOT NULL PRIMARY KEY, "created_at" timestamptz NOT NULL, "updated_at" timestamptz NOT NULL, "enabled" boolean DEFAULT FALSE NOT NULL, CONSTRAINT "fk_rails_74fdf2f13d" FOREIGN KEY ("group_id") REFERENCES "namespaces" ("id") ON DELETE CASCADE) /*application:test,db_config_name:main*/
1 73.3 ms 73.3 ms 73.3 ms 0 CREATE INDEX "index_group_crm_settings_on_group_id" ON "group_crm_settings" ("group_id") /*application:test,db_config_name:main*/
1 0.8 ms 0.8 ms 0.8 ms 0 SELECT $1::regtype::oid
1 0.0 ms 0.0 ms 0.0 ms 1 Histogram for AddGroupCrmSettings
Query Runtime Count 0 seconds - 0.01 seconds 0 0.01 seconds - 0.1 seconds 2 0.1 seconds - 1 second 1 1 second - 5 minutes 0 5 minutes + 0
Other migrations pending on GitLab.com
Migration Type Total runtime Result DB size change Clone Details
Clone ID Clone Created At Clone Data Timestamp Expected Removal Time database-testing-954210
2021-12-23 22:11:55 UTC 2021-12-23 19:59:57 UTC 2021-12-24 10:12:59 +0000 Artifacts
Brought to you by gitlab-org/database-team/gitlab-com-database-testing. Epic
- A deleted user
added database-testing-automation label
added databaseapproved label and removed database-testing-automation databasereviewed labels
- Resolved by Steve Abrams
enabled an automatic merge when the pipeline for cba78f7d succeeds
Hi @leetickett,
We would love to know how you found your code review experience in this merge request! Please leave a
or a on this comment to describe your experience.Once done, please comment
@gitlab-bot feedback
below and feel free to leave any additional feedback you have in the same comment.Thanks for your help!
mentioned in commit ea37fafd
added workflowstaging-canary label
added workflowstaging label and removed workflowstaging-canary label
mentioned in issue gitlab-com/www-gitlab-com#12063 (closed)
added workflowcanary label and removed workflowstaging label
added workflowproduction label and removed workflowcanary label
added releasedcandidate label
added releasedpublished label and removed releasedcandidate label
mentioned in merge request kubitus-project/kubitus-installer!562 (merged)
removed groupproduct planning label