Commit Graph
4332 Commits
Author SHA1 Message Date
Rémy Coutable 07b32287e5 Merge branch 'git-http-controller' into 'master'
Dismantling Grack::Auth part 1: Git HTTP clients

Part of https://gitlab.com/gitlab-org/gitlab-ce/issues/14501

This does not completely get rid of Grack::Auth yet because Git LFS
support is 'behind' it and I would like to not make this MR bigger
than needed.

- changed tests to make HTTP requests instead of calling Rack apps
- added missing test cases for Git HTTP authentication
- moved Git HTTP requests into a 'normal' Rails controller

See merge request !3361
2016-06-08 14:03:27 +00:00
Douwe Maan a0320bed7e Merge branch 'gh-disable-webhooks' into 'master'
Check if GitHub rate limite API was reached before update Webhooks

## What does this MR do?

Checks if the job needs to sleep, and wait for the rate limit to be reseted before update each Webhook.

## Are there points in the code the reviewer needs to double check?

No.

## Why was this MR needed?

The import process can fail if the API rate limit was reached during the import process.

## What are the relevant issue numbers?

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

## Screenshots (if relevant)

Not relevant.

See merge request !4509
2016-06-08 12:27:35 +00:00
Jacob Vosmaer bebe110dff Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into git-http-controller
Conflicts:
	lib/gitlab/workhorse.rb
2016-06-08 10:31:33 +02:00
Rémy Coutable be78a556d9 Merge branch 'refactor/ci-config-add-facade' into 'master'
Add new GitLab CI configuration facade class

## What does this MR do?

This MR is a first iteration of major CI configuration refactoring. See #17139 and #15060 for more details.

## What are the relevant issue numbers?

Closes #17139

See merge request !4462
2016-06-07 16:05:26 +00:00
Jacob Schatz 5b83abcc01 Merge branch 'issue_14189' into 'master'
Ability to prioritize labels

Closes #14189 

See merge request !4009
2016-06-07 15:15:07 +00:00
Douglas Barbosa Alexandre 59e5f4705b Check if GitHub rate limite API was reached before update Webhooks 2016-06-07 10:57:58 -03:00
Jacob Vosmaer (GitLab) afa21054fa Merge branch 'zj-workhorse-to-serve-diffs' into 'master'
Workhorse to serve raw diffs

Fixes (partially) #13999

Dependent on: gitlab-org/gitlab-workhorse!45

See merge request !4130
2016-06-07 12:50:29 +00:00
Douwe Maan 8c356ac550 Merge branch 'rename-ci-commit-phase-3' into 'master'
Rename ci_commit in application code

This is third iteration of renaming `[ci_]commit(s)` in application code to `pipeline(s)`.


See merge request !4464
2016-06-07 12:47:25 +00:00
Douwe Maan 3368afd767 Merge branch 'rename-ci-commit-phase-2' into 'master'
Rename Ci::Commit in specs

This is second iteration of renaming Ci::Commit occurences, this time I try to rename all `let's` and `factories` to match what type of object is created:

1. Rename factories: `ci_[...]_commit_[...]` to `ci_[...]_pipeline_[...]`,
2. Rename all `let's(:[ci_]commit)` to `let(:pipeline)`,
3. Rename all occurrences of `[ci_]commit` to `pipeline` if Pipeline object is created

cc @grzesiek @DouweM 

See merge request !4463
2016-06-07 12:45:59 +00:00
Douwe Maan 8c5712a422 Merge branch 'gh-disable-webhooks' 2016-06-07 13:06:43 +02:00
Douwe Maan acef028d85 Merge branch 'gh-fix-comments-on-diff' 2016-06-07 13:04:32 +02:00
Douwe Maan affd58fb79 Merge branch 'gh-rate-limit' 2016-06-07 12:59:52 +02:00
Grzegorz Bizon 5ef104df59 Improve Ci config loader by changing method signature 2016-06-07 12:53:46 +02:00
Kamil Trzcinski 9839bbae9c Merge branch 'rename-ci-commit-phase-2' into rename-ci-commit-phase-3 2016-06-07 10:27:27 +02:00
Grzegorz Bizon fa097c678c Remove duplicated exception in Ci config
This is a temporary refactoring stub, that is planned to be removed
after removing legacy config processor.
2016-06-07 10:26:38 +02:00
Kamil Trzcinski 6e64d1ac76 Merge remote-tracking branch 'origin/master' into rename-ci-commit-phase-2 2016-06-07 10:26:27 +02:00
Connor Shea efb7da68e6 Fix missed colorize methods. 2016-06-06 15:32:36 -06:00
Yorick Peterse 0ba21860c5 Merge branch 'issue_3359' into 'master'
Remove duplicated notification settings and add unique index

See merge request !4472
2016-06-06 19:14:01 +00:00
Douglas Barbosa Alexandre 67c02edccf Move create! method from formatters to the BaseFormatter 2016-06-06 14:26:28 -03:00
Rémy CoutableandAlfredo Sumaran 499bb9f305 Improve Issuable.order_labels_priority
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-06 11:59:49 -05:00
Felipe Artur 9264203103 change add_concurrent_index function arguments 2016-06-06 13:06:21 -03:00
Jacob Vosmaer 07f49626d0 Fix tests 2016-06-06 17:40:26 +02:00
Douglas Barbosa Alexandre 7c072c76fc Fix importer for GitHub comments on diff
Fix comments on diff after LegacyDiffNote was extracted from Note
2016-06-06 12:19:03 -03:00
Douglas Barbosa Alexandre 9437b8a2e4 Import GitHub repositories respecting the API rate limit
While Octokit auto pagination set the page size to the maximum 100, and
seek to not overstep the rate limit. When the rate limit is reached its
raises an exception, and stop doing new requests.

Here we use a custom pattern for traversing large lists, so we can
check if we’ll reach the rate limit and wait the API to reset the rate
limit before making new requests.
2016-06-06 12:12:18 -03:00
Douglas Barbosa Alexandre 659d5d4830 Disable Webhooks before proceeding with the GitHub import 2016-06-06 12:07:45 -03:00
Kamil Trzcinski ef35ca238d Merge branch 'rename-ci-commit-phase-2' into rename-ci-commit-phase-3 2016-06-06 16:46:44 +02:00
Kamil Trzcinski d9b292f872 Merge remote-tracking branch 'origin/master' into rename-ci-commit
# Conflicts:
#	spec/features/builds_spec.rb
2016-06-06 16:33:52 +02:00
Kamil Trzcinski d225de32cb Merge branch 'rename-ci-commit-phase-2' into rename-ci-commit-phase-3 2016-06-06 11:21:54 +02:00
Kamil Trzcinski 7ad7e10fee Merge remote-tracking branch 'origin/master' into rename-ci-commit 2016-06-06 11:20:17 +02:00
Timothy Andrew 791cc9138b Add a U2fRegistrations table/model.
- To hold registrations from U2F devices, and to authenticate them.
- Previously, `User#two_factor_enabled` was aliased to the
  `otp_required_for_login` column on `users`.
- This commit changes things a bit:
    - `User#two_factor_enabled` is not a method anymore
    - `User#two_factor_enabled?` checks both the
      `otp_required_for_login` column, as well as `U2fRegistration`s
    - Change all instances of `User#two_factor_enabled` to
      `User#two_factor_enabled?`
- Add the `u2f` gem, and implement registration/authentication at the
  model level.
2016-06-06 12:50:31 +05:30
Grzegorz Bizon 23030439c2 Rename class that loads CI configuration to Loader 2016-06-06 08:20:55 +02:00
Robert Speicher cc0ea13d21 Merge branch 'rubocop/enable-ambiguous-operator-rubocop-lint' into 'master'
Enable Lint/AmbiguousOperator rubocop cop

Enforce using parentheses if ambiguous operators are detected, like `header *some_method` or `array.select &:even?`.

See #17478

See merge request !4454
2016-06-05 19:08:56 +00:00
Felipe Artur 8450fe3074 Add index to notification settings 2016-06-03 16:46:10 -03:00
Grzegorz Bizon d2b708ac43 Extract CI config YAML parser to a separate class
With this approach it would be easier to add different sources of
configuration, that we do not necessairly have to be in YAML format.
2016-06-03 21:10:50 +02:00
Zeger-Jan van de Weg 01e1139f68 Workhorse to serve raw diffs 2016-06-03 18:43:22 +02:00
Connor Shea 903946c78a Replace colorize gem with rainbow.
Colorize is a gem licensed under the GPLv2, so we can’t use it in GitLab without relicensing GitLab under the terms of the GPL. Rainbow is licensed under the MIT license and does the exact same thing as Colorize, so Rainbow was added in place of Colorize.

The syntax is slightly different for Rainbow vs. Colorize, and was updated in accordance.

The gem is still a dependency of Spinach, so it’s included in the development/test environments, but won’t be packaged with the actual product, and therefore doesn’t require we relicense the product.

An attempt at relicensing Colorize was made, but didn’t succeed as the library owner never responded.

Rainbow library: https://github.com/sickill/rainbow
Relevant issue regarding licensing in GitLab's gems: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3775
2016-06-03 10:37:09 -06:00
Robert Speicher 8e7e3be5a1 Merge branch 'rubocop/enable-empty-lines-around-access-modifier-cop' into 'master'
Enable Style/EmptyLinesAroundAccessModifier rubocop cop

Keep blank lines around access modifiers.

See #17478

See merge request !4452
2016-06-03 16:35:34 +00:00
Jacob Vosmaer 3f3b036def Use public_send 2016-06-03 17:23:34 +02:00
Jacob Vosmaer 03bec6b0e9 Argh mixed up all the negatives 2016-06-03 17:14:13 +02:00
Jacob Vosmaer 1fab583266 Remove instances of Auth.new 2016-06-03 17:08:44 +02:00
Jacob Vosmaer fa35aea3dd Refactor Gitlab::Auth rate limiting 2016-06-03 17:07:40 +02:00
Kamil Trzcinski 1927a2d30b Rename all ci_commit[s] in application code to pipeline[s] 2016-06-03 16:27:50 +02:00
Kamil Trzcinski 8ce1896b46 Merge commit 'ca3c5c295ed653b483fe81c3918ffe60f46666b9' into rename-ci-commit
* commit 'ca3c5c295ed653b483fe81c3918ffe60f46666b9':
  Let contributors know where to start
  Ensure branch cleanup regardless of whether the import process succeeds
  Fix failing todo tests
  Reorder the todos because the use of the project finder attempts to order them differently
  Update target todo test to use a public project
  Use the project finder in the todos finder to limit todos to just ones within projects you have access to.
  Move filtering todos by projects not pending deletion into a scope on the todo model
  Reduce the filters on the todos joins project query by being explicit about the join
  Ensure we don't show TODOS for projects pending delete
  Fix deprecation warnings in spec/services/issues/bulk_update_service_spec.rb
  Remove unused Issuable#is_assigned? method
  fixup! Don't allow merges with new commits
  fixup! Add `sha` parameter to MR accept API
  Reduce Namespace queries in UserReferenceFilter
  Added ReferenceFilter#nodes
  Returning enums in ReferenceFilter#each_node
  Don't allow merges with new commits
  Add `sha` parameter to MR accept API
2016-06-03 15:53:26 +02:00
Kamil Trzcinski 9423547f61 Fix other places where we still use commit attribute of Build 2016-06-03 15:49:14 +02:00
Z.J. van de Weg 9d491712cf Merge branch 'master' into awardables 2016-06-03 15:20:11 +02:00
Jacob Vosmaer 3ffa494ffe Changes after more review from Rémy 2016-06-03 14:57:34 +02:00
Douwe Maan 3c713de0c4 Merge branch 'gh-branch-cleanup' into 'master'
Ensure branch cleanup regardless of whether the GitHub import process succeeds

Closes #17766


See merge request !4450
2016-06-03 12:43:12 +00:00
Douwe Maan 0e2490c0cb Merge branch '14139-sha-parameter-in-accept-merge-request-api' into 'master'
Resolve "SHA parameter in accept merge request API"

Add a `sha` parameter to the MR merge API, which must match the source SHA for the branch to be merged.

Also add the same parameter to the UI:

![MR_SHA](/uploads/616da728695dc19fa7ef7ef6a016ff81/MR_SHA.gif)

@DouweM and I discussed adding some smart feature to that, like updating the source SHA on navigating to the diff tab, but for now it will just require a refresh 😃

Closes #14139.

See merge request !4414
2016-06-03 12:41:58 +00:00
Douwe Maan 4c8d4c620c Merge branch 'banzai-user-filter-queries' 2016-06-03 14:35:49 +02:00
Grzegorz Bizon d501850e05 Add gitlab ci configuration class that holds hash
As for now, we keep this class inside a oryginal config processor class.
We will move implementation to this class and delegate to it from
current config processor.

After original gitlab ci yaml processor not longer has relevant
impelemntation we will replace it with new configuration class.
2016-06-03 14:20:34 +02:00