diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /doc/development/database | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) | |
download | gitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'doc/development/database')
-rw-r--r-- | doc/development/database/add_foreign_key_to_existing_column.md | 3 | ||||
-rw-r--r-- | doc/development/database/database_reviewer_guidelines.md | 95 | ||||
-rw-r--r-- | doc/development/database/index.md | 8 |
3 files changed, 105 insertions, 1 deletions
diff --git a/doc/development/database/add_foreign_key_to_existing_column.md b/doc/development/database/add_foreign_key_to_existing_column.md index b8817eddeec..1b41a52c95e 100644 --- a/doc/development/database/add_foreign_key_to_existing_column.md +++ b/doc/development/database/add_foreign_key_to_existing_column.md @@ -113,7 +113,8 @@ end Validating the foreign key will scan the whole table and make sure that each relation is correct. -NOTE: **Note:** When using [background migrations](../background_migrations.md), foreign key validation should happen in the next GitLab release. +NOTE: **Note:** +When using [background migrations](../background_migrations.md), foreign key validation should happen in the next GitLab release. Migration file for validating the foreign key: diff --git a/doc/development/database/database_reviewer_guidelines.md b/doc/development/database/database_reviewer_guidelines.md new file mode 100644 index 00000000000..894b1ea15f0 --- /dev/null +++ b/doc/development/database/database_reviewer_guidelines.md @@ -0,0 +1,95 @@ +# Database Reviewer Guidelines + +This page includes introductory material for new database reviewers. + +If you are interested in getting an application update reviewed, +check the [database review guidelines](../database_review.md). + +## Scope of work done by a database reviewer + +Database reviewers are domain experts who have substantial experience with databases, +`SQL`, and query performance optimization. + +A database review is required whenever an application update [touches the database](../database_review.md#general-process). + +The database reviewer is tasked with reviewing the database specific updates and +making sure that any queries or modifications will perform without issues +at the scale of GitLab.com. + +For more information on the database review process, check the [database review guidelines](../database_review.md). + +## How to apply for becoming a database reviewer + +Team members are encouraged to self-identify as database domain experts and add it to their [team profile](https://gitlab.com/gitlab-com/www-gitlab-com/-/blob/master/data/team.yml) + +```yaml + projects: + gitlab: + - reviewer database +``` + +Assign the MR which adds your expertise to the `team.yml` file to a database maintainer +or the [Database Team's Engineering Manager](https://about.gitlab.com/handbook/engineering/development/enablement/database/). + +Once the `team.yml` update is merged, the [Reviewer roulette](../code_review.md#reviewer-roulette) +may recommend you as a database reviewer. + +## Resources for database reviewers + +As a database reviewer, join the internal `#database` Slack channel and ask questions or discuss +database related issues with other database reviewers and maintainers. + +There is also an optional database office hours call held bi-weekly, alternating between +European/US and APAC friendly hours. You can join the office hours call and bring topics +that require a more in-depth discussion between the database reviewers and maintainers: + +- [Database Office Hours Agenda](https://docs.google.com/document/d/1wgfmVL30F8SdMg-9yY6Y8djPSxWNvKmhR5XmsvYX1EI/edit). +- [Youtube playlist with past recordings](https://www.youtube.com/playlist?list=PL05JrBw4t0Kp-kqXeiF7fF7cFYaKtdqXM). + +You should also join the [#database-labs](../understanding_explain_plans.md#database-lab) +Slack channel and get familiar with how to use Joe, the slackbot that provides developers +with their own clone of the production database. + +Understanding and efficiently using `EXPLAIN` plans is at the core of the database review process. +The following guides provide a quick introduction and links to follow on more advanced topics: + +- Guide on [understanding EXPLAIN plans](../understanding_explain_plans.md). +- [Explaining the unexplainable series in depesz](https://www.depesz.com/tag/unexplainable/). + +Finally, you can find various guides in the [Database guides](index.md) page that cover more specific +topics and use cases. The most frequently required during database reviewing are the following: + +- [Migrations style guide](../migration_style_guide.md) for creating safe SQL migrations. +- [What requires downtime?](../what_requires_downtime.md). +- [SQL guidelines](../sql.md) for working with SQL queries. + +## How to apply for becoming a database maintainer + +Once a database reviewer feels confident on switching to a database maintainer, +they can update their [team profile](https://gitlab.com/gitlab-com/www-gitlab-com/-/blob/master/data/team.yml) +to a `trainee_maintainer database`: + +```yaml + projects: + gitlab: + - trainee_maintainer database +``` + +The first step is to a create a [Trainee Database Maintainer Issue](https://gitlab.com/gitlab-com/www-gitlab-com/-/issues/new?issuable_template=trainee-database-maintainer). +Use and follow the process described in the 'Trainee database maintainer' template. + +Note that [trainee maintainers](https://about.gitlab.com/handbook/engineering/workflow/code-review/#trainee-maintainer) +are three times as likely to be picked by the [Danger bot](../dangerbot.md) as other reviewers. + +## What to do if you feel overwhelmed + +Similar to all types of reviews, [unblocking others is always a top priority](https://about.gitlab.com/handbook/values/#global-optimization). +Database reviewers are expected to [review assigned merge requests in a timely manner](../code_review.md#review-turnaround-time) +or let the author know as soon as possible and help them find another reviewer or maintainer. + +We are doing reviews to help the rest of the GitLab team and, at the same time, get exposed +to more use cases, get a lot of insights and hone our database and data management skills. + +If you are feeling overwhelmed, think you are at capacity, and are unable to accept any more +reviews until some have been completed, communicate this through your GitLab status by setting +the `:red_circle:` emoji and mentioning that you are at capacity in the status text. diff --git a/doc/development/database/index.md b/doc/development/database/index.md index 665af623059..9ea5b6fcaac 100644 --- a/doc/development/database/index.md +++ b/doc/development/database/index.md @@ -1,5 +1,13 @@ # Database guides +## Database Reviews + +- If you're creating a database MR for review, check out our [Database review guidelines](../database_review.md). + + It provides an introduction on database-related changes, migrations, and complex SQL queries. + +- If you're a database reviewer or want to become one, check out our [introduction to reviewing database changes](database_reviewer_guidelines.md). + ## Tooling - [Understanding EXPLAIN plans](../understanding_explain_plans.md) |