Commit Graph
3018 Commits
Author SHA1 Message Date
Kamil Trzciński 3eef0e18e0 Merge branch 'refactor-build-service' into 'master'
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:
![Screen_Shot_2015-10-02_at_15.21.47](https://gitlab.com/gitlab-org/gitlab-ce/uploads/ad3f1ccdcc87659ea437d8db6c5b9f94/Screen_Shot_2015-10-02_at_15.21.47.png)

@dzaporozhets What do you think?


See merge request !1502
2015-10-05 17:42:50 +00:00
Kamil Trzcinski 97a11136d3 Fix create_trigger_request_service_spec 2015-10-05 17:06:31 +02:00
Yorick Peterse 2fa4e2fb6a Evaluate benchmark blocks in the proper context
This ensures that blocks defines using "benchmark_subject" have access
to methods defined using let/subject & friends.
2015-10-05 16:27:41 +02:00
Kamil Trzcinski 517815f40f Fix gitlab_ci_yaml_processor specs 2015-10-05 16:07:50 +02:00
Kamil Trzcinski 29a7c6796e Fix GitLabCiService and remove ci_yaml_file from CI push data 2015-10-05 16:06:35 +02:00
Kamil Trzcinski c985389722 Add stage tests 2015-10-05 15:59:31 +02:00
Dmitriy Zaporozhets 39772f0116 Merge branch 'ci-web-hooks' 2015-10-05 15:01:40 +02:00
Yorick Peterse b6808f437d Merge branch 'benchmark-suite' into 'master'
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
2015-10-05 12:56:52 +00:00
Kamil Trzcinski fb12b81b42 Make rubocop happy 2015-10-05 14:39:56 +02:00
Kamil Trzcinski f42078f7c1 Fix rest of tests 2015-10-05 14:31:51 +02:00
Kamil Trzcinski 0367dbf043 Fix build pipelining 2015-10-05 14:15:15 +02:00
Kamil Trzcinski 5064c9038c Fix next bunch of tests 2015-10-05 13:51:28 +02:00
Kamil Trzcinski 782c8f9aa0 Fix triggers spec 2015-10-05 13:37:50 +02:00
Kamil Trzcinski d2d2df0738 Fix next round of tests 2015-10-05 13:12:00 +02:00
Kamil Trzcinski 317a746954 Make commit_spec run 2015-10-05 12:02:26 +02:00
Yorick Peterse 22506ddc50 Added benchmark_subject method for benchmarks
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 } }
2015-10-05 10:51:24 +02:00
Dmitriy Zaporozhets c293cc9152 Move CI web hooks page to project settings area
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-05 10:47:23 +02:00
Kamil Trzcinski e3d870d7fc Add user to Ci::Build to have pusher email address 2015-10-05 10:15:40 +02:00
Kamil Trzcinski 546a3c6561 Refactor commit and build 2015-10-05 09:52:35 +02:00
Guilherme Garnier 963e6366be Fix rubocop warnings in features 2015-10-03 19:59:54 -05:00
Guilherme Garnier aed145a9c6 Fix rubocop warnings in spec/lib and spec/tasks 2015-10-03 16:02:21 -05:00
Guilherme Garnier 1cfb48ddd0 Merge remote-tracking branch 'upstream/master' 2015-10-03 11:46:29 -05:00
Guilherme Garnier 848d7b2a2b Fix rubocop warnings in spec/models 2015-10-03 01:48:54 -05:00
Stan Hu 3fbcc51102 Update README cache key to use full project namespace 2015-10-02 13:26:42 -07:00
Yorick Peterse 19893a1c10 Basic setup for an RSpec based benchmark suite
This benchmark suite uses benchmark-ips
(https://github.com/evanphx/benchmark-ips) behind the scenes. Specs can
be turned into benchmark specs by setting "benchmark" to "true" in the
top-level describe block like so:

    describe SomeClass, benchmark: true do

    end

Writing benchmarks can be done using custom RSpec matchers, for example:

    describe MaruTheCat, benchmark: true do
      describe '#jump_in_box' do
        it 'should run 1000 iterations per second' do
          maru = described_class.new

          expect { maru.jump_in_box }.to iterate_per_second(1000)
        end
      end
    end

By default the "iterate_per_second" expectation requires a standard
deviation under 30% (this is just an arbitrary default for now). You can
change this by chaining "with_maximum_stddev" on the expectation:

    expect { maru.jump_in_box }.to iterate_per_second(1000)
      .with_maximum_stddev(10)

This will change the expectation to require a maximum deviation of 10%.

Alternatively you can use the it block style to write specs:

    describe MaruTheCat, benchmark: true do
      describe '#jump_in_box' do
        subject { -> { described_class.new } }

        it { is_expected.to iterate_per_second(1000) }
      end
    end

Because "iterate_per_second" operates on a block, opposed to a static
value, the "subject" method must return a Proc. This looks a bit goofy
but I have been unable to find a nice way around this.
2015-10-02 17:00:23 +02:00
Dmitriy Zaporozhets 0e7b96bf48 Merge branch 'access_level_badge_bug' into 'master'
Fix: Wrong access level badge on MR comments

https://gitlab.com/gitlab-org/gitlab-ce/issues/2654

See merge request !1501
2015-10-02 14:39:58 +00:00
Douwe Maan 93522e59ec Merge branch 'rs-throttle-reset' into 'master'
Throttle "Forgot your password?" emails

Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2611

See merge request !1476
2015-10-02 14:37:07 +00:00
Yorick Peterse dbc05d4a62 Don't use "rm" for cleaning tmp/builds
If this directory were to be empty this would result in warnings being
printed to STDERR, cluttering spec output. Doing this in Ruby fixes this
problem (and also removes the need for shell alltogether).
2015-10-02 16:25:47 +02:00
Valery Sizov 97e6c9b42c Wrong access level badge on MR comments 2015-10-02 15:11:17 +03:00
Dmitriy Zaporozhets c7e323438e Merge branch 'ensure-ci-project' into 'master'
Ensure GitLab CI project exists when CI service is activated manually

When I check activeated checkbox in project services for GitLab CI it
cause half-working state when gitlab_ci_project is missing. This patch
fixes it until we have proper behaviour implemented later

This fix also bring us to the point when fork of project is a bit broken and have unnecessary code so I made cleanup. 

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

cc @ayufan 

See merge request !1491
2015-10-02 10:39:31 +00:00
Dmitriy Zaporozhets 3515cb9b2d Fix tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-02 11:02:05 +02:00
Dmitriy Zaporozhets 37e9e71ea1 Remove unnecessary fork ci logic
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-02 10:26:56 +02:00
Dmitriy Zaporozhets 5de0b07844 Prevent creating 2 Ci::Project entities when enable CI
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-02 10:08:16 +02:00
Robert Speicher d40dd5cfe3 Conform to spec guidelines that only exist in my head
[ci skip]
2015-10-02 00:14:47 -04:00
Robert Speicher f036d4095e Fix spec broken by updated Devise translations 2015-10-01 23:46:43 -04:00
Robert Speicher b8ff38b1d4 Refactor PasswordsController to use before_actions 2015-10-01 21:47:27 -04:00
Robert Speicher ad7ad8745a Add User#recently_sent_password_reset? 2015-10-01 21:41:56 -04:00
Stan Hu 1c53c28c79 Merge pull request #9684 from NKMR6194/master
Fix link with emoji
2015-10-01 14:10:34 -07:00
SAKATA Sinji a3c6ed5c46 Fix link with emoji 2015-10-02 01:26:19 +09:00
Dmitriy Zaporozhets 63bbe42c9c Merge branch 'stanhu/gitlab-ce-fix-message-id-notify' 2015-10-01 16:28:10 +02:00
Douwe Maan 96c2e22549 Merge branch 'disable-report-button-if-already-reported' into 'master'
Disable the "Report abuse" button if a user has already been reported

Hello,

I've implemented the feature request #2330. Here is what it looks like:

![report-abuse-button-disabled](https://gitlab.com/rymai/gitlab-ce/uploads/420d51906eac1c40c50701a0a340474f/report-abuse-button-disabled.png)

I hope that's an acceptable solution.

cc @DouweM

See merge request !1456
2015-10-01 13:17:18 +00:00
Kamil Trzciński 114853063b Merge branch 'ci-fixes' into 'master'
CI: Fix clone url and fix project token removal

- Fixes broken CI clone url on dev.gitlab.org
- Fixes regression in CI token removal

/cc @vsizov @dzaporozhets 



See merge request !1481
2015-10-01 12:59:39 +00:00
Douwe Maan 41b08e4a08 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2015-10-01 12:34:32 +02:00
Douwe Maan 7c7b664c01 Merge branch 'master' into flevour/gitlab-ce-project-path-insensitive-lookup 2015-10-01 12:33:51 +02:00
Kamil Trzcinski 0e54847339 Fix: CI token removal regression from build trace 2015-10-01 11:43:06 +02:00
Dmitriy Zaporozhets 82f1921165 Merge branch 'mr_improve_errors_handling' 2015-10-01 11:28:36 +02:00
Dmitriy Zaporozhets 58036d6847 Merge branch 'include-full-path-in-new-mr-page' into 'master'
Include full path of source and target branch names in New Merge Request page

The previous title on the New Merge Request page would only show the group name. which could be confusing. Before, if you attempted to create a new merge request within the repo, it might look like this:

![image](https://gitlab.com/stanhu/gitlab-ce/uploads/d300d3a362406628ffc7c8f2b5cc6b5d/image.png)

Since they are in the same repo, this MR just simplifies this to the branches:

![image](https://gitlab.com/stanhu/gitlab-ce/uploads/5d7b3efc2399b37f84ccfd42bd5d6e8d/image.png)

However, if you create a MR from a forked project, you now see the full namespace:

![image](https://gitlab.com/stanhu/gitlab-ce/uploads/7998c3d19e90d405f4634202cc7181c5/image.png)





Closes #2875

See merge request !1477
2015-10-01 09:24:46 +00:00
Dmitriy Zaporozhets 26d5eaff9b Merge branch 'project_moving' into 'master'
Note the original location of a moved project when notifying users of the move

https://dev.gitlab.org/gitlab/gitlabhq/issues/2536

See merge request !1463
2015-10-01 09:22:47 +00:00
Stan Hu 2e92600b30 Fix Message-ID field to be RFC 2111-compliant to prevent e-mails from being dropped
Closes #2867
2015-10-01 01:46:08 -07:00
Valery Sizov 5b57313051 Note the original location of a moved project when notifying users of the move 2015-10-01 09:54:56 +03:00