Render CI statuses on commit page
This MR merges CI commit page into CE commit page.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
See merge request !1519
This changes the query to use a COUNT nested in an INNER JOIN, instead
of a COUNT plus a GROUP BY. There are two reasons for this:
1. Using a COUNT in an INNER JOIN can be quite a bit faster.
2. The use of a GROUP BY means that method calls such as "any?"
(and everything else that calls "count") operate on a Hash that
counts the amount of notes on a per project basis, instead of just
counting the total amount of projects.
The query has been moved into Project.trending as its logic is simple
enough. As a result of this testing the TrendingProjectsFinder class
simply involves testing if the right methods are called, removing the
need for setting up database records.
During the backup we create an intermediate copy of two directories:
builds and uploads. Instead of creating many small files with 'cp
-r', we now use tar (and fast gzip) to create single intermediate
files. This saves on disk IO and disk space while creating a backup.
Use CI commit status for merge request widget
For temporary compatibility with other services like Jenkins we ask for
CI status via AJAX request if there is no commit status in GitLab
database
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
cc @ayufan
See merge request !1517
For temporary compatibility with other services like Jenkins we ask for
CI status via AJAX request if there is no commit status in GitLab
database
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Refactor Ci::Commit and Ci::Build to have all builds for same :sha on single page
This makes Ci::Commit to have only :sha and simplifies routing to have only :sha in path. The :ref and :push_data is now parameter of Ci::Build.
All commit related data (git author, message and .gitlab-ci.yml) is read directly from repository.
All code related for creating builds is moved to CreateBuildsService.
Status deduction is rewritten to make if more efficient and easier to integrate with Commit Status API.
This is partially working, tests are not yet touched.
This slightly changes view of Commit:

@dzaporozhets What do you think?
See merge request !1502
Seed-Fu runs this entire fixture in a transaction, so the `after_commit`
hook won't run until after the fixture is loaded. That is too late
since the Sidekiq::Testing block has already exited. Force clearing
the `after_commit` queue to ensure the job is run now.
See: gitlab-org/gitlab-development-kit#58
Fix referals for :back and relative URL installs.
`app/views/layouts/_head.html.haml` currently sets the referrer policy to "origin". This disables the use of `{ redirect_to :back }`, which is used frequently throughout GitLab, and also breaks relative URL installs for browsers that obey this policy (e.g., Chrome).
For example, using the "origin" policy the "Save Changes" button on the profile screen will (a) dump you at the GitLab home screen (which I can confirm on GitLab.com) or (b) dump you out of GitLab entirely for a relative URL install (which I can confirm on my local install).
The right policy is "origin-when-cross-origin", which disables HTTP_REFERER when coming from other sites but enables it internally. (https://w3c.github.io/webappsec-referrer-policy/) I can confirm that this fixes the problems with ":back" on my install.
See merge request !1505
Revert "Merge branch 'projects' into 'master'"
This reverts commit 2b493695a3, reversing
changes made to b5c12f742a.
This reverts !1487 MR because it cause bugs on mobile devices
cc @skyruler
See merge request !1509