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
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
Basic RSpec/benchmark-ips powered benchmark suite
Corresponding issue: #2909, see the commit messages for more details.
A few things to note:
1. The current use of `subject` isn't exactly easy on the eyes due to them having to return a Proc, I'm not sure yet how (and if) we can work around this.
2. The maximum amount of iterations in the current `User.by_login` benchmark is arbitrary, we might have to adjust it once said method's performance has been improved.
3. Benchmarks currently take 2 seconds to warm up and 5 seconds to run (benchmark-ips defaults).
4. The custom RSpec matcher file (`benchmark_matchers.rb`) is a bit messy, any feedback on this would be appreciated
Any comments/feedback on this would be greatly appreciated.
See merge request !1503
This class method can be used in "describe" blocks to specify the
subject of a benchmark. This lets you write:
benchmark_subject { Foo }
instead of:
benchmark_subject { -> { Foo } }