<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gitlab/gitlab-ce.git/app/controllers/import, branch ide-diff-cursor</title>
<subtitle>gitlab.com: gitlab-org/gitlab-ce.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/'/>
<entry>
<title>CE backport for creating CI/CD projects from GitHub</title>
<updated>2018-03-07T15:58:50+00:00</updated>
<author>
<name>Rubén Dávila</name>
<email>ruben@gitlab.com</email>
</author>
<published>2018-03-07T15:58:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=d179f002d9a51ba3e082b5ae5943c0f31c694e4e'/>
<id>d179f002d9a51ba3e082b5ae5943c0f31c694e4e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Moved o_auth/saml/ldap modules under gitlab/auth</title>
<updated>2018-02-28T15:53:02+00:00</updated>
<author>
<name>Horatiu Eugen Vlad</name>
<email>horatiu@vlad.eu</email>
</author>
<published>2018-02-23T12:10:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=1ad5df49b1925f1865e99c3fd8576a762aea9cae'/>
<id>1ad5df49b1925f1865e99c3fd8576a762aea9cae</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'fix/gh-namespace-issue' into 'security-10-4'</title>
<updated>2018-02-09T18:16:28+00:00</updated>
<author>
<name>James Lopez</name>
<email>james@gitlab.com</email>
</author>
<published>2018-01-26T15:39:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=68e31c098ec3984c42b921c07fec8593116e77ce'/>
<id>68e31c098ec3984c42b921c07fec8593116e77ce</id>
<content type='text'>
[10.4] Fix GH namespace security issue
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[10.4] Fix GH namespace security issue
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace $.post in importer status with axios</title>
<updated>2018-02-09T11:14:48+00:00</updated>
<author>
<name>Clement Ho</name>
<email>clemmakesapps@gmail.com</email>
</author>
<published>2018-02-09T11:14:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=71c948d63743c80f50cdd929728bb074d9deeace'/>
<id>71c948d63743c80f50cdd929728bb074d9deeace</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Track and act upon the number of executed queries</title>
<updated>2018-02-01T16:00:46+00:00</updated>
<author>
<name>Yorick Peterse</name>
<email>yorickpeterse@gmail.com</email>
</author>
<published>2018-01-15T15:21:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=cca61980d5ad9c4db65b9498fe49d936657bc0e2'/>
<id>cca61980d5ad9c4db65b9498fe49d936657bc0e2</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Adds Rubocop rule for line break after guard clause</title>
<updated>2017-11-16T16:58:29+00:00</updated>
<author>
<name>Jacopo</name>
<email>beschi.jacopo@gmail.com</email>
</author>
<published>2017-11-14T09:02:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=181cd299f9e06223e8338e93b1c318c671ccb1aa'/>
<id>181cd299f9e06223e8338e93b1c318c671ccb1aa</id>
<content type='text'>
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
</pre>
</div>
</content>
</entry>
<entry>
<title>Rewrite the GitHub importer from scratch</title>
<updated>2017-11-07T22:24:59+00:00</updated>
<author>
<name>Yorick Peterse</name>
<email>yorickpeterse@gmail.com</email>
</author>
<published>2017-10-13T16:50:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=4dfe26cd8b6863b7e6c81f5c280cdafe9b6e17b6'/>
<id>4dfe26cd8b6863b7e6c81f5c280cdafe9b6e17b6</id>
<content type='text'>
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 &amp; 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &amp; 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Whitelist or fix additional `Gitlab/PublicSend` cop violations</title>
<updated>2017-08-14T16:14:11+00:00</updated>
<author>
<name>Robert Speicher</name>
<email>rspeicher@gmail.com</email>
</author>
<published>2017-08-10T16:39:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=260c8da060a6039cbd47cfe31c8ec6d6f9b43de0'/>
<id>260c8da060a6039cbd47cfe31c8ec6d6f9b43de0</id>
<content type='text'>
An upcoming update to rubocop-gitlab-security added additional
violations.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An upcoming update to rubocop-gitlab-security added additional
violations.
</pre>
</div>
</content>
</entry>
<entry>
<title>Enable the Layout/SpaceBeforeBlockBraces cop</title>
<updated>2017-08-09T09:52:22+00:00</updated>
<author>
<name>Rémy Coutable</name>
<email>remy@rymai.me</email>
</author>
<published>2017-08-09T09:52:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=c946ee1282655d332da4ba99c448d6f68cf87cee'/>
<id>c946ee1282655d332da4ba99c448d6f68cf87cee</id>
<content type='text'>
Signed-off-by: Rémy Coutable &lt;remy@rymai.me&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Rémy Coutable &lt;remy@rymai.me&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Re-enable SqlInjection and CommandInjection</title>
<updated>2017-08-08T14:50:54+00:00</updated>
<author>
<name>Brian Neel</name>
<email>brian@gitlab.com</email>
</author>
<published>2017-08-04T02:20:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=9770c57fab0315865a33c8b6df269eded0d57b5c'/>
<id>9770c57fab0315865a33c8b6df269eded0d57b5c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
