Commit Graph
703 Commits
Author SHA1 Message Date
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
Jacob Vosmaer 64d8a38b54 Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into git-archive-refactor 2016-02-17 15:25:57 +01:00
Yorick Peterse b1203108b0 Flush all repository caches when deleting a repo
This ensures that _all_ caches (including any caches normally only
flushed under certain conditions) are flushed whenever a project is
removed. Because cache keys are based on project namespaces (excluding
IDs) not doing so could result in a newly created project re-using old
caches (if the project was re-created using the same name).
2016-02-17 11:38:18 +01:00
Jacob Vosmaer a0ccb0731b Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into git-archive-refactor 2016-02-17 11:30:42 +01:00
James Lopez 5255a54df9 refactored some stuff based on MR feedback 2016-02-17 10:42:59 +01:00
Douwe Maan 42d088fcb1 Merge branch 'fix/cross-reference-notes-forks' into 'master'
Fix cross reference notes  on forks

Updates `cross_reference_exists?` to match on commit only.

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

See merge request !2731
2016-02-16 11:47:46 +00:00
James Lopez 11913a762a updated system note service and spec based on feedback 2016-02-16 09:01:56 +01:00
James Lopez 20e79f714a refactored GitPushService and updated spec 2016-02-15 15:51:00 +01:00
Douwe Maan 31c8dbc96f Merge branch 'fix-duplicate-hook-notifications' into 'master'
Fix duplicated branch creation/deletion Web hooks/service notifications when using Web UI

Similar to 423d2d6, except duplicates occurred only if a Web service (e.g. Slack) were
configured.

When deleting a branch, this is what was happening:

    1. DeleteBranchService calls execute_hooks and execute_services
    2. The call to repository.rm_branch triggers the GitHooksService.
    3. This, in turn, calls GitPushService and then calls the same hooks/services again.

5145706 now makes it no longer necessary for DeleteBranchService and CreateBranchService to execute
the branch hooks/services. Note that tags behave differently in GitTagPushService and GitPushService
is not called.

Closes #10330

See merge request !2763
2016-02-12 18:11:01 +00:00
James Lopez 4089be8fed woo hoo - getting there with the cross-reference issue. Should fix the problem and updated spec 2016-02-12 18:01:47 +01:00
James Lopez a5b011c9d8 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/cross-reference-notes-forks 2016-02-12 12:21:04 +01:00
James Lopez 83a81ffc5d typo 2016-02-12 09:16:19 +01:00
James Lopez 77d2aeabec attempt to reduce code complexity on GitPushService#execute 2016-02-11 12:50:27 +01:00
Grzegorz Bizon 28c4c949a5 Improve CI status badge implementation 2016-02-11 10:29:14 +01:00
James Lopez 3753c1e03e Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/cross-reference-notes-forks 2016-02-10 14:56:27 +01:00
Yorick Peterse 2ce0d06389 Smarter flushing of branch statistics caches
Instead of flushing the behind/ahead counts for all branches upon every
push we now only flush the cache of branches that actually need to have
these statistics recalculated. There are now basically 2 scenarios and
their effects:

1. A user pushes a commit to the default branch, this results in the
   cache being flushed for all branches.
2. A user pushes to a non default branch, this results in _only_ the
   cache for that branch being flushed.

The existing code (Repository#expire_cache) remains backwards compatible
with the previous behaviour, the new behaviour is only applied when a
branch name is passed as an argument. This ensures that when for example
a project is deleted the cache for all branches is flushed.
2016-02-09 17:17:56 +01:00
Stan Hu 4603e57147 Fix duplicated branch creation/deletion Web hooks/service notifications when using Web UI
Similar to 423d2d6, except duplicates occurred only if a Web service (e.g. Slack) were
configured.

When deleting a branch, this is what was happening:

    1. DeleteBranchService calls execute_hooks and execute_services
    2. The call to repository.rm_branch triggers the GitHooksService.
    3. This, in turn, calls GitPushService and then calls the same hooks/services again.

5145706 now makes it no longer necessary for DeleteBranchService and CreateBranchService to execute
the branch hooks/services. Note that tags behave differently in GitTagPushService and GitPushService
is not called.

Closes #10330
2016-02-09 06:22:49 -08:00
Yorick Peterse 9a99d8e49d Cache various Repository Git operations
This caches the output of the following methods:

* Repository#empty?
* Repository#has_visible_content?
* Repository#root_ref

The cache for Repository#has_visible_content? is flushed whenever a
commit is pushed to a new branch or an existing branch is removed.
The cache for Repository#root_ref is only flushed whenever a user
changes the default branch of a project. The cache for Repository#empty?
is never explicitly flushed as there's no need for it.
2016-02-08 15:40:19 +01:00
James Lopez 9b925d79c9 WIP - fix and spec for cross reference issue with forks 2016-02-04 18:36:16 +01:00
Stan HuandDouglas Barbosa Alexandre d20e75a8d8 Support Akismet spam checking for creation of issues via API
Currently any spam detected by Akismet by non-members via API will be logged
in a separate table in the admin page.

Closes #5612
2016-02-02 11:25:44 -02:00
Jacob Vosmaer 771f14b96e First version of "git archive" headers 2016-02-02 14:09:55 +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 c040323419 Move Gitlab::BitbucketImport::KeyDeleter to it's own importer 2016-01-26 10:56:22 -02:00
Douglas Barbosa Alexandre 6dd88e090e Extract Projects::ImportService service from RepositoryImportWorker 2016-01-25 22:58:30 -02:00
Douglas Barbosa Alexandre 096485ef65 Creator should be added as a master of the project on creation
This also enable a project creator to add themselves as a master of the
project.
2016-01-20 20:06:28 -02:00
Douglas Barbosa Alexandre 2ece1b774a Fix creator should be added as a master of the project on creation 2016-01-19 13:24:42 -02:00
Rémy Coutable 30a4f4c9e0 This will ensure previous assignee gets an email even if his notif level is "on mention" 2016-01-15 17:57:45 +01:00
Rémy Coutable 51266f41b3 Consider re-assign as a mention from a notification point of view
This will ensure new assignee gets an email even if his notif level is
"on mention".
2016-01-15 15:28:16 +01:00
Robert Speicher 65eae647a6 Merge branch 'backport-ee' into 'master'
Backport two commits from EE

Backport part of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/110

See merge request !2424
2016-01-14 18:39:49 +00:00
Douwe Maan 4d64a32c88 Merge branch 'feature/ldap-sync-edgecases' into 'master'
LDAP Sync blocked user edgecases

Allow GitLab admins to block otherwise valid GitLab LDAP users
(https://gitlab.com/gitlab-org/gitlab-ce/issues/3462)

Based on the discussion on the original issue, we are going to differentiate "normal" block operations to the ldap automatic ones in order to make some decisions when its one or the other.

Expected behavior:

- [x] "ldap_blocked" users respond to both `blocked?` and `ldap_blocked?`
- [x] "ldap_blocked" users can't be unblocked by the Admin UI
- [x] "ldap_blocked" users can't be unblocked by the API
- [x] Block operations that are originated from LDAP synchronization will flag user as "ldap_blocked"
- [x] Only "ldap_blocked" users will be automatically unblocked by LDAP synchronization
- [x] When LDAP identity is removed, we should convert `ldap_blocked` into `blocked`
 
Mockup for the Admin UI with both "ldap_blocked" and normal "blocked" users:
![image](/uploads/4f56fc17b73cb2c9e2a154a22e7ad291/image.png)

There will be another MR for the EE version.

See merge request !2242
2016-01-14 11:00:08 +00:00
Douwe Maan 255445c363 Param should be present, not just truthy 2016-01-14 11:30:28 +01:00
Dmitriy Zaporozhets 32a5b741c2 Merge branch 'add_username_to_user_system_hooks' of https://github.com/tbeadle/gitlabhq
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-01-13 10:12:30 +01:00
Dmitriy Zaporozhets 678ee247ee Merge pull request #9952 from tbeadle/user_id_in_member_system_hook
Include the user_id in user_*_team system hooks.
2016-01-13 10:09:37 +01:00
Kamil Trzcinski 31b66aa75e Generate builds when creating tag using web interface 2016-01-11 12:37:27 +01:00
Dmitriy Zaporozhets e04e957bd6 Merge branch 'fix-duplicate-branch-activity' of https://gitlab.com/stanhu/gitlab-ce 2016-01-11 10:17:27 +01:00
Jeroen Nijhof 706255b926 Merge gitlab.com:gitlab-org/gitlab-ce 2016-01-11 09:32:35 +01:00
Robert Speicher af68897acd Merge branch 'api-project-upload' into 'master'
Add API project upload endpoint

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

See merge request !2329
2016-01-08 20:29:43 +00:00
Gabriel Mazetto 47e4613f4a Code style fixes and some code simplified 2016-01-08 16:26:04 -02:00
Gabriel Mazetto ec67e9be1d Repair ldap_blocked state when no ldap identity exist anymore 2016-01-08 16:26:04 -02:00
Douwe Maan 0614793b38 DRY up upload and download services 2016-01-08 17:38:53 +01:00
Jeroen Nijhof 2c37ae2f0a Merge gitlab.com:gitlab-org/gitlab-ce 2016-01-08 13:22:30 +01:00
Stan Hu 423d2d621a Fix duplicated branch creation/deletion events when using Web UI
When deleting a branch, this is what was happening:

1. DeleteBranchService calls EventCreateService and creates an event.
2. The call to repository.rm_branch triggers the GitHooksService.
3. This, in turn, calls GitPushService and then calls EventCreateService again.

5145706c now makes it no longer necessary for DeleteBranchService and CreateBranchService to create an event.

Closes #4304
2016-01-08 00:37:41 -08:00
Tommy Beadle 1f64332e11 Include user_username in user_(add_to/remove_from)_(project/group) system hooks. 2016-01-07 12:54:54 -05:00
Tommy Beadle dada25d447 Include the username in user_create/destroy system hooks. 2016-01-07 12:54:35 -05:00
Douwe Maan 1886d727f7 Add API project upload endpoint 2016-01-07 13:37:14 +01:00
Tommy Beadle 4d41294d71 Include the user_id in user_*_team system hooks.
This fixes an issue where the user_id is not included in the data for
user_add_to_team and user_remove_from_team system hooks.  The documentation
already states that the user_id should be included.
2016-01-06 11:49:59 -05:00
Jeroen Nijhof 9b28220f88 Merge gitlab.com:gitlab-org/gitlab-ce 2016-01-06 14:55:44 +01:00
Douwe Maan fd91b48f24 Merge branch 'master' into milestone-ref 2016-01-05 16:40:23 +01:00
Stan Hu 93096247d8 Don't notify users twice if they are both project watchers and subscribers
Closes #4708
2016-01-04 15:01:52 -08:00