Commit Graph

2134 Commits

Author SHA1 Message Date
James Lopez 903da37755 WIP - starting refactoring import/export to use services 2016-06-13 20:35:57 +02:00
Douwe Maan 1cbd5c6686 Merge branch 'gitlab-auth-method-names' into 'master'
Improve Gitlab::Auth method names

Auth.find was a very generic name for a very specific method.
Auth.find_in_gitlab_or_ldap was inaccurate in GitLab EE where it also
looks in Kerberos.


See merge request !4589
2016-06-13 18:05:53 +00:00
James Lopez bd5c749f29 fix file.write 2016-06-13 18:24:21 +02:00
James Lopez f449eeb6f1 Merge branch 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-export-ui-experimental 2016-06-13 17:56:50 +02:00
James Lopez 9fd35740b8 refactored notes logic 2016-06-13 17:09:21 +02:00
James Lopez 833dc3204d few more changes based on feedback 2016-06-13 16:55:51 +02:00
James Lopez f4d762d7c2 addressing MR feedback, few changes to members mapper 2016-06-13 16:12:40 +02:00
James Lopez c23aaf1318 Merge branches 'feature/project-export-ui-experimental' and 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-export-ui-experimental 2016-06-13 15:40:16 +02:00
James Lopez e5cf4cd745 corrected a few warnings 2016-06-13 15:33:28 +02:00
James Lopez e83fc684a5 Merge branches 'feature/project-export-ui-experimental' and 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-export-ui-experimental
# Conflicts:
#	Gemfile.lock
#	app/helpers/todos_helper.rb
#	app/models/todo.rb
#	app/views/projects/edit.html.haml
#	lib/gitlab/import_export/import_service.rb
2016-06-13 14:00:19 +02:00
James Lopez 6f0c503397 Merge branches 'feature/project-export' and 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-import 2016-06-13 13:44:00 +02:00
James Lopez 86e4751011 fixed deprecation warning 2016-06-13 13:42:30 +02:00
James Lopez b07dc938b9 fixed specs and refactored a few things due to recent model changes and merge conflicts 2016-06-13 13:34:36 +02:00
James Lopez ad68bc63b5 Merge branches 'feature/project-export' and 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-import
# Conflicts:
#	app/models/project.rb
#	db/schema.rb
#	lib/gitlab/import_export/import_export_reader.rb
2016-06-13 12:43:25 +02:00
James Lopez cc32260394 added comments to import export reader class 2016-06-13 12:32:15 +02:00
Yorick Peterse ea7ff13410
Removed old comment from update_column_in_batches 2016-06-13 11:50:27 +02:00
Yorick Peterse 9c238dc970
Update columns in batches until no rows are left
Instead of updating a fixed number of rows (based on the amount of rows
available at the start of the update) the method
"update_column_in_batches" will now continue updating rows until it runs
out of rows to process.

For a table with a high rate of inserts this may result in the migration
taking quite some time. However, the alternative is not all rows being
updated or the "change_column_null" method raising an error due to there
being NULL values.
2016-06-13 11:38:57 +02:00
Yorick Peterse b33b7be53e
Handle NULL migration errors in migration helpers
This ensures that whenever changing the NULL constraint of a column
fails we still drop the column.
2016-06-13 11:22:58 +02:00
Grzegorz Bizon ebe14437e9 Merge branch 'master' into refactor/ci-config-add-global-entry
* master: (59 commits)
  Improved SVG sanitizer specs to include smoke tests for clean.
  Refactored SVG sanitizer
  Added SVG sanitizer fix to the changelog
  Refactor SVG sanitizer and prevent `xlink:href` to refer to external resources
  Fix SVG whitelisting to allow namespaced attributes
  Fix Error 500 when using closes_issues API with an external issue tracker
  Center layout navigation and remove icons
  Fix preferences_spec test
  Add back sidebar counters and username
  Only create the backup directory if it is local
  Fix safari logo loading animation safari bug
  Revert side nav to full width; remove border under nav; remove tooltips on nav links; stop page content shifting with side nav; put project nav in container
  Update media queries
  Fix profile test
  Fix logo at all screen widths, update sidebar text
  Move tanuki icon to center of nav bar; keep nav closed by default; remove collapsed nav cookie
  Remove unused MergeRequest#gitlab_merge_status method
  Add CHANGELOG item for labels/milestones navigation change
  Render issues link on issues subnav unless you visit merge request controller
  Render only issues/mr in subnav depends on context
  ...
2016-06-13 11:14:38 +02:00
James Lopez 069bc26418 refactored loads of things due to commits to pipeline change 2016-06-13 10:55:54 +02:00
Grzegorz Bizon 11c0d02283 Simplify ci config node factory 2016-06-13 09:58:35 +02:00
James Lopez 771f735109 few more modifications based on comments 2016-06-13 09:37:58 +02:00
James Lopez e2c95c07a4 Merge branches 'feature/project-export' and 'master' of gitlab.com:gitlab-org/gitlab-ce into feature/project-export 2016-06-13 09:22:33 +02:00
Grzegorz Bizon 7c8f3b0cfc Duplicate CI config node factory on class level 2016-06-13 08:50:12 +02:00
Gabriel Mazetto a9eaa20dcb Refactored SVG sanitizer 2016-06-12 21:05:58 -04:00
Gabriel Mazetto 13791c6704 Refactor SVG sanitizer and prevent `xlink:href` to refer to external resources 2016-06-12 21:05:58 -04:00
Gabriel Mazetto 02b882418a Fix SVG whitelisting to allow namespaced attributes 2016-06-12 21:05:57 -04:00
Robert Speicher 37be2007f9 Merge branch 'workhorse-helpers' into 'master'
Add workhorse controller and API helpers

Adds `send_git_blob` and `send_git_archive` controller and API helpers to reduce duplication and make Workhorse easier for a developer to work with.

See merge request !4486
2016-06-10 16:21:26 +00:00
Jacob Vosmaer 0e896ffe4e Improve Gitlab::Auth method names
Auth.find was a very generic name for a very specific method.
Auth.find_in_gitlab_or_ldap was inaccurate in GitLab EE where it also
looks in Kerberos.
2016-06-10 14:51:16 +02:00
Grzegorz Bizon cc373a3550 Add factory for fabricating new ci config nodes 2016-06-10 14:01:07 +02:00
Douwe Maan a9a9f19b0b Merge branch 'gh-rate-limit' into 'master'
Wrap all rate limiting logic inside GitHub API client

## What does this MR do?

Move the actual rate limiting logic to GitHub API to clean the code inside the GitHub importer, and avoid code duplication.

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

No there aren't.

## Why was this MR needed?

Avoid code duplication to handle API rate limit in every call to the GitHub API.

## What are the relevant issue numbers?

There are none.

## Screenshots (if relevant)

Not relevant.

See merge request !4552
2016-06-10 10:34:19 +00:00
Douwe Maan 16bd4e5668 Merge branch 'master' into workhorse-helpers 2016-06-10 12:28:04 +02:00
Grzegorz Bizon 5abfc7fa71 Define ci entry accessor instead of method_missing 2016-06-10 11:32:49 +02:00
Grzegorz Bizon 12080ba150 Simplify new ci config entry class interface 2016-06-10 11:26:03 +02:00
Grzegorz Bizon 828a15bccd Rename method used to allow node in Ci config 2016-06-10 10:49:47 +02:00
Grzegorz Bizon 51046dd226 Merge branch 'master' into refactor/ci-config-add-global-entry
* master: (147 commits)
  Minor MR comment fixes.
  Update CHANGELOG for 8.8.4 and 8.8.5
  Properly quote table name in Rake task for MySQL and PostgreSQL compatibility
  Checks based on whether data is loaded not undefined
  Checks for undefined when inserting autocomplete into textarea
  Ignore frequent emojis in search.
  Fixed tests
  CHANGELOG
  Improved the UX of issue & milestone date picker
  Change date format to be non zero padded in order to fix failing test
  Update method name for better understanding
  Add tests for dates on tooltips
  Fix local timeago on user dashboard
  Update CHANGELOG
  Toggling a task in a description with mentions doesn't creates a Todo
  Update CHANGELOG
  Fixed failing label subscribe test
  Tests update
  Updated subscribe icon
  Fixed failing tests
  ...
2016-06-10 10:49:07 +02:00
Douglas Barbosa Alexandre cef3fd2899 Wrap all rate limiting logic inside GitHub API client 2016-06-09 12:43:06 -03:00
Fatih Acet d866faf251 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into award-emoji-fixes 2016-06-09 16:11:07 +03:00
Grzegorz Bizon d7e1251161 Rename method that returns allowed nodes in Ci config 2016-06-09 14:59:59 +02:00
Grzegorz Bizon 99ee39bf6c Add comments to new CI config classes and modules 2016-06-09 13:15:54 +02:00
Douwe Maan 30ee4ea665 Merge branch 'saml-ldap-link-flow' into 'master'
Adjust the SAML control flow to allow LDAP identities to be added to an existing SAML user.

## What does this MR do?

It correctly lets an existing SAML user to add their LDAP identity automatically at login.

## Why was this MR needed?

A customer had issues with the `auto_link_ldap_user` feature. The flow was not working if there was an account with a SAML identity, but no LDAP identity. GitLab would pick up the correct LDAP person, but due to the order of the flow, that LDAP person was never associated with the user.

## What are the relevant issue numbers?

Fixes #17346 

/cc @dblessing @balameb @stanhu 

See merge request !4498
2016-06-09 10:48:31 +00:00
Grzegorz Bizon 20ccd4465b Do not require Ci config node to have a hash value 2016-06-09 12:35:24 +02:00
Grzegorz Bizon 6a319fd287 Make it possible configure Ci entry description 2016-06-09 10:53:56 +02:00
Grzegorz Bizon d9d5042fd9 Extract method that composes new Ci config entry 2016-06-09 10:28:44 +02:00
Grzegorz Bizon 33cd090b93 Move new Ci config configurable DSL to concern 2016-06-09 10:08:49 +02:00
Fatih Acet 92af60c244 Move award_menu_url variable into gon object. 2016-06-09 03:37:40 +03:00
Patricio Cano 9282810fb7 Syntax fixes and better logging around the `ldap_person` method. 2016-06-08 18:09:43 -05:00
Sean McGivern 40b6d9064a Allow custom text on 'almost there' page
Add a new application setting, after_sign_up_text. This is text to be
rendered as Markdown and shown on the 'almost there' page after a user
signs up, but before they've confirmed their account.

Tweak the styles for that page so that centered lists look reasonable.
2016-06-08 19:08:53 +01:00
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 a9857f8c2f Add send_git_diff helper 2016-06-08 14:30:15 +02: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
Grzegorz Bizon 48a59c1a8b Rename BeforeScript to Script in new Ci config 2016-06-08 13:22:39 +02:00
Grzegorz Bizon 5065612a0a Add minor improvements in new Ci config design 2016-06-08 13:01:44 +02:00
Grzegorz Bizon 87fe50f2a0 Delegate Ci config entry value to single method 2016-06-08 12:32:56 +02:00
Grzegorz Bizon 2b48da22ca Merge branch 'master' into refactor/ci-config-add-global-entry
* master: (285 commits)
  Bump recaptcha gem to 3.0.0 to remove deprecated stoken support
  Load knapsack in Rakefile only when is bundled
  Add License Finder information to contribution acceptance criteria.
  Add LGPLv2 to license whiltelist
  Instrument `RepositoryCheck::SingleRepositoryWorker` manually
  Bump nokogiri to 1.6.8
  Fix alignment of wiki top area
  Update charcoal theme colors
  Update nav link font size and spacing; fix hamburger icon
  Fix control btn position
  Remove todos count tests in nav
  Test impersonation using img data attribute instead of username
  Implement compact side nav
  Fix knapsack for master
  Align links and tabs
  Add scrolling tabs to code subnav
  Finish styling sub nav
  Updated colors
  Fixed failing tests
  CHANGELOG item
  ...

Conflicts:
	lib/gitlab/ci/config.rb
	spec/lib/gitlab/ci/config_spec.rb
2016-06-08 11:38:56 +02: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
Patricio Cano c593154cb4 Moved `find_or_create_ldap_user` method to parent class and added logging. 2016-06-07 11:21:20 -05: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 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
Grzegorz Bizon 70bda3e89b Implement script in Ci config and use in legacy one 2016-06-07 14:23:47 +02:00
Grzegorz Bizon c2d6d61dac Add DSL for adding nodes in Ci config interface 2016-06-07 13:20:07 +02: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 df25c19699 Use Ci config validation helpers only where needed 2016-06-07 12:58:32 +02:00
Grzegorz Bizon 5ef104df59 Improve Ci config loader by changing method signature 2016-06-07 12:53:46 +02:00
Grzegorz Bizon 6bd67f5212 Do not process new Ci config entry when invalid 2016-06-07 12:48:26 +02:00
Grzegorz Bizon e8f995ef26 Pass root Ci config entry to each subsequent entry 2016-06-07 12:13:22 +02:00
Grzegorz Bizon 69a3755c5a Add Ci config entry that implements Null Object 2016-06-07 11:58:02 +02:00
Grzegorz Bizon b95c60a071 Do not process Ci config node when node is a leaf 2016-06-07 11:26:39 +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
Patricio Cano 7038440e34 Adjust the SAML control flow to allow LDAP identities to be added to an existing SAML user. 2016-06-06 18:47:49 -05: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
Grzegorz Bizon 940763e0e7 Use CI config errors from new processor in legacy one 2016-06-06 20:56:58 +02:00
Douglas Barbosa Alexandre 67c02edccf Move create! method from formatters to the BaseFormatter 2016-06-06 14:26:28 -03:00
Rémy Coutable 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
Douwe Maan 8c3ba8d6c9 Add workhorse controller and API helpers 2016-06-06 13:16:30 +02:00
Grzegorz Bizon a3c0745514 Collect errors from all nodes in new CI config 2016-06-06 11:59:25 +02:00
Grzegorz Bizon 6dbd1c86a8 Validate new before script CI configuration entry 2016-06-06 11:33:45 +02:00
Kamil Trzcinski 7ad7e10fee Merge remote-tracking branch 'origin/master' into rename-ci-commit 2016-06-06 11:20:17 +02:00
Grzegorz Bizon 251dd571df Extract CI config validation helpers to mixin 2016-06-06 11:05:15 +02:00
Grzegorz Bizon 8048dcc8e6 Implement CI configuration nodes tree processing 2016-06-06 10:43:11 +02:00
Grzegorz Bizon 7f2f683eeb Rename ci config module that holds nodes to Node 2016-06-06 09:24:16 +02:00
Grzegorz Bizon 6609589b93 Add ci config global and before_script entries 2016-06-06 09:05:00 +02:00
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