Commit Graph
179 Commits
Author SHA1 Message Date
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 TrzcinskiandPhil Hughes 1c60ff0b7a Test ExpireBuildArtifactsWorker 2016-06-13 11:07:23 +01:00
Kamil TrzcinskiandPhil Hughes ffe8dbde9b Move keep to ArtifactsController 2016-06-13 11:03:30 +01:00
Kamil TrzcinskiandPhil Hughes aea4041ce9 Allow to expire build artifacts 2016-06-13 11:01:19 +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
James LopezandRobert Speicher c9e8acd058 Update repository_import_worker.rb 2016-06-02 21:48:27 -04:00
James LopezandRobert Speicher 64c3905523 some refactoring and fixing spec 2016-06-02 21:48:25 -04:00
Stan Hu 47b60b6cfe Make EmailsOnPushWorker use Sidekiq mailers queue
EmailsOnPushWorker was using the default queue, which made it impossible
to prioritize MergeWorker and other key workers with a separate Sidekiq
process.
2016-05-31 15:06:08 -07:00
Douwe Maan 18ef054bc7 Merge branch '17464-backport-email-syntax-highlighting' into 'master'
Syntax-highlight diffs in push emails

![image](/uploads/8ecbabc65382214b8de63aae24f66cea/image.png)

Based on:
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/151



See merge request !4147
2016-05-19 21:12:53 +00: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 a9977f2b7a Syntax-highlight diffs in push emails
Based on:
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/151
2016-05-17 13:23:17 +01: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
Dmitriy Zaporozhets 161a419e3c Merge branch 'feature/system_hook_push' into 'master'
Added System Hooks for push and tag_push

Implements `push` and `tag_push` events for System Hooks.

They are based on Webhooks Events but without any deprecated item. We don't send commits too.
We are implementing this, to be used by Geo repository syncing (gitlab-org/gitlab-ee#76).

These hook events will be sent only when the respective configuration flags are set to true.
UI changes to admin screen will be made in another MR.

See merge request !3744
2016-04-19 09:34:47 +00:00
Gabriel MazettoandDmitriy Zaporozhets 2384bed4d8 Refactor GitTagPushService and fig tags_push system event hook 2016-04-19 11:00:30 +02:00
Jacob Vosmaer d7a4a2fe75 When a project wiki is disabled skip it for fsck 2016-04-18 10:52:01 +02:00
Robert Speicher 7ef35b9c61 Shut up, Rubocop 2016-04-14 12:28:48 -04: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 b60b9094d3 Always check the wiki too 2016-04-13 11:50:55 +02:00
Jacob Vosmaer a0bede92ed More code changes, thanks Robert 2016-04-13 11:12:43 +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
Jacob Vosmaer 318314154e Increase fsck lock timeout to 24 hours 2016-04-12 15:56:44 +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
Zeger-Jan van de Weg 1e7116b34d Exclude projects pending deletion from all results 2016-03-31 20:20:18 +02: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
Robert Speicher c790107854 Merge branch 'no-gc-retry' into 'master'
Do not retry "git gc"

To prevent 'git gc' timing out on a large repo and then bouncing
around in the retry queue.

See merge request !3266
2016-03-18 20:26:40 +00:00
Jacob Vosmaer 2057bc02a3 Do not retry "git gc" 2016-03-17 11:02:11 +01:00
Gabriel Mazetto f54bf00309 Back-porting PostReceive refactor made for EE 🍺 2016-03-17 00:24:12 -03:00
Zeger-Jan van de Weg b221d11a25 Add ability to delete a user with force 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
Jacob Vosmaer 1764e1b7cb Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00
Yorick Peterse ff28a7cc36 Moved cache expiration code to Repository hooks
This keeps all the cache expiration code in a single file/class instead
of spreading it all across the codebase.
2016-02-23 12:02:59 +01:00
Douwe Maan 52a8d1f3c6 Merge branch 'fix/gitpushservice-complexity-issue' into 'master'
Reduce code complexity on GitPushService#execute

Code complexity for gitlab-ce after this has been refactored:
```
  27.3: GitPushService#execute
```
This still needs to be merged into `gitlab-ee` presumably with conflicts... Perhaps we should create another issue for doing that?

I left the code sort of similar to what it was... If I could, I would have refactored most of the code into separate classes, etc. as it breaks probably all SOLID principles.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/13327


See merge request !2784
2016-02-18 09:33:21 +00: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
James Lopez 5255a54df9 refactored some stuff based on MR feedback 2016-02-17 10:42:59 +01:00
James Lopez 20e79f714a refactored GitPushService and updated spec 2016-02-15 15:51:00 +01:00
James Lopez 77d2aeabec attempt to reduce code complexity on GitPushService#execute 2016-02-11 12:50:27 +01:00
Josh Frye 91b9cbff8d First pass at deleting projects in the background. 2016-01-29 09:14:16 -05:00
Josh Frye f9218898ec [WIP] Background process note logic for #3948 2016-01-28 13:04:42 -05:00
Douglas Barbosa Alexandre 6dd88e090e Extract Projects::ImportService service from RepositoryImportWorker 2016-01-25 22:58:30 -02: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 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