Commit Graph

427 Commits

Author SHA1 Message Date
bugagazavr 548f182814 Added X-GitLab-Event header for web hooks 2015-04-25 21:31:52 +03:00
Douwe Maan 8ed7ac9d44 Use project.commit convenience method. 2015-04-24 12:29:36 +02:00
Douwe Maan 84a1590252 Let commit model know about its project. 2015-04-24 12:29:36 +02:00
Douwe Maan 7d98c8842d Move import data out of project so it doesn't take ages to load. 2015-04-17 14:49:00 +02:00
Douwe Maan 63b21945d2 Merge branch 'google-code-import' into 'master'
Import projects from Google Code.

Resolves #1257.

Issue import logic almost entirely taken from https://gitlab.com/o9000/google-code-to-gitlab ( ♥️ @o9000).

### To do

- [x] List projects from Google Takeout file
- [x] Import Git repository
- [x] Import issues
- [x] Link to correct attachment URL (https://code.google.com/p/support-tools/issues/detail?id=50)
- [x] Handle deleted attachments
- [x] Handle blockedOn attribute
- [x] Add directions on how to get data from Google Takeout

### Import instructions

![Screen_Shot_2015-04-03_at_16.02.21](https://gitlab.com/gitlab-org/gitlab-ce/uploads/4a87038035fbad9441cf613b8cdcc690/Screen_Shot_2015-04-03_at_16.02.21.png)

### Imported issue

![Screen_Shot_2015-04-03_at_16.25.49](https://gitlab.com/gitlab-org/gitlab-ce/uploads/b2c2eaf5ecfcf57b3c48511eb5d26db4/Screen_Shot_2015-04-03_at_16.25.49.png)

See merge request !471
2015-04-15 06:53:42 +00:00
Dmitriy Zaporozhets 8d9d63b250 Merge branch 'arbitrary-local-repo-import' into 'master'
Prevent arbitary local repos from being imported.

Fixes gitlab/gitlab-ee#263.

See merge request !1763
2015-04-12 10:21:15 +00:00
Robert Speicher 307962a046 Rename last uses of Buildbox to Buildkite 2015-04-11 14:05:22 -04:00
Douwe Maan cebb74a0c0 Fix project import URL regex to prevent arbitary local repos from being imported. 2015-04-11 11:37:58 +02:00
Douwe Maan 7b5bc32cad Allow projects to be imported from Google Code. 2015-04-03 15:29:27 +02:00
Douwe Maan dfe0f9eedf Use more specific regexes. 2015-03-27 11:09:29 +01:00
Dmitriy Zaporozhets 63d0bf1f5e Fix external wiki service 2015-03-17 22:59:45 -07:00
Dmitriy Zaporozhets 52acd2b45c Merge branch 'external_wiki' into 'master'
Add support for external wikis

## What does this MR do?
This MR adds the possibility to replace the link to the internal wiki of gitlab with a custom link.
Currently this is realised as a service.

## What Use Case does this MR solve?
In my Company we already have a wiki System (Confluence).
We have a policy to use the existing wiki, so we can't switch to the internal wiki Gitlab provides.
This currently only leaves us two choices:
1. Disable the gitlab wiki. That means we completly loose the connection between wiki and code from the gitlab ui.
2. Create a simple wiki page with a link to our external wiki and hope that no one uses the internal one.

Both solutions are not really good.
So what can be done to improve the situation while making it as easy as possible for new developers to access both, wiki and gitlab?
Replacing the wiki link kinda like the JIRA integration replaces the issues link looks like a good first step to me. :)
This can probably be extended later to completly prevent access to the internal wiki (currently that's still possible if you know the link) or maybe to check if the link really points to a wiki.

## Screenshot:
![external_wiki_service](https://gitlab.com/uploads/gitlab-org/gitlab-ce/89b27cf068/external_wiki_service.png)

See merge request !291
2015-03-18 02:00:36 +00: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 e97cdb042d Remove old team scopes. 2015-03-15 13:50:38 +01:00
Douwe Maan 31fc73f0a9 Use `project_member` instead of `team_member`. 2015-03-15 13:50:38 +01:00
Hannes Rosenögger 7ff9c8229d Add a service to support external wikis 2015-03-12 19:13:51 +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
Vinnie Okada cacac147de Move restricted visibility settings to the UI
Add checkboxes to the application settings page for restricted
visibility levels, and remove those settings from gitlab.yml.
2015-03-07 13:11:08 -07:00
Stan Hu 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
Aorimn f84b7eef3f Add Irker service
Irker is a gateway which sends IRC messages on git updates. This new
service provides an interface to this gateway, integrated in Gitlab, for
each updates.
As per the guidelines, this commit adds the new feature in the
CHANGELOG, tests and documentation.

See http://www.catb.org/esr/irker/
2015-03-01 20:51:03 +01:00
sue445 51abeaa1bc Expose avatar_url in projects API
* Impl Project#avatar_url
* Refactor ApplicationHelper: Use Project#avatar_url
* Update changelog
2015-03-01 10:13:01 +09:00
Dmitriy Zaporozhets 0d884ff2b1 Merge branch 'extend_markdown_upload' into 'master'
Generalizes image upload in drag and drop in markdown to all files

From https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/265 by Hannes Rosenögger.

- [x] Rebase on master when !1553 is merged in

See merge request !1530
2015-02-25 23:36:03 +00:00
Dmitriy Zaporozhets a52529f9b6 Merge branch 'bitbucket-import'
Conflicts:
	app/views/import/gitorious/status.html.haml
	db/schema.rb
2015-02-25 09:21:45 -08:00
Douwe Maan 5f7a3e1bbd Merge branch 'master' into extend_markdown_upload
# Conflicts:
#	app/controllers/files_controller.rb
2015-02-25 11:59:25 +01:00
Douwe Maan ad6d623234 Add Bitbucket importer. 2015-02-24 15:07:24 +01: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
Marco Wessel d4bfdd34ba use update_column and set to created_at like elsewhere 2015-02-23 04:03:12 +01:00
Marco Wessel b19b8c679a Give last_activity_at a default value so it will always be set 2015-02-23 03:36:21 +01:00
Douwe Maan 4ef6ffaad3 Split up AttachmentUploader. 2015-02-20 15:19:50 +01:00
Dmitriy Zaporozhets 8184a65644 Revert "Fix broken access control and refactor avatar upload"
This reverts commit 7d5f86f6cb.
2015-02-19 08:57:35 -08:00
Hannes Rosenögger 7d5f86f6cb Fix broken access control and refactor avatar upload
This commit moves the note folder from
/public/uploads/note
to
/uploads/note
and changes the uploader accordingly.
Now it's no longer possible to avoid the access control by modifing the url.
The Avatar upload has been refactored to use an own uploader as well
to cleanly seperate the two upload types.
2015-02-16 20:10:15 +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
Marin Jankovski 9f33898f7a All services can have templates. 2015-02-12 09:19:55 -08:00
Marin Jankovski 6b4ddf2cc1 Add admin services templates. 2015-02-11 17:55:33 -08:00
Marin Jankovski 00c7d533a0 Default issue tracker fix for creating default issue service. 2015-02-09 14:33:47 -08:00
Dmitriy Zaporozhets 0a34f2dcb5 Merge pull request #8580 from j0k3r/asana
Add Asana service
2015-02-08 01:12:41 -08:00
Dmitriy Zaporozhets c5be267e40 Refactor issuable sorting a bit 2015-02-05 20:21:21 -08:00
Dmitriy Zaporozhets bbca6a0abd Refactor sorting in project 2015-02-05 19:15:05 -08:00
Dmitriy Zaporozhets 62ed1c537e Explicitly define ordering in models using default_scope 2015-02-05 14:20:55 -08:00
Dmitriy Zaporozhets 0e2fcb68d7 Disable project path blacklist
Because since project always belongs to namespace it dont need such
strict restrictions any more
2015-02-04 15:23:38 -08:00
Dmitriy Zaporozhets cc39bca3fa Rubocop: Style/AlignHash enabled 2015-02-02 21:15:44 -08:00
Dmitriy Zaporozhets 4f1d1fc51b Convert hashes to ruby 1.9 style 2015-02-02 19:30:09 -08:00
Dmitriy Zaporozhets c0acb28c4e Annotate models 2015-02-02 10:24:40 -08:00
Jeremy b4d9ceb26f Add Asana service
Also add ability to render "service.help" in markdown
2015-02-02 09:59:42 +01:00
Marin Jankovski 68f7302474 Add a scope for visible services, code styling changes for easier readability. 2015-01-28 14:25:55 -08:00
Marin Jankovski 537cd66d7e Add gitlab internal issue tracker service. 2015-01-28 09:28:17 -08:00
Marin Jankovski 0da59cb55b Merge branch 'master' into move_external_issue_tracker_away_from_yml_config
Conflicts:
	app/models/project.rb
	spec/models/project_spec.rb
2015-01-26 22:12:53 -08:00
Marin Jankovski 33913f9b8f Make issue tracker service fields required. 2015-01-26 22:08:27 -08:00
Marin Jankovski 65e700472b Update the issue tracker attribute on issue tracker change. 2015-01-26 11:39:32 -08:00
Hannes Rosenögger 70c44a0da2 Fix tests, merge conflicts, some minor issues and make the project avatar feature mergable 2015-01-24 18:51:16 +01:00