Commit Graph

81 Commits

Author SHA1 Message Date
f703ba3f85 Docs: add custom descriptions to most relevant docs 2018-05-09 11:07:11 +00:00
686ed453c7 Add missing security process for developers 2018-05-08 10:55:02 +00:00
7275c225f1 Merge branch '43614-osw-diff-docs' into 'master'
Add developer documentation on diff handling and limits

Closes #43614

See merge request gitlab-org/gitlab-ce!18269
2018-04-30 15:34:12 +00:00
5e0a2db706 Add developer documentation on diff handling and limits 2018-04-30 11:16:29 -03:00
4677186908 Remove link to object state model 2018-04-26 09:06:33 +01:00
cca61980d5 Track and act upon the number of executed queries
This ensures that we have more visibility in the number of SQL queries
that are executed in web requests. The current threshold is hardcoded to
100 as we will rarely (maybe once or twice) change it.

In production and development we use Sentry if enabled, in the test
environment we raise an error. This feature is also only enabled in
production/staging when running on GitLab.com as it's not very useful to
other users.
2018-02-01 17:00:46 +01:00
a265ac25cb Add documents for GitLab utilities 2018-01-02 21:30:10 +08:00
b540b98764 Merge branch 'no-ivar-in-modules' into 'master'
Add cop to make sure we don't use ivar in a module

See merge request gitlab-org/gitlab-ce!12800
2017-12-15 19:56:15 +00:00
a68656e650 Docs update documentation guidelines 2017-12-15 10:56:21 +00:00
59ac184fcf Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (671 commits)
  Make rubocop happy
  Use guard clause
  Improve language
  Prettify
  Use temp branch
  Pass info about who started the job and which job triggered it
  Docs: add indexes for monitoring and performance monitoring
  clearer-documentation-on-inline-diffs
  Add docs for commit diff discussion in merge requests
  sorting for tags api
  Clear BatchLoader after each spec to prevent holding onto records longer than necessary
  Include project in BatchLoader key to prevent returning blobs for the wrong project
  moved lfs_blob_ids method into ExtractsPath module
  Converted JS modules into exported modules
  spec fixes
  Bump gitlab-shell version to 5.10.3
  Clear caches before updating MR diffs
  Use new Ruby version 2.4 in GitLab QA images
  moved lfs blob fetch from extractspath file
  Update GitLab QA dependencies
  ...
2017-12-15 17:14:26 +08:00
cd03bf847d Add "Guidelines for implementing Enterprise Edition features" in CE development doc since the doc page is already there
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-12-06 17:24:35 +01:00
aaf1699730 Move the "Limit conflicts with EE" doc to "Automatic CE-> EE merge"
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-12-05 17:49:49 +01:00
45568bed36 Updates based on feedback 2017-11-22 00:59:38 +08:00
4f5588b808 Add basic docs for troubleshooting database problems 2017-11-15 21:19:14 -06:00
617c4fd948 Add basic emoji development docs 2017-11-15 01:55:00 -06:00
4dfe26cd8b Rewrite the GitHub importer from scratch
Prior to this MR there were two GitHub related importers:

* Github::Import: the main importer used for GitHub projects
* Gitlab::GithubImport: importer that's somewhat confusingly used for
  importing Gitea projects (apparently they have a compatible API)

This MR renames the Gitea importer to Gitlab::LegacyGithubImport and
introduces a new GitHub importer in the Gitlab::GithubImport namespace.
This new GitHub importer uses Sidekiq for importing multiple resources
in parallel, though it also has the ability to import data sequentially
should this be necessary.

The new code is spread across the following directories:

* lib/gitlab/github_import: this directory contains most of the importer
  code such as the classes used for importing resources.
* app/workers/gitlab/github_import: this directory contains the Sidekiq
  workers, most of which simply use the code from the directory above.
* app/workers/concerns/gitlab/github_import: this directory provides a
  few modules that are included in every GitHub importer worker.

== Stages

The import work is divided into separate stages, with each stage
importing a specific set of data. Stages will schedule the work that
needs to be performed, followed by scheduling a job for the
"AdvanceStageWorker" worker. This worker will periodically check if all
work is completed and schedule the next stage if this is the case. If
work is not yet completed this worker will reschedule itself.

Using this approach we don't have to block threads by calling `sleep()`,
as doing so for large projects could block the thread from doing any
work for many hours.

== Retrying Work

Workers will reschedule themselves whenever necessary. For example,
hitting the GitHub API's rate limit will result in jobs rescheduling
themselves. These jobs are not processed until the rate limit has been
reset.

== User Lookups

Part of the importing process involves looking up user details in the
GitHub API so we can map them to GitLab users. The old importer used
an in-memory cache, but this obviously doesn't work when the work is
spread across different threads.

The new importer uses a Redis cache and makes sure we only perform
API/database calls if absolutely necessary.  Frequently used keys are
refreshed, and lookup misses are also cached; removing the need for
performing API/database calls if we know we don't have the data we're
looking for.

== Performance & Models

The new importer in various places uses raw INSERT statements (as
generated by `Gitlab::Database.bulk_insert`) instead of using Rails
models. This allows us to bypass any validations and callbacks,
drastically reducing the number of SQL queries and Gitaly RPC calls
necessary to import projects.

To ensure the code produces valid data the corresponding tests check if
the produced rows are valid according to the model validation rules.
2017-11-07 23:24:59 +01:00
69b4c5c011 Exclude comments from specific docs 2017-11-01 15:56:40 +00:00
9e5cb67e9d Fix a missing link and create a separate "Testing guides" section
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-11 16:33:57 +02:00
676840ff9c Refactor the Development documentation, and divide the Testing documentation into multiple pages 2017-10-11 05:59:34 +00:00
75212feefd Move i18n/introduction to i18n/index 2017-10-09 11:28:01 +02:00
8a1f29dee9 Merge branch 'master' into jramsay-4012-improve-internationization-docs 2017-10-09 11:23:30 +02:00
0a7f27e1ad Docs: add translation and proof reading guidelines 2017-10-05 09:56:25 -04:00
0aef7d27e5 Added some Gitaly docs to docs/development 2017-09-27 14:59:51 +00:00
ac51f44f75 Add developer documentation about working with sent emails and previews 2017-09-12 11:44:31 -04:00
1d4cc24012 Document how to swap database tables. 2017-09-11 14:55:14 +02:00
a4a8cae7e1 Document not using database hash indexes 2017-08-16 16:39:37 +02:00
6735e1dc9a Document how to handle different DB (versions) 2017-08-16 16:39:37 +02:00
862da3cfed Add more database development related docs 2017-08-16 16:39:33 +02:00
ff78af152c Added EachBatch for iterating tables in batches
This module provides a class method called `each_batch` that can be used
to iterate tables in batches in a more efficient way compared to Rails'
`in_batches` method. This commit also includes a RuboCop cop to
blacklist the use of `in_batches` in favour of this new method.
2017-07-07 16:39:36 +02:00
af1f6844c9 Added code for defining SHA attributes
These attributes are stored in binary in the database, but exposed as
strings. This allows one to query/create data using plain SHA1 hashes as
Strings, while storing them more efficiently as binary.
2017-06-29 15:37:37 +02:00
d83ee2bbd1 Add the ability to perform background migrations
Background migrations can be used to perform long running data
migrations without these blocking a deployment procedure.

See MR https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11854 for
more information.
2017-06-12 13:24:04 +02:00
4ff1aaedc2 Document not using STI 2017-06-07 17:36:55 +02:00
44d65c36db Document not using polymorphic associations
Instead of using polymorphic associations a developer should use
separate tables.
2017-06-07 17:36:55 +02:00
483d88a9cd Merge branch 'document-not-using-serialize' into 'master'
Document not using ActiveRecord's serialize method

See merge request !11821
2017-06-01 13:06:30 +00:00
671284ba37 Add feature toggles through Flipper 2017-05-31 21:06:01 +00:00
3d160480c0 Document not storing serialized data 2017-05-31 13:59:00 +02:00
1c1cb21e82 Add guide to collaborate with i18n. 2017-05-16 18:26:12 +00:00
b879079b1a Add documentation about adding foreign keys
[ci skip]
2017-05-08 12:37:02 +02:00
b667fba826 Add a manual job to trigger package build in omnibus 2017-05-05 08:41:16 +00:00
3b560dd04b Remove outdated ci_setup.md doc page and document MySQL and RSpec profiling for specific branches
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-25 20:40:44 +02:00
0d2670242a Fix links and do some refactoring 2017-03-29 10:31:39 +02:00
8c3bdc853a Creates Frontend Style guide 2017-03-22 19:30:54 +00:00
204020fc33 Document "No gems fetched from git repositories" policy [ci skip] 2017-01-27 12:17:21 +01:00
a2c397a7a1 Link to object state models [ci skip] 2016-11-17 22:28:44 +00:00
95d552b8dd Start to document how to code for CE with EE in mind
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-17 10:30:49 +01:00
8b70a89c57 Fix link to index.md in development README.md
[ci skip]
2016-11-12 20:48:41 +01:00
11510bf729 [ci skip] Establish basic structure for ux_guide README.md
Block out pages needed for ux_guide

Add resources stub to ux_guide home

Fill out principles and basics

Add TOC to basics

Move all of UI guide to new UX guide structure

Add first level structure on ux-guide pages

Add more details to buttons

Add button images. Update link on development

Renamed surfaces to templates. Add tooltip details

Update typography and icons on Basics page

Add images for color. First draft of voice and tone

Delete findings page

Refine pages. Fill out Surfaces pages

Clean up layout on basics, surfaces, features. Add anchorlinks and counts to components

Fill out components page

Add item title and system info block

Fill out Features page

Switch tooltip placement image
2016-11-10 14:09:35 -08:00
daca93c4b1 Merge branch 'rs-bin-changelog' into 'master'
Add a bin/changelog script and changelog documentation

See merge request !7098
2016-11-02 13:25:47 +00:00
23312b484f Add changelog documentation 2016-10-31 14:56:20 +00:00
83c8241160 Support for post deployment migrations
These are regular Rails migrations that are executed by default. A user
can opt-out of these migrations by setting an environment variable
during the deployment process.

Fixes gitlab-org/gitlab-ce#22133
2016-10-31 12:54:48 +01:00