Skip to content
Snippets Groups Projects

Add group crm settings

Merged Lee Tickett requested to merge 2256-add-namespace-crm-settings into master
All threads resolved!

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.

Edited by Lee Tickett

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Diogo Frazão
  • Diogo Frazão
  • Lee Tickett added 1 commit

    added 1 commit

    Compare with previous version

  • Lee Tickett removed review request for @johnhope

    removed review request for @johnhope

  • Diogo Frazão requested review from @morefice and removed review request for @dfrazao-gitlab

    requested review from @morefice and removed review request for @dfrazao-gitlab

  • Lee Tickett added 486 commits

    added 486 commits

    Compare with previous version

  • Max Orefice
  • Max Orefice
  • Max Orefice removed review request for @morefice

    removed review request for @morefice

  • Lee Tickett added 1 commit

    added 1 commit

    Compare with previous version

  • Lee Tickett requested review from @morefice

    requested review from @morefice

  • Lee Tickett requested review from @a_luna

    requested review from @a_luna

  • Amparo Luna
  • Amparo Luna removed review request for @a_luna

    removed review request for @a_luna

  • Max Orefice
  • Max Orefice requested review from @sabrams and removed review request for @morefice

    requested review from @sabrams and removed review request for @morefice

  • added databasereviewed label and removed databasereview pending label

  • Max Orefice approved this merge request

    approved this merge request

  • :wave: @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:

  • Lee Tickett added 167 commits

    added 167 commits

    Compare with previous version

  • Lee Tickett requested review from @dgruzd

    requested review from @dgruzd

  • Lee Tickett added 1 commit

    added 1 commit

    Compare with previous version

  • Lee Tickett added 1 commit

    added 1 commit

    Compare with previous version

  • Dmitry Gruzd approved this merge request

    approved this merge request

  • Dmitry Gruzd removed review request for @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 :white_check_mark: +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

  • Steve Abrams approved this merge request

    approved this merge request

  • Steve Abrams
  • Steve Abrams resolved all threads

    resolved all threads

  • Steve Abrams enabled an automatic merge when the pipeline for cba78f7d succeeds

    enabled an automatic merge when the pipeline for cba78f7d succeeds

  • merged

  • Hi @leetickett,

    We would love to know how you found your code review experience in this merge request! Please leave a :thumbsup: or a :thumbsdown: 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! :heart:

  • Steve Abrams mentioned in commit ea37fafd

    mentioned in commit ea37fafd

  • added workflowcanary label and removed workflowstaging label

  • added workflowproduction label and removed workflowcanary label

  • Please register or sign in to reply
    Loading