summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Nijhof <jeroen@jeroennijhof.nl>2016-01-08 17:25:09 +0100
committerJeroen Nijhof <jeroen@jeroennijhof.nl>2016-01-08 17:25:09 +0100
commite0436005af0d567391031ebbf546877f7f525731 (patch)
tree7a65d829d33043a0dadd7f8fcda910542e7d2406
parent2c37ae2f0a7612deb4bf93fb726c98cad60ca0aa (diff)
parentc1e974ed889dd31fbbddfa2daeb1a681043d5aa0 (diff)
downloadgitlab-ce-e0436005af0d567391031ebbf546877f7f525731.tar.gz
Merge gitlab.com:gitlab-org/gitlab-ce
-rw-r--r--CHANGELOG2
-rw-r--r--app/models/project_services/jira_service.rb7
-rw-r--r--config/routes.rb6
-rw-r--r--doc/api/tags.md20
-rw-r--r--doc/integration/README.md29
-rw-r--r--doc/integration/external-issue-tracker.md48
-rw-r--r--doc/integration/img/jira_issue_reference.png (renamed from doc/integration/jira_issue_reference.png)bin39942 -> 39942 bytes
-rw-r--r--doc/integration/img/jira_merge_request_close.pngbin0 -> 111150 bytes
-rw-r--r--doc/integration/img/jira_project_name.png (renamed from doc/integration/jira_project_name.png)bin60598 -> 60598 bytes
-rw-r--r--doc/integration/img/jira_service.png (renamed from doc/integration/jira_service.png)bin59082 -> 59082 bytes
-rw-r--r--doc/integration/img/jira_service_close_issue.png (renamed from doc/integration/jira_service_close_issue.png)bin88433 -> 88433 bytes
-rw-r--r--doc/integration/img/jira_service_page.pngbin0 -> 35496 bytes
-rw-r--r--doc/integration/img/jira_workflow_screenshot.png (renamed from doc/integration/jira_workflow_screenshot.png)bin121534 -> 121534 bytes
-rw-r--r--doc/integration/jira.md138
-rw-r--r--doc/integration/jira_service_page.pngbin162449 -> 0 bytes
-rw-r--r--doc/integration/redmine_configuration.pngbin118752 -> 0 bytes
-rw-r--r--doc/integration/redmine_service_template.pngbin198077 -> 0 bytes
-rw-r--r--doc/project_services/img/redmine_configuration.pngbin0 -> 21061 bytes
-rw-r--r--doc/project_services/img/services_templates_redmine_example.pngbin0 -> 17351 bytes
-rw-r--r--doc/project_services/project_services.md9
-rw-r--r--doc/project_services/redmine.md21
-rw-r--r--doc/project_services/services_templates.md25
-rw-r--r--lib/api/tags.rb21
-rw-r--r--lib/gitlab/current_settings.rb3
-rw-r--r--spec/requests/api/tags_spec.rb21
-rw-r--r--spec/routing/project_routing_spec.rb1
26 files changed, 251 insertions, 100 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a17a9be3cc7..687373c1ff4 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -16,6 +16,7 @@ v 8.4.0 (unreleased)
- Add "Frequently used" category to emoji picker
- Add CAS support (tduehr)
- Add link to merge request on build detail page
+ - Fix: Problem with projects ending with .keys (Jose Corcuera)
- Revert back upvote and downvote button to the issue and MR pages
- Swap position of Assignee and Author selector on Issuables (Zeger-Jan van de Weg)
- Add system hook messages for project rename and transfer (Steve Norman)
@@ -28,6 +29,7 @@ v 8.4.0 (unreleased)
- Properly set task-list class on single item task lists
- Add file finder feature in tree view (Kyungchul Shin)
- Ajax filter by message for commits page
+ - API: Add support for deleting a tag via the API (Robert Schilling)
v 8.3.3 (unreleased)
- Get "Merge when build succeeds" to work when commits were pushed to MR target branch while builds were running
diff --git a/app/models/project_services/jira_service.rb b/app/models/project_services/jira_service.rb
index a1b77c61576..8a43a021819 100644
--- a/app/models/project_services/jira_service.rb
+++ b/app/models/project_services/jira_service.rb
@@ -40,15 +40,10 @@ class JiraService < IssueTrackerService
end
def help
- line1 = 'Setting `project_url`, `issues_url` and `new_issue_url` will '\
+ 'Setting `project_url`, `issues_url` and `new_issue_url` will '\
'allow a user to easily navigate to the Jira issue tracker. See the '\
'[integration doc](http://doc.gitlab.com/ce/integration/external-issue-tracker.html) '\
'for details.'
-
- line2 = 'Support for referencing commits and automatic closing of Jira issues directly '\
- 'from GitLab is [available in GitLab EE.](http://doc.gitlab.com/ee/integration/jira.html)'
-
- [line1, line2].join("\n\n")
end
def title
diff --git a/config/routes.rb b/config/routes.rb
index 505b198e222..3d5c70987c8 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -52,9 +52,6 @@ Rails.application.routes.draw do
API::API.logger Rails.logger
mount API::API => '/api'
- # Get all keys of user
- get ':username.keys' => 'profiles/keys#get_keys' , constraints: { username: /.*/ }
-
constraint = lambda { |request| request.env['warden'].authenticate? and request.env['warden'].user.admin? }
constraints constraint do
mount Sidekiq::Web, at: '/admin/sidekiq', as: :sidekiq
@@ -687,5 +684,8 @@ Rails.application.routes.draw do
end
end
+ # Get all keys of user
+ get ':username.keys' => 'profiles/keys#get_keys' , constraints: { username: /.*/ }
+
get ':id' => 'namespaces#show', constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ }
end
diff --git a/doc/api/tags.md b/doc/api/tags.md
index 085d387e824..17d12e9cc62 100644
--- a/doc/api/tags.md
+++ b/doc/api/tags.md
@@ -83,6 +83,26 @@ it will contain the annotation.
It returns 200 if the operation succeed. In case of an error,
405 with an explaining error message is returned.
+## Delete a tag
+
+Deletes a tag of a repository with given name. On success, this API method
+returns 200 with the name of the deleted tag. If the tag does not exist, the
+API returns 404.
+
+```
+DELETE /projects/:id/repository/tags/:tag_name
+```
+
+Parameters:
+
+- `id` (required) - The ID of a project
+- `tag_name` (required) - The name of a tag
+
+```json
+{
+ "tag_name": "v4.3.0"
+}
+```
## Create a new release
diff --git a/doc/integration/README.md b/doc/integration/README.md
index 2a9f76533b7..5edac746c7b 100644
--- a/doc/integration/README.md
+++ b/doc/integration/README.md
@@ -1,6 +1,7 @@
# GitLab Integration
-GitLab integrates with multiple third-party services to allow external issue trackers and external authentication.
+GitLab integrates with multiple third-party services to allow external issue
+trackers and external authentication.
See the documentation below for details on how to configure these services.
@@ -15,13 +16,25 @@ See the documentation below for details on how to configure these services.
- [Gmail actions buttons](gmail_action_buttons_for_gitlab.md) Adds GitLab actions to messages
- [reCAPTCHA](recaptcha.md) Configure GitLab to use Google reCAPTCHA for new users
-GitLab Enterprise Edition contains [advanced JIRA support](http://doc.gitlab.com/ee/integration/jira.html) and [advanced Jenkins support](http://doc.gitlab.com/ee/integration/jenkins.html).
+GitLab Enterprise Edition contains [advanced Jenkins support][jenkins].
## Project services
-Integration with services such as Campfire, Flowdock, Gemnasium, HipChat, Pivotal Tracker, and Slack are available in the form of a Project Service.
-You can find these within GitLab in the Services page under Project Settings if you are at least a master on the project.
-Project Services are a bit like plugins in that they allow a lot of freedom in adding functionality to GitLab, for example there is also a service that can send an email every time someone pushes new commits.
-Because GitLab is open source we can ship with the code and tests for all plugins.
-This allows the community to keep the plugins up to date so that they always work in newer GitLab versions.
-For an overview of what projects services are available without logging in please see the [project_services directory](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/app/models/project_services).
+Integration with services such as Campfire, Flowdock, Gemnasium, HipChat,
+Pivotal Tracker, and Slack are available in the form of a [Project Service][].
+You can find these within GitLab in the Services page under Project Settings if
+you are at least a master on the project.
+Project Services are a bit like plugins in that they allow a lot of freedom in
+adding functionality to GitLab. For example there is also a service that can
+send an email every time someone pushes new commits.
+
+Because GitLab is open source we can ship with the code and tests for all
+plugins. This allows the community to keep the plugins up to date so that they
+always work in newer GitLab versions.
+
+For an overview of what projects services are available without logging in,
+please see the [project_services directory][projects-code].
+
+[jenkins]: http://doc.gitlab.com/ee/integration/jenkins.html
+[Project Service]: ../project_services/project_services.md
+[projects-code]: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/app/models/project_services
diff --git a/doc/integration/external-issue-tracker.md b/doc/integration/external-issue-tracker.md
index 3e660cfba1e..3543a67dd49 100644
--- a/doc/integration/external-issue-tracker.md
+++ b/doc/integration/external-issue-tracker.md
@@ -1,44 +1,30 @@
# External issue tracker
-GitLab has a great issue tracker but you can also use an external issue tracker such as Jira, Bugzilla or Redmine. You can configure issue trackers per GitLab project. For instance, if you configure Jira it allows you to do the following:
+GitLab has a great issue tracker but you can also use an external one such as
+Jira or Redmine. Issue trackers are configurable per GitLab project and allow
+you to do the following:
-- the 'Issues' link on the GitLab project pages takes you to the appropriate Jira issue index;
-- clicking 'New issue' on the project dashboard creates a new Jira issue;
-- To reference Jira issue PROJECT-1234 in comments, use syntax PROJECT-1234. Commit messages get turned into HTML links to the corresponding Jira issue.
-
-![Jira screenshot](jira-integration-points.png)
-
-GitLab Enterprise Edition contains [advanced JIRA support](http://doc.gitlab.com/ee/integration/jira.html).
+- the **Issues** link on the GitLab project pages takes you to the appropriate
+ issue index of the external tracker
+- clicking **New issue** on the project dashboard creates a new issue on the
+ external tracker
## Configuration
-### Project Service
+The configuration is done via a project's **Services**.
-You can enable an external issue tracker per project. As an example, we will configure `Redmine` for project named gitlab-ci.
-
-Fill in the required details on the page:
+### Project Service
-![redmine configuration](redmine_configuration.png)
+To enable an external issue tracker you must configure the appropriate **Service**.
+Visit the links below for details:
-* `description` A name for the issue tracker (to differentiate between instances, for example).
-* `project_url` The URL to the project in Redmine which is being linked to this GitLab project.
-* `issues_url` The URL to the issue in Redmine project that is linked to this GitLab project. Note that the `issues_url` requires `:id` in the url. This id is used by GitLab as a placeholder to replace the issue number.
-* `new_issue_url` This is the URL to create a new issue in Redmine for the project linked to this GitLab project.
+- [Redmine](../project_services/redmine.md)
+- [Jira](jira.md)
### Service Template
-It is necessary to configure the external issue tracker per project, because project specific details are needed for the integration with GitLab.
-The admin can add a service template that sets a default for each project. This makes it much easier to configure individual projects.
-
-In GitLab Admin section, navigate to `Service Templates` and choose the service template you want to create:
-
-![redmine service template](redmine_service_template.png)
-
-After the template is created, the template details will be pre-filled on the project service page.
-
-NOTE: For each project, you will still need to configure the issue tracking URLs by replacing `:issues_tracker_id` in the above screenshot
-with the ID used by your external issue tracker. Prior to GitLab v7.8, this ID was configured in the project settings, and GitLab would automatically
-update the URL configured in `gitlab.yml`. This behavior is now depecated, and all issue tracker URLs must be configured directly
-within the project's Services settings.
+To save you the hassle from configuring each project's service individually,
+GitLab provides the ability to set Service Templates which can then be
+overridden in each project's settings.
-Support to add your commits to the Jira ticket automatically is [available in GitLab EE](http://doc.gitlab.com/ee/integration/jira.html).
+Read more on [Services Templates](../project_services/services_templates.md).
diff --git a/doc/integration/jira_issue_reference.png b/doc/integration/img/jira_issue_reference.png
index 15739a22dc7..15739a22dc7 100644
--- a/doc/integration/jira_issue_reference.png
+++ b/doc/integration/img/jira_issue_reference.png
Binary files differ
diff --git a/doc/integration/img/jira_merge_request_close.png b/doc/integration/img/jira_merge_request_close.png
new file mode 100644
index 00000000000..1e78daf105f
--- /dev/null
+++ b/doc/integration/img/jira_merge_request_close.png
Binary files differ
diff --git a/doc/integration/jira_project_name.png b/doc/integration/img/jira_project_name.png
index 5986fdb63fb..5986fdb63fb 100644
--- a/doc/integration/jira_project_name.png
+++ b/doc/integration/img/jira_project_name.png
Binary files differ
diff --git a/doc/integration/jira_service.png b/doc/integration/img/jira_service.png
index 1f6628c4371..1f6628c4371 100644
--- a/doc/integration/jira_service.png
+++ b/doc/integration/img/jira_service.png
Binary files differ
diff --git a/doc/integration/jira_service_close_issue.png b/doc/integration/img/jira_service_close_issue.png
index 67dfc6144c4..67dfc6144c4 100644
--- a/doc/integration/jira_service_close_issue.png
+++ b/doc/integration/img/jira_service_close_issue.png
Binary files differ
diff --git a/doc/integration/img/jira_service_page.png b/doc/integration/img/jira_service_page.png
new file mode 100644
index 00000000000..2b37eda3520
--- /dev/null
+++ b/doc/integration/img/jira_service_page.png
Binary files differ
diff --git a/doc/integration/jira_workflow_screenshot.png b/doc/integration/img/jira_workflow_screenshot.png
index 8635a32eb68..8635a32eb68 100644
--- a/doc/integration/jira_workflow_screenshot.png
+++ b/doc/integration/img/jira_workflow_screenshot.png
Binary files differ
diff --git a/doc/integration/jira.md b/doc/integration/jira.md
index 624601d0fac..de574d53410 100644
--- a/doc/integration/jira.md
+++ b/doc/integration/jira.md
@@ -1,14 +1,15 @@
# GitLab Jira integration
-GitLab can be configured to interact with Jira.
-Configuration happens via username and password.
-Connecting to a Jira server via CAS is not possible.
+GitLab can be configured to interact with Jira. Configuration happens via
+username and password. Connecting to a Jira server via CAS is not possible.
-Each project can be configured to connect to a different Jira instance, configuration is explained [here](#configuration).
-If you have one Jira instance you can pre-fill the settings page with a default template. To configure the template [see external issue tracker document](external-issue-tracker.md#service-template)).
-
-Once the project is connected to Jira, you can reference and close the issues in Jira directly from GitLab.
+Each project can be configured to connect to a different Jira instance, see the
+[configuration](#configuration) section. If you have one Jira instance you can
+pre-fill the settings page with a default template. To configure the template
+see the [Services Templates][services-templates] document.
+Once the project is connected to Jira, you can reference and close the issues
+in Jira directly from GitLab.
## Table of Contents
@@ -18,8 +19,11 @@ Once the project is connected to Jira, you can reference and close the issues in
### Referencing Jira Issues
-When GitLab project has Jira issue tracker configured and enabled, mentioning Jira issue in GitLab will automatically add a comment in Jira issue with the link back to GitLab. This means that in comments in merge requests and commits referencing an issue, eg. `PROJECT-7`, will add a comment in Jira issue in the format:
-
+When GitLab project has Jira issue tracker configured and enabled, mentioning
+Jira issue in GitLab will automatically add a comment in Jira issue with the
+link back to GitLab. This means that in comments in merge requests and commits
+referencing an issue, eg. `PROJECT-7`, will add a comment in Jira issue in the
+format:
```
USER mentioned this issue in LINK_TO_THE_MENTION
@@ -29,85 +33,117 @@ When GitLab project has Jira issue tracker configured and enabled, mentioning Ji
* `LINK_TO_THE_MENTION` Link to the origin of mention with a name of the entity where Jira issue was mentioned.
Can be commit or merge request.
+![example of mentioning or closing the Jira issue](img/jira_issue_reference.png)
-![example of mentioning or closing the Jira issue](jira_issue_reference.png)
-
+---
### Closing Jira Issues
-Jira issues can be closed directly from GitLab by using trigger words, eg. `Resolves PROJECT-1`, `Closes PROJECT-1` or `Fixes PROJECT-1`, in commits and merge requests.
-When a commit which contains the trigger word in the commit message is pushed, GitLab will add a comment in the mentioned Jira issue.
+Jira issues can be closed directly from GitLab by using trigger words, eg.
+`Resolves PROJECT-1`, `Closes PROJECT-1` or `Fixes PROJECT-1`, in commits and
+merge requests. When a commit which contains the trigger word in the commit
+message is pushed, GitLab will add a comment in the mentioned Jira issue.
-For example, for project named PROJECT in Jira, we implemented a new feature and created a merge request in GitLab.
+For example, for project named `PROJECT` in Jira, we implemented a new feature
+and created a merge request in GitLab.
-This feature was requested in Jira issue PROJECT-7. Merge request in GitLab contains the improvement and in merge request description we say that this merge request `Closes PROJECT-7` issue.
+This feature was requested in Jira issue `PROJECT-7`. Merge request in GitLab
+contains the improvement and in merge request description we say that this
+merge request `Closes PROJECT-7` issue.
-Once this merge request is merged, Jira issue will be automatically closed with a link to the commit that resolved the issue.
+Once this merge request is merged, the Jira issue will be automatically closed
+with a link to the commit that resolved the issue.
-![A Git commit that causes the Jira issue to be closed](merge_request_close_jira.png)
+![A Git commit that causes the Jira issue to be closed](img/jira_merge_request_close.png)
+---
-![The GitLab integration user leaves a comment on Jira](jira_service_close_issue.png)
+![The GitLab integration user leaves a comment on Jira](img/jira_service_close_issue.png)
+---
## Configuration
### Configuring JIRA
-We need to create a user in JIRA which will have access to all projects that need to integrate with GitLab.
-Login to your JIRA instance as admin and under Administration go to User Management and create a new user.
-As an example, we'll create a user named `gitlab` and add it to `jira-developers` group.
+We need to create a user in JIRA which will have access to all projects that
+need to integrate with GitLab. Login to your JIRA instance as admin and under
+Administration go to User Management and create a new user.
+
+As an example, we'll create a user named `gitlab` and add it to `jira-developers`
+group.
**It is important that the user `gitlab` has write-access to projects in JIRA**
### Configuring GitLab
-### GitLab 7.8 EE and up with JIRA v6.x
+JIRA configuration in GitLab is done via a project's **Services**.
-To enable JIRA integration in a project, navigate to the project Settings page and go to Services. Here you will find JIRA.
+#### GitLab 7.8 and up with JIRA v6.x
-Fill in the required details on the page:
+See next section.
-![Jira service page](jira_service_page.png)
+#### GitLab 7.8 and up
-* `description` A name for the issue tracker (to differentiate between instances, for instance).
-* `project url` The URL to the JIRA project which is being linked to this GitLab project.
-* `issues url` The URL to the JIRA project issues overview for the project that is linked to this GitLab project.
-* `new issue url` This is the URL to create a new issue in JIRA for the project linked to this GitLab project.
-* `api url` The base URL of the JIRA API. It may be omitted, in which case GitLab will automatically use API version `2` based on the `project url`, i.e. `https://jira.example.com/rest/api/2`.
-* `username` The username of the user created in [configuring JIRA step](#configuring-jira).
-* `password` The password of the user created in [configuring JIRA step](#configuring-jira).
-* `Jira issue transition` This is the id of a transition that moves issues to a closed state. You can find this number under [JIRA workflow administration, see screenshot](jira_workflow_screenshot.png). By default, this id is `2`. (In the example image, this is `2` as well)
+_The currently supported JIRA versions are v6.x and v7.x._
-After saving the configuration, your GitLab project will be able to interact with the linked JIRA project.
+To enable JIRA integration in a project, navigate to the project's
+**Settings > Services > JIRA**.
+Fill in the required details on the page as described in the table below.
-### GitLab 6.x-7.7 with JIRA v6.x
+| Field | Description |
+| ----- | ----------- |
+| `description` | A name for the issue tracker (to differentiate between instances, for instance). |
+| `project url` | The URL to the JIRA project which is being linked to this GitLab project. |
+| `issues url` | The URL to the JIRA project issues overview for the project that is linked to this GitLab project. |
+| `new issue url` | This is the URL to create a new issue in JIRA for the project linked to this GitLab project. |
+| `api url` | The base URL of the JIRA API. It may be omitted, in which case GitLab will automatically use API version `2` based on the `project url`, i.e. `https://jira.example.com/rest/api/2`. |
+| `username` | The username of the user created in [configuring JIRA step](#configuring-jira). |
+| `password` |The password of the user created in [configuring JIRA step](#configuring-jira). |
+| `Jira issue transition` | This is the ID of a transition that moves issues to a closed state. You can find this number under JIRA workflow administration ([see screenshot](img/jira_workflow_screenshot.png)). By default, this ID is `2` (in the example image, this is `2` as well) |
-**Note: GitLab 7.8 and up contain various integration improvements. We strongly recommend upgrading.**
+After saving the configuration, your GitLab project will be able to interact
+with the linked JIRA project.
+![Jira service page](img/jira_service_page.png)
-In `gitlab.yml` enable [JIRA issue tracker section by uncommenting the lines](https://gitlab.com/subscribers/gitlab-ee/blob/6-8-stable-ee/config/gitlab.yml.example#L111-115).
-This will make sure that all issues within GitLab are pointing to the JIRA issue tracker.
+---
-We can also enable JIRA service that will allow us to interact with JIRA issues.
+#### GitLab 6.x-7.7 with JIRA v6.x
-For example, we can close issues in JIRA by a commit in GitLab.
+_**Note:** GitLab versions 7.8 and up contain various integration improvements.
+We strongly recommend upgrading._
-Go to project settings page and fill in the project name for the JIRA project:
+In `gitlab.yml` enable the JIRA issue tracker section by
+[uncommenting these lines][jira-gitlab-yml]. This will make sure that all
+issues within GitLab are pointing to the JIRA issue tracker.
-![Set the JIRA project name in GitLab to 'NEW'](jira_project_name.png)
+After you set this, you will be able to close issues in JIRA by a commit in
+GitLab.
-Next, go to the services page and find JIRA.
+Go to your project's **Settings** page and fill in the project name for the
+JIRA project:
-![Jira services page](jira_service.png)
+![Set the JIRA project name in GitLab to 'NEW'](img/jira_project_name.png)
-1. Tick the active check box to enable the service.
-1. Supply the url to JIRA server, for example http://jira.sample
-1. Supply the username of a user we created under `Configuring JIRA` section, for example `gitlab`
+---
+
+You can also enable the JIRA service that will allow you to interact with JIRA
+issues. Go to the **Settings > Services > JIRA** and:
+
+1. Tick the active check box to enable the service
+1. Supply the URL to JIRA server, for example http://jira.example.com
+1. Supply the username of a user we created under `Configuring JIRA` section,
+ for example `gitlab`
1. Supply the password of the user
-1. Optional: supply the JIRA api version, default is version
-1. Optional: supply the JIRA issue transition ID (issue transition to closed). This is dependant on JIRA settings, default is 2
-1. Save
+1. Optional: supply the JIRA API version, default is version `2`
+1. Optional: supply the JIRA issue transition ID (issue transition to closed).
+ This is dependent on JIRA settings, default is `2`
+1. Hit save
+
+
+![Jira services page](img/jira_service.png)
-Now we should be able to interact with JIRA issues.
+[services-templates]: ../project_services/services_templates.md
+[jira-gitlab-yml]: https://gitlab.com/subscribers/gitlab-ee/blob/6-8-stable-ee/config/gitlab.yml.example#L111-115
diff --git a/doc/integration/jira_service_page.png b/doc/integration/jira_service_page.png
deleted file mode 100644
index 69ec44e826f..00000000000
--- a/doc/integration/jira_service_page.png
+++ /dev/null
Binary files differ
diff --git a/doc/integration/redmine_configuration.png b/doc/integration/redmine_configuration.png
deleted file mode 100644
index 6b145363229..00000000000
--- a/doc/integration/redmine_configuration.png
+++ /dev/null
Binary files differ
diff --git a/doc/integration/redmine_service_template.png b/doc/integration/redmine_service_template.png
deleted file mode 100644
index 1159eb5b964..00000000000
--- a/doc/integration/redmine_service_template.png
+++ /dev/null
Binary files differ
diff --git a/doc/project_services/img/redmine_configuration.png b/doc/project_services/img/redmine_configuration.png
new file mode 100644
index 00000000000..d14e526ad33
--- /dev/null
+++ b/doc/project_services/img/redmine_configuration.png
Binary files differ
diff --git a/doc/project_services/img/services_templates_redmine_example.png b/doc/project_services/img/services_templates_redmine_example.png
new file mode 100644
index 00000000000..384d057fc8e
--- /dev/null
+++ b/doc/project_services/img/services_templates_redmine_example.png
Binary files differ
diff --git a/doc/project_services/project_services.md b/doc/project_services/project_services.md
index 2d3e899383f..e3403127723 100644
--- a/doc/project_services/project_services.md
+++ b/doc/project_services/project_services.md
@@ -26,5 +26,12 @@ further configuration instructions and details. Contributions are welcome.
| JetBrains TeamCity CI | A continuous integration and build server |
| PivotalTracker | Project Management Software (Source Commits Endpoint) |
| Pushover | Pushover makes it easy to get real-time notifications on your Android device, iPhone, iPad, and Desktop |
-| Redmine | Redmine issue tracker |
+| [Redmine](redmine.md) | Redmine issue tracker |
| Slack | A team communication tool for the 21st century |
+
+## Services Templates
+
+Services templates is a way to set some predefined values in the Service of
+your liking which will then be pre-filled on each project's Service.
+
+Read more about [Services Templates in this document](services_templates.md).
diff --git a/doc/project_services/redmine.md b/doc/project_services/redmine.md
new file mode 100644
index 00000000000..b9830ea7c38
--- /dev/null
+++ b/doc/project_services/redmine.md
@@ -0,0 +1,21 @@
+# Redmine Service
+
+Go to your project's **Settings > Services > Redmine** and fill in the required
+details as described in the table below.
+
+| Field | Description |
+| ----- | ----------- |
+| `description` | A name for the issue tracker (to differentiate between instances, for example) |
+| `project_url` | The URL to the project in Redmine which is being linked to this GitLab project |
+| `issues_url` | The URL to the issue in Redmine project that is linked to this GitLab project. Note that the `issues_url` requires `:id` in the URL. This ID is used by GitLab as a placeholder to replace the issue number. |
+| `new_issue_url` | This is the URL to create a new issue in Redmine for the project linked to this GitLab project |
+
+Once you have configured and enabled Redmine:
+
+- the **Issues** link on the GitLab project pages takes you to the appropriate
+ Redmine issue index
+- clicking **New issue** on the project dashboard creates a new Redmine issue
+
+As an example, below is a configuration for a project named gitlab-ci.
+
+![Redmine configuration](img/redmine_configuration.png)
diff --git a/doc/project_services/services_templates.md b/doc/project_services/services_templates.md
new file mode 100644
index 00000000000..be6d13b6d2b
--- /dev/null
+++ b/doc/project_services/services_templates.md
@@ -0,0 +1,25 @@
+# Services Templates
+
+A GitLab administrator can add a service template that sets a default for each
+project. This makes it much easier to configure individual projects.
+
+After the template is created, the template details will be pre-filled on a
+project's Service page.
+
+## Enable a Service template
+
+In GitLab's Admin area, navigate to **Service Templates** and choose the
+service template you wish to create.
+
+For example, in the image below you can see Redmine.
+
+![Redmine service template](img/services_templates_redmine_example.png)
+
+---
+
+**NOTE:** For each project, you will still need to configure the issue tracking
+URLs by replacing `:issues_tracker_id` in the above screenshot with the ID used
+by your external issue tracker. Prior to GitLab v7.8, this ID was configured in
+the project settings, and GitLab would automatically update the URL configured
+in `gitlab.yml`. This behavior is now deprecated and all issue tracker URLs
+must be configured directly within the project's **Services** settings.
diff --git a/lib/api/tags.rb b/lib/api/tags.rb
index 47621f443e6..2d8a9e51bb9 100644
--- a/lib/api/tags.rb
+++ b/lib/api/tags.rb
@@ -40,6 +40,27 @@ module API
end
end
+ # Delete tag
+ #
+ # Parameters:
+ # id (required) - The ID of a project
+ # tag_name (required) - The name of the tag
+ # Example Request:
+ # DELETE /projects/:id/repository/tags/:tag
+ delete ":id/repository/tags/:tag_name", requirements: { tag_name: /.*/ } do
+ authorize_push_project
+ result = DeleteTagService.new(user_project, current_user).
+ execute(params[:tag_name])
+
+ if result[:status] == :success
+ {
+ tag_name: params[:tag_name]
+ }
+ else
+ render_api_error!(result[:message], result[:return_code])
+ end
+ end
+
# Add release notes to tag
#
# Parameters:
diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb
index 7a86c09158e..7f938780ab1 100644
--- a/lib/gitlab/current_settings.rb
+++ b/lib/gitlab/current_settings.rb
@@ -41,6 +41,9 @@ module Gitlab
use_db && ActiveRecord::Base.connection.active? &&
!ActiveRecord::Migrator.needs_migration? &&
ActiveRecord::Base.connection.table_exists?('application_settings')
+
+ rescue ActiveRecord::NoDatabaseError
+ false
end
end
end
diff --git a/spec/requests/api/tags_spec.rb b/spec/requests/api/tags_spec.rb
index 17f2643fd45..f966e38cd3e 100644
--- a/spec/requests/api/tags_spec.rb
+++ b/spec/requests/api/tags_spec.rb
@@ -65,6 +65,27 @@ describe API::API, api: true do
end
end
+ describe 'DELETE /projects/:id/repository/tags/:tag_name' do
+ let(:tag_name) { project.repository.tag_names.sort.reverse.first }
+
+ before do
+ allow_any_instance_of(Repository).to receive(:rm_tag).and_return(true)
+ end
+
+ context 'delete tag' do
+ it 'should delete an existing tag' do
+ delete api("/projects/#{project.id}/repository/tags/#{tag_name}", user)
+ expect(response.status).to eq(200)
+ expect(json_response['tag_name']).to eq(tag_name)
+ end
+
+ it 'should raise 404 if the tag does not exist' do
+ delete api("/projects/#{project.id}/repository/tags/foobar", user)
+ expect(response.status).to eq(404)
+ end
+ end
+ end
+
context 'annotated tag' do
it 'should create a new annotated tag' do
# Identity must be set in .gitconfig to create annotated tag.
diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb
index 2a70c190337..22ba25217f0 100644
--- a/spec/routing/project_routing_spec.rb
+++ b/spec/routing/project_routing_spec.rb
@@ -80,6 +80,7 @@ describe ProjectsController, 'routing' do
it 'to #show' do
expect(get('/gitlab/gitlabhq')).to route_to('projects#show', namespace_id: 'gitlab', id: 'gitlabhq')
+ expect(get('/gitlab/gitlabhq.keys')).to route_to('projects#show', namespace_id: 'gitlab', id: 'gitlabhq.keys')
end
it 'to #update' do