Commit Graph
620 Commits
Author SHA1 Message Date
Yorick PeterseandRobert Speicher 7919366944 Merge branch 'refactor-rendering-redacting' into 'master'
Support for rendering/redacting multiple documents

See merge request !4828
2016-06-24 11:28:39 -04:00
Robert SpeicherandRobert Speicher 42cd3d3d27 Merge branch 'fix/import-sources' into 'master'
Add missing import source

I realised https://gitlab.com/projects/new is missing the `gitlab export` option, while this worked fine in GDK it seems that something was missing here.

This _should_ fix it unless I'm missing any other `import_sources` (did a grep and couldn't find it anywhere else though).

See merge request !4825
2016-06-21 12:06:40 -04:00
Robert SpeicherandRobert Speicher 85c10d46dd Merge branch '18810-nameerror-uninitialized-constant-mail-parsers-addressstruct' into 'master'
Avoid autoload issue such as 'Mail::Parsers::AddressStruct'

This is mostly a shot in the dark but at least it shouldn't break anything.

Fixes #18810.

See merge request !4793
2016-06-20 10:17:28 -04:00
Douwe MaanandRobert Speicher bf0294378e Merge branch 'feature/project-export' into 'master'
Export project functionality

This is a MR for the export functionality of https://gitlab.com/gitlab-org/gitlab-ce/issues/3050, which adds the ability to export single projects.

- [x] members
- DB data
  - [x] issues
  - [x] issue comments
  - [x] merge requests
  - [x] merge request diff
  - [x] merge request comments
  - [x] labels
  - [x] milestones
  - [x] snippets
  - [x] releases
  - [x] events
  - [x] commit statuses
  - [x] CI builds
- File system data
  - [x] Git repository
  - [x] wiki
  - [x] uploads
  - [ ] ~~CI build traces~~
  - [ ] ~~CI build artifacts~~
  - [ ] ~~LFS objects~~
- DB configuration
  - [x] services
  - [x] web hooks
  - [x] protected branches
  - [x] deploy keys
  - [x] CI variables
  - [x] CI triggers

See merge request !3114
2016-06-17 14:18:15 -04:00
Douwe MaanandRobert Speicher 40e8204b57 Merge branch '18474-missing-images-on-confirmation-email' into 'master'
Fix images in emails

Closes #18474. The confirmation email is actually the only one that uses the `image_tag` helper at the moment, but this will work for all of them:
```shell
$ ag image_tag -G mailer
app/views/layouts/devise_mailer.html.haml
13:              = image_tag('mailers/gitlab_header_logo.png', id: 'logo', alt: 'GitLab Wordmark')
24:                  = image_tag('mailers/gitlab_tanuki_2x.png', alt: 'GitLab Logo')
```

See merge request !4705
2016-06-16 13:28:06 -04:00
Douwe Maan 8249fdcd47 Merge branch '18451-track-new-redis-connections' into 'master'
Resolve "Track the number of new Redis connections per transaction"

## What does this MR do?

Add a new metric counter, `new_redis_connections`, that contains the number of calls to `Redis::Client#connect` in the current transaction.

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

Not sure. I tested this in kind of a brute-force way:

1. Add a debugger in the monkey-patched `connect` method.
2. With metrics enabled, start the app and load a page.
3. The first Redis connection is created by `Rack::Attack` and isn't in a transaction, but still works fine.
4. The second Redis connection is within a transaction (the page load), and increments the counter.
5. If I reload the page, neither debugger is hit.
6. If I use a Redis client and do `CLIENT KILL` on my two existing clients, then reload the page, I get 3 and 4 again.
7. If I disable metrics collection, the debugger never gets hit.

## Why was this MR needed?

We may have a Redis connection leak somewhere, so adding metrics will let us track this.

## What are the relevant issue numbers?

Closes #18451.

## Screenshots (if relevant)

Hahaha nope, not relevant.

## Does this MR meet the acceptance criteria?

- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- [ ] Tests
  - [ ] Added for this feature/bug
  - [ ] All builds are passing
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

cc @yorickpeterse 

See merge request !4649
2016-06-15 09:56:42 +00:00
Sean McGivern 3582c6aedc Track new Redis connections
Increment the counter `new_redis_connections` on each call to
`Redis::Client#connect`, if we're in a transaction.
2016-06-14 16:41:17 +01:00
Yorick Peterse f558bf0de4 Merge branch '18527-instrument-private-methods' into 'master'
Instrument private methods and instance private methods

See merge request !4639
2016-06-14 14:28:40 +00:00
Paco Guzman dadc531353 Instrument private/protected methods
By default instrumentation will instrument public,
protected and private methods, because usually
heavy work is done on private method or at least
that’s what facts is showing
2016-06-14 15:17:51 +02:00
Kamil Trzcinski 1b62b86fdd Merge remote-tracking branch 'origin/master' into artifacts-expire-date 2016-06-14 11:38:44 +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
Kamil Trzcinski f6de5937e3 Merge remote-tracking branch 'origin/master' into artifacts-expire-date 2016-06-13 16:05:30 +02:00
Kamil TrzcinskiandPhil Hughes cf9c5b54c6 Added documentation to artifacts expire 2016-06-13 11:09:19 +01:00
Kamil TrzcinskiandPhil Hughes 4e9e4e22af Enable exceptions on ChronicDuration 2016-06-13 11:03:30 +01:00
Kamil TrzcinskiandPhil Hughes ffe8dbde9b Move keep to ArtifactsController 2016-06-13 11:03:30 +01:00
Yorick Peterse ffd316483c Instrument all Banzai::ReferenceParser classes
Now that this code is no longer part of Banzai::Filter it needs to be
instrumented explicitly.
2016-06-13 12:03:25 +02:00
Kamil TrzcinskiandPhil Hughes aea4041ce9 Allow to expire build artifacts 2016-06-13 11:01:19 +01: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
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
Alejandro Rodríguez d485ec9f1c Instrument RepositoryCheck::SingleRepositoryWorker manually
This worker is called manually by `RepositoryCheck::BatchWorker` meaning it's not tracked automatically by the Sidekiq middleware.
2016-06-07 12:10:55 -04:00
Z.J. van de Weg 9d491712cf Merge branch 'master' into awardables 2016-06-03 15:20:11 +02:00
Jacob Vosmaer fea591e5c5 Rename finder to find_in_gitlab_or_ldap 2016-06-02 13:42:18 +02:00
Jacob Vosmaer 8299fc277d Merge branch 'master' into git-http-controller
Conflicts:
	config/routes.rb
2016-06-02 13:31:11 +02:00
Robert Speicher 7d33fba7af Merge branch 'upgrade-devise-two-factor' into 'master'
Upgrade devise, devise-two-factor, and attr_encrypted

Devise 4 includes support for Rails 5, working towards #14286. devise-async doesn't support Devise 4.0 and in 4.1 the bug that was blocking using Devise's built-in ActiveJob integration was fixed. So devise-async is removed. devise-two-factor 3.0.0 is required for Devise 4 support.

attr_encrypted and encryptor are optional but recommended upgrades for devise-two-factor 3.0.0. The mode and algorithm will need to be changed in order to update to attr_encrypted 4.x in the future.

See merge request !4216
2016-06-02 00:44:41 +00:00
Rémy Coutable 46ac3107a4 Merge branch 'issue_15557' into 'master'
Fix error 500 when sorting issues by milestone due date and filtering by labels

fixes #15557 

See merge request !4327
2016-06-01 08:42:36 +00:00
Felipe Artur 56f3b243ce Add leading comment space cop 2016-05-31 19:33:46 -03:00
Connor Shea d47b2b92c9 Upgrade devise and devise-two-factor, remove devise-async
Devise (3.5.4 => 4.1.1) Changelog:
https://github.com/plataformatec/devise/blob/master/CHANGELOG.md

devise-two-factor (2.0.1 => 3.0.0) Changelog:
https://github.com/tinfoil/devise-two-factor/blob/master/CHANGELOG.md

These are reliant on each other, so they have to be upgraded together.

devise-async is no longer necessary as Devise 4.1 fixes a bug with the
ActiveJob integration.
2016-05-30 13:51:21 -06:00
Robert Speicher e7586cfbdc Merge branch 'rubocop/enable-negatedif-style-cop' into 'master'
Enable Style/NegatedIf Rubocop cop

Favor `unless` over `if` for negative conditions (or control flow ||).

```ruby
# bad
do_something if !some_condition
# bad
do_something if not some_condition

# good
do_something unless some_condition
# good
some_condition || do_something
```

See #17478

See merge request !4355
2016-05-30 17:59:10 +00:00
Robert Speicher 6eaf327a57 Merge branch 'rubocop/enable-redundant-parentheses-cop' into 'master'
Enable Style/RedundantParentheses rubocop cop

Checks for parentheses that seem not to serve any purpose.

See #17478 

See merge request !4361
2016-05-30 17:20:56 +00:00
ZJ van de Weg cbd7801b3d Merge branch 'master' into awardables 2016-05-30 18:54:08 +02:00
Grzegorz Bizon c370dce01c Enable Style/RedundantParentheses rubocop cop
See #17478
2016-05-30 15:07:18 +02:00
Grzegorz Bizon 53bf080f67 Enable Style/SpaceBeforeComment rubocop cop
See #17478
2016-05-30 14:36:28 +02:00
Grzegorz Bizon a55e8f109f Enable Style/NegatedIf Rubocop cop
Favor `unless` over `if` for negative conditions
(or control flow ||).

See #17478
2016-05-30 13:53:25 +02:00
Yorick Peterse 9bdfc98242 Merge branch 'measure-proxy-timing' into 'master'
Measure proxy flight time

See merge request !4278
2016-05-26 17:05:26 +00:00
Jacob Vosmaer 5771114f9b Rename metric to 'rails queue duration' 2016-05-26 17:53:21 +02:00
Robert Speicher 8083bc234a Don't remove IDs via premailer
This makes it easier to debug style rules.
2016-05-25 16:56:06 -04:00
Jacob Vosmaer c049534da6 Align class name with field name 2016-05-25 14:55:23 +02:00
Jacob Vosmaer 897273d179 Couple ProxyTiming to Metrics middleware 2016-05-25 11:45:34 +02:00
Jacob Vosmaer cee07c5919 Measure proxy timing: needs influxdb code 2016-05-24 17:07:41 +02:00
Stan Hu d46e47a5b6 Revert "Merge branch 'issues/15127' into 'master'"
This reverts merge request !3647
2016-05-19 14:09:24 +00:00
Stan Hu 3656b5db07 Merge branch 'issues/15127' into 'master'
fix #15127 ActiveJob::DeserializationError thrown

`send_devise_notification` pre-maturely enqueued the task when the user instance
has not yet been committed into the database, causing a record-not-found in the
other sidekiq process.

`devise-async` has already been taking care of asynchronous mail sending, we just
need to run it inside queue `mailers` instead of `mailer` to enable it.

The implementation of `devise-async` enqueues the task in `after_commit` hook
which is the right way to do it.

See merge request !3647
2016-05-19 06:12:34 +00:00
Fatih Acet a410c7afbf Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into awardables 2016-05-18 13:20:06 -05:00
Fatih Acet bb883387f9 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into awardables
# Conflicts:
#	app/controllers/projects/merge_requests_controller.rb
#	app/models/note.rb
#	db/schema.rb
#	spec/models/note_spec.rb
2016-05-18 13:05:53 -05:00
Kamil Trzcinski 2bea20b8ef Merge branch 'master' into docker-registry-view 2016-05-18 12:29:50 -05:00
Kamil Trzcinski 0a6c3494b0 Fix rubocop offenses 2016-05-16 23:32:55 -05:00
Yorick Peterse b933367ab3 Instrument all Grape API helpers 2016-05-17 00:16:49 +02:00
Kamil Trzcinski 89644edc4e Bring back path to registry settings 2016-05-16 17:15:38 -05:00
Kamil Trzcinski a26ec8a106 Compact host and port 2016-05-16 09:51:15 -05:00
Kamil Trzcinski 623102d455 Use registry.port to construct the registry host 2016-05-16 09:48:39 -05:00
Kamil Trzcinski 4f1e0014a7 Simplify registry configuration 2016-05-14 14:03:41 -05:00