Commit Graph
91 Commits
Author SHA1 Message Date
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Alejandro Rodríguez 86359ec854 Refactor repository paths handling to allow multiple git mount points 2016-06-29 22:30:31 -04:00
Paco Guzman 208b18c956 Unify check branch name exist 2016-06-20 21:44:21 +02:00
Robert Speicher 1db4fd3ae7 Merge branch 'repo-check-require-push-events' into 'master'
Do not check repos without push events

Reduce false positives from automatic repository checks by skipping
projects without push events.

See merge request !4684
2016-06-17 19:14:43 +00:00
Kamil Trzcinski d63673d6df Make sure that artifacts_file is nullified after removing artifacts 2016-06-17 12:58:26 +02:00
Jacob Vosmaer d9f6d5dd59 Do not check repos without push events 2016-06-15 19:11:25 +02:00
Stan Hu bf4455d146 Merge branch 'dont-drop-stuck-builds' into 'master'
Don't fail builds for projects that are deleted when they are stuck

## What does this MR do?

Solves when dropping stuck connection.
```
Dropping stuck pending build 1545510 for runner 
NoMethodError: undefined method `origin_merge_requests' for nil:NilClass
    from /opt/gitlab/embedded/service/gitlab-rails/app/services/merge_requests/base_service.rb:50:in `merge_request_from'
    from /opt/gitlab/embedded/service/gitlab-rails/app/services/merge_requests/base_service.rb:57:in `each_merge_request'
    from /opt/gitlab/embedded/service/gitlab-rails/app/services/merge_requests/add_todo_when_build_fails_service.rb:5:in `execute'
    from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/instrumentation.rb:164:in `execute'
    from /opt/gitlab/embedded/service/gitlab-rails/app/models/commit_status.rb:51:in `block (2 levels) in <class:CommitStatus>'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/state_machines-0.4.0/lib/state_machines/eval_helpers.rb:79:in `call'
...
```

This happens, because that `default_scope` of `Projects` filters returns the projects that are not deleted, where `Ci::Build` doesn't take into account.


See merge request !4609
2016-06-15 02:54:19 +00:00
Kamil Trzcinski 60e0137c86 Fix specs 2016-06-14 11:38:34 +02:00
Kamil Trzcinski 33db51f915 Improve ExpireBuildArtifactsWorker spec 2016-06-13 18:18:24 +02:00
Kamil Trzcinski c534d2e89e Improve tests 2016-06-13 16:05:23 +02:00
Kamil TrzcinskiandPhil Hughes 421be01dab Improve design based on review 2016-06-13 11:09:19 +01:00
Kamil TrzcinskiandPhil Hughes e0673f82c9 Save database after erasing artifacts 2016-06-13 11:07:23 +01:00
Kamil TrzcinskiandPhil Hughes 1c60ff0b7a Test ExpireBuildArtifactsWorker 2016-06-13 11:07:23 +01:00
Kamil Trzcinski e6d66c4d3b Don't fail builds for projects that are deleted when they are stuck 2016-06-12 15:15:58 +02:00
Kamil Trzcinski 20c7144ed2 Rename all [ci_]commit to [ci_]pipeline in specs and features 2016-06-03 16:22:26 +02:00
Kamil Trzcinski 021d3810c3 Rename Ci::Commit to Ci::Pipeline and rename some of the ci_commit to pipeline 2016-06-02 16:59:04 +02:00
Robert Speicher 75739e54be Enable RSpec/NotToNot cop and auto-correct offenses
Also removes the note from the development/testing.md guide
2016-05-24 15:40:29 -04:00
Kamil Trzcinski b876993677 Fix creation of Ci::Commit object which can lead to pending, failed in some scenarios 2016-05-19 15:51:41 -05:00
Rubén Dávila 0c47b68d04 Mask credentials from URL when import of project has failed. 2016-05-18 21:16:36 -05:00
Sean McGivern 5f27e26bb4 Only generate repository push email once
The repository push email can be very expensive to generate, especially
with syntax-highlighted diffs. Instead of generating the email for each
recipient, generate one email object and reset the Message-Id and To
headers for each recipient. (Cloning would also be expensive in the case
of large emails, although probably not as bad as generating from
scratch.)
2016-05-11 09:16:01 +01:00
Douwe Maan 466f6874af Merge branch 'create-wikis-during-check' into 'master'
Initialize wikis on legacy projects during check

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/4173

Helps https://gitlab.com/gitlab-org/gitlab-ce/issues/15423

See merge request !3931
2016-05-04 14:10:49 +00:00
Jacob Vosmaer 9f85b7bc58 Initialize wikis on legacy projects during check 2016-04-26 16:56:14 +02:00
Jacob Vosmaer 3c0ab15a74 Do not fsck projects less than a day old
This should bring the number of false positives down.
2016-04-26 13:35:52 +02:00
Jacob Vosmaer 1394ccfe83 Destroy wikis uniformly 2016-04-18 11:03:53 +02:00
Jacob Vosmaer d7a4a2fe75 When a project wiki is disabled skip it for fsck 2016-04-18 10:52:01 +02:00
Jacob Vosmaer f07316f27c Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into auto-fsck 2016-04-13 17:38:59 +02:00
Jacob Vosmaer 6f6d2d0ad5 Use more conservative limits 2016-04-13 17:33:25 +02:00
Jacob Vosmaer 0f602be99f Clear repository check columns asynchronously 2016-04-13 15:56:05 +02:00
Jacob Vosmaer 525ab25ac8 Changes suggested by Robert 2016-04-12 18:15:15 +02:00
Jacob Vosmaer 97f4ffff1e Add a 'circuit breaker' for repo checks 2016-04-12 17:07:54 +02:00
Kamil Trzcinski 667d44c25c Fix high CPU usage when PostReceive receives refs/merge-requests/<id> 2016-04-11 12:46:19 +02:00
Jacob Vosmaer 5cf56e5647 Rename almost all the things 2016-04-06 13:47:05 +02:00
Jacob Vosmaer bf9526739b Rebase repo check MR 2016-04-04 17:23:43 +02:00
Rubén Dávila e6b5716785 Migrate Repository#local_branches from gitlab-ee.
This will help us to avoid posible merge conflicts when merging
gitlab-ce to gitlab-ee
2016-04-01 14:21:08 -05:00
Stan Hu 720ef51bd9 Check if repo exists before attempting to update cache info
Closes #14361
2016-03-27 06:17:49 -07:00
Yorick Peterse 68a4c98f50 Cache output of Repository#exists?
This caches the output of Repository#exists? in Redis while making sure
it's flushed properly when creating new repositories, deleting them,
etc.

For the ProjectWiki tests to work I had to make ProjectWiki#create_repo!
public as testing private methods in RSpec is a bit of a pain.
2016-03-19 21:54:08 +01:00
Zeger-Jan van de Weg 29a43373ce Specs for the DeleteUserService 2016-03-15 22:19:51 +01:00
Zeger-Jan van de Weg 8077a5f958 Clearify who deletes the user 2016-03-15 21:09:25 +01:00
Zeger-Jan van de Weg 4231cfeba5 Target right release, rebase got it wrong 2016-03-15 21:09:25 +01:00
Zeger-Jan van de Weg d249da1c16 Specs on force deleting of a user 2016-03-15 21:09:25 +01:00
Zeger-Jan van de Weg 4bcc097750 A worker deletes a user, so the request doesn't time out
Fixes #13261
2016-03-15 21:09:25 +01:00
ashleys 4cd9a5208c web hooks to webhooks 2016-03-10 14:48:29 -05:00
Yorick Peterse a9e0301c23 Expire caches after forking/importing a repository
This ensures the caches for Repository#empty? and
Repository#has_visible_content? are flushed after a repository has been
imported or forked.

Fixes gitlab-org/gitlab-ce#13505
2016-02-17 11:38:18 +01:00
Yorick Peterse 620e7bb3d6 Write to InfluxDB directly via UDP
This removes the need for Sidekiq and any overhead/problems introduced
by TCP. There are a few things to take into account:

1. When writing data to InfluxDB you may still get an error if the
   server becomes unavailable during the write. Because of this we're
   catching all exceptions and just ignore them (for now).
2. Writing via UDP apparently requires the timestamp to be in
   nanoseconds. Without this data either isn't written properly.
3. Due to the restrictions on UDP buffer sizes we're writing metrics one
   by one, instead of writing all of them at once.
2015-12-29 14:53:45 +01:00
Yorick Peterse db7bbadf95 Fixed styling of MetricsWorker specs 2015-12-28 11:34:11 +01:00
Yorick Peterse d67e2045a0 Drop empty tag values from metrics
InfluxDB throws an error when trying to store a list of tags where one
or more have an empty value.
2015-12-17 17:25:48 +01:00
Yorick Peterse 5142c61707 Cast values to strings before escaping them
This ensures that e.g. line numbers used in tags are first casted to
strings.
2015-12-17 17:25:48 +01:00
Yorick Peterse d0352e6604 Added specs for MetricsWorker 2015-12-17 17:25:48 +01:00
Gabriel Mazetto b5291f9599 Fixed Rubocop offenses 2015-12-15 00:53:52 -02:00
Kamil Trzcinski c4fa894de2 Fix specs 2015-12-10 16:16:34 +01:00