Commit Graph
134 Commits
Author SHA1 Message Date
Kamil Trzcinski 5b432e7671 Extend push_tag event to include tag message and last commit 2015-03-21 11:25:27 +01:00
Dmitriy Zaporozhets 9162e34bb0 Merge branch 'issue_subscription' into 'master'
Subscription to issue/mr

Fixes #1911 and #1909

![joxi_screenshot_1426601822159](https://dev.gitlab.org/gitlab/gitlabhq/uploads/53021bc5783271322ab2dfba7598eaa3/joxi_screenshot_1426601822159.png)

![joxi_screenshot_1426601836423](https://dev.gitlab.org/gitlab/gitlabhq/uploads/244ff360fbd6f30980f8dad699400814/joxi_screenshot_1426601836423.png)

See merge request !1702
2015-03-17 16:45:04 +00:00
Valery Sizov 1b437ec349 tests 2015-03-16 21:38:41 +02:00
Dmitriy Zaporozhets 648f38cd98 Merge branch 'fix-restricted-visibility' into 'master'
Restricted visibility levels - bug fix and new feature

This allows admin users to override restricted visibility settings when creating and updating projects and snippets, and moves the restricted visibility configuration from gitlab.yml to the web UI.  See #1903.

## Move configuration location

I added a new section to the application settings page for restricted visibility levels.  Each level has a checkbox, styled with Bootstrap to look like a toggle button.  A checked box means that the level is restricted.  I added a glowing text shadow and changed the background color for checked buttons because the default styles made it hard to distinguish between checked and unchecked.  This image shows the new section with the "Public" box checked:

![restricted_visibility_settings](https://dev.gitlab.org/Okada/gitlabhq/uploads/629562e4313f89b795e81c3bb0f95893/restricted_visibility_settings.png)

## Allow admins to override

To allow admin users to override the restricted visibility levels, I had to remove the `visibility_level` validation from the `Project` class.  The model doesn't know about the `current_user`, which should determine whether the restrictions can be overridden.  We could use the creator in the validation, but that wouldn't work correctly for projects where a non-admin user is the creator and an admin tries to change the project to a restricted visibility level.

The `Project::UpdateService` and `Project::CreateService` classes already had code to determine whether the current user is allowed to use a given visibility level; now all visibility level validation is done in those classes.  Currently, when a non-admin tries to create or update a project using a restricted level, these classes silently set the visibility level to the global default (create) or the project's existing value (update).  I changed this behavior to be more like an Active Model validation, where using a restricted level causes the entire request to be rejected.

Project and personal snippets didn't have service classes, and restricted visibility levels weren't being enforced in the model or the controllers.  The UI disabled radio buttons for restricted levels, but that wouldn't be difficult to circumvent.  I created the `CreateSnippetService` and `UpdateSnippetService` classes to do the same restricted visibility check that the project classes do.  And since I was dealing with snippet visibility levels, I updated the API endpoints for project snippets to allow users to set and update the visibility level.

## TODO

* [x] Add more tests for restricted visibility functionality

cc @sytse @dzaporozhets

See merge request !1655
2015-03-16 17:49:46 +00:00
Douwe Maan 99f995755e Use group_member instead of users_group or membership. 2015-03-15 13:49:41 +01:00
Vinnie Okada ad0ca0499a Merge branch 'master' into fix-restricted-visibility
Conflicts:
	db/schema.rb
2015-03-14 10:49:11 -06:00
Vinnie Okada 13e9f4f334 Add tests for snippet services
Add Rspec tests for the new UpdateSnippetService and
CreateSnippetService classes.
2015-03-14 10:33:02 -06:00
Hannes Rosenögger 224e104d8d fix mass SQL statements on initial push
This commit disables process_commit_messages()
for the initial push to the default branch.
This fixes the mass SQL statements (~500000) that were executed during
the initial push of the linux kernel for example.
2015-03-09 12:52:45 +01:00
Vinnie Okada 285c534185 Allow admins to override restricted visibility
Allow admins to use restricted visibility levels when creating or
updating projects.
2015-03-08 16:10:05 -06:00
Dmitriy Zaporozhets 3cf4359b00 Merge branch 'mass-change-comments' into 'master'
Send notifications and leave system comments when bulk updating issues.

Resolves https://dev.gitlab.org/gitlab/gitlabhq/issues/1885.

See merge request !1646
2015-03-07 01:06:44 +00:00
Douwe Maan 663b3c968f Condense commits already in target branch when updating merge request source branch. 2015-03-06 18:09:00 +01:00
Douwe Maan b673d87227 Send notifications and leave system comments when bulk updating issues. 2015-03-06 15:01:13 +01:00
Stan HuandDouwe Maan afe5d7d209 Issue #595: Support Slack notifications upon issue and merge request events
1) Adds a DB migration for all services to toggle on push, issue, and merge events.

2) Upon an issue or merge request event, fire service hooks.

3) Slack service supports custom messages for each of these events. Other services
not supported at the moment.

4) Label merge request hooks with their corresponding actions.
2015-03-03 11:14:31 +01:00
Robert Speicher e53dd7526f Allow mass-unassigning of issues
Fixes #867

[ci skip]
2015-02-25 23:57:23 -05:00
Robert Speicher 8490a8ab2a Rename bulk_update_context_spec to bulk_update_service_spec 2015-02-25 23:55:53 -05:00
Douwe Maan 0283fff591 Merge branch 'master' into extend_markdown_upload
# Conflicts:
#	app/views/projects/issues/_form.html.haml
#	app/views/projects/merge_requests/_form.html.haml
#	app/views/projects/merge_requests/_new_submit.html.haml
#	app/views/projects/milestones/_form.html.haml
#	app/views/projects/notes/_form.html.haml
#	app/views/projects/wikis/_form.html.haml
#	config/routes.rb
#	spec/controllers/projects_controller_spec.rb
2015-02-24 14:54:39 +01:00
Douwe Maan d2ebdf664b Refactor. 2015-02-17 22:23:31 +01:00
Hannes RosenöggerandDouwe Maan 9729cc584f implement Project::UploadsController 2015-02-17 22:21:13 +01:00
Hannes RosenöggerandDouwe Maan ca504a77fe Fix tests 2015-02-17 22:20:44 +01:00
Hannes RosenöggerandDouwe Maan 9bf8480b4a Generalize the image upload in markdown
This commit generalizes the image upload via drag and drop so it supports all files.
It also adds access control for these files.
2015-02-17 22:20:44 +01:00
Vinnie Okada 76aad9b76e Upgrade to Rails 4.1.9
Make the following changes to deal with new behavior in Rails 4.1.2:

* Use nested resources to avoid slashes in arguments to path helpers.
2015-02-14 11:09:23 -07:00
Jeroen van Baarsen 0c4a70a306 Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 19:17:35 +01:00
Nikita Verkhovin 8681cb3137 Add labels notes 2015-02-08 22:35:41 +06:00
Marco Wessel ac7af45d89 Add test for default branch protection configuration 2015-01-31 09:10:26 +01:00
Marco Wessel 20e269cb92 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into configure-protection
Conflicts:
	CHANGELOG
	db/schema.rb
2015-01-30 00:16:24 +01:00
Dmitriy Zaporozhets 5e20cb82d7 Merge pull request #8652 from bladealslayer/feature/system_hook_for_groups
Added support for firing system hooks on group create/destroy and adding...
2015-01-27 12:49:24 -08:00
Boyan Tabakov 93bc2d5202 Added support for firing system hooks on group create/destroy and adding/removing users to group.
Added tests and updated docs. Also adding 'user_id' field in the hooks for adding/removing user from team.
2015-01-27 09:25:28 +02:00
Dmitriy Zaporozhets ed8c3e2d73 Remove unnecessary reload in test 2015-01-26 16:10:34 -08:00
Dmitriy Zaporozhets 9d85ea3acf Organize event order execution when update issue or mr 2015-01-25 22:49:05 -08:00
Dmitriy Zaporozhets 2b02852507 Add issue/mr participants to reasign events
Also refactor NotificationService a bit
2015-01-25 20:31:02 -08:00
Marco Wessel aad6ceaef9 Allow configuring protection of the default branch upon first push 2015-01-25 17:09:10 +01:00
jubianchi 4ffdb83e71 Add action property to merge request hook 2015-01-20 10:50:24 +01:00
Dmitriy Zaporozhets ee9849b736 Improve mr refresh service tests 2015-01-06 18:05:10 -08:00
Dmitriy Zaporozhets cf95736865 New feature: add 'Mention' notification level
It does disable all emails expect system one or when you was @mentioned

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-12-29 15:55:21 +02:00
Dmitriy Zaporozhets 58011d61c3 Merge branch 'prepare-fork-to-given-namespace' of https://gitlab.com/bkaindl/gitlab-ce into bkaindl/gitlab-ce-prepare-fork-to-given-namespace 2014-11-13 19:36:28 +02:00
Dmitriy Zaporozhets 2139e3519b Refactor merge request refresh logic on push
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-11-11 16:49:26 +02:00
Ciro Santilli c3be1517ae Factor '0' * 40 blank ref constants 2014-11-03 20:37:08 +01:00
Bernhard Kaindl 84fbd29351 transfer_service_spec: cleanup, merge common code, check against nil
- replace creation of group2 with the use of group without add_owner(user)
- fold TransferService calls into new test function transfer_project
  - remove currently not used (and not working) gitlab_shell stub
    (will submit testcase simulating failure in gitlab_shell separately)
- add checks against not be_nil (result.should be_false passes even if nil)
2014-10-04 12:29:24 +02:00
Bernhard Kaindl c44764f523 Prepare ForkService to support forking projects to given namespaces
Remove overload of BaseService.initialize, so initialize gains params,
which is used to pass the namespace (like e.g. in TransferService).

The namespace is checked for permission to create projects in it.
2014-10-03 11:52:29 +02:00
Marin Jankovski ab6459ad48 Add a simple spec test. 2014-09-29 16:07:53 +02:00
Dmitriy Zaporozhets 9ecd3bc6ce Improve git_push service specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-26 12:55:57 +03:00
Dmitriy Zaporozhets bdbadebe3e Fix adminarea and emails for new membership logic
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-15 10:57:02 +03:00
Dmitriy Zaporozhets c69b8e0459 Huge replace of old users_project and users_group references
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-14 19:32:51 +03:00
Lukas Erlacher 40fc4261f2 Add system hook for ssh key changes
Add system hook for ssh key create and destroy
Update and fix documentation
Update tests
2014-09-03 01:27:02 +02:00
Job van der Voort 68fd66c6e3 block visibility level restriction override in controller 2014-08-28 20:33:41 +02:00
Dmitriy Zaporozhets c5c906fe64 Fix tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-08-27 15:26:35 +03:00
Dmitriy Zaporozhets 2e497d8438 Prevent project stars duplication when fork project
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-08-25 12:19:52 +03:00
Dmitriy Zaporozhets ff5176d45a Fix git_push service specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-08-01 15:11:27 +03:00
Marin Jankovski 16068f3bfe Test if reopen notifications are sent. 2014-07-03 14:05:07 +02:00
Marin Jankovski 8a365f5d56 Fix tests because previous assignee didn't exist. 2014-07-02 13:32:53 +02:00