Commit e0436005 authored by Jeroen Nijhof's avatar Jeroen Nijhof

Merge gitlab.com:gitlab-org/gitlab-ce

parents 2c37ae2f c1e974ed
...@@ -16,6 +16,7 @@ v 8.4.0 (unreleased) ...@@ -16,6 +16,7 @@ v 8.4.0 (unreleased)
- Add "Frequently used" category to emoji picker - Add "Frequently used" category to emoji picker
- Add CAS support (tduehr) - Add CAS support (tduehr)
- Add link to merge request on build detail page - 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 - 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) - 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) - Add system hook messages for project rename and transfer (Steve Norman)
...@@ -28,6 +29,7 @@ v 8.4.0 (unreleased) ...@@ -28,6 +29,7 @@ v 8.4.0 (unreleased)
- Properly set task-list class on single item task lists - Properly set task-list class on single item task lists
- Add file finder feature in tree view (Kyungchul Shin) - Add file finder feature in tree view (Kyungchul Shin)
- Ajax filter by message for commits page - Ajax filter by message for commits page
- API: Add support for deleting a tag via the API (Robert Schilling)
v 8.3.3 (unreleased) v 8.3.3 (unreleased)
- Get "Merge when build succeeds" to work when commits were pushed to MR target branch while builds were running - Get "Merge when build succeeds" to work when commits were pushed to MR target branch while builds were running
......
...@@ -40,15 +40,10 @@ class JiraService < IssueTrackerService ...@@ -40,15 +40,10 @@ class JiraService < IssueTrackerService
end end
def help 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 '\ '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) '\ '[integration doc](http://doc.gitlab.com/ce/integration/external-issue-tracker.html) '\
'for details.' '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 end
def title def title
......
...@@ -52,9 +52,6 @@ Rails.application.routes.draw do ...@@ -52,9 +52,6 @@ Rails.application.routes.draw do
API::API.logger Rails.logger API::API.logger Rails.logger
mount API::API => '/api' 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? } constraint = lambda { |request| request.env['warden'].authenticate? and request.env['warden'].user.admin? }
constraints constraint do constraints constraint do
mount Sidekiq::Web, at: '/admin/sidekiq', as: :sidekiq mount Sidekiq::Web, at: '/admin/sidekiq', as: :sidekiq
...@@ -687,5 +684,8 @@ Rails.application.routes.draw do ...@@ -687,5 +684,8 @@ Rails.application.routes.draw do
end end
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/ } get ':id' => 'namespaces#show', constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ }
end end
...@@ -83,6 +83,26 @@ it will contain the annotation. ...@@ -83,6 +83,26 @@ it will contain the annotation.
It returns 200 if the operation succeed. In case of an error, It returns 200 if the operation succeed. In case of an error,
405 with an explaining error message is returned. 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 ## Create a new release
......
# GitLab Integration # 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. 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. ...@@ -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 - [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 - [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 ## Project services
Integration with services such as Campfire, Flowdock, Gemnasium, HipChat, Pivotal Tracker, and Slack are available in the form of a Project Service. Integration with services such as Campfire, Flowdock, Gemnasium, HipChat,
You can find these within GitLab in the Services page under Project Settings if you are at least a master on the project. Pivotal Tracker, and Slack are available in the form of a [Project Service][].
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. You can find these within GitLab in the Services page under Project Settings if
Because GitLab is open source we can ship with the code and tests for all plugins. you are at least a master on the project.
This allows the community to keep the plugins up to date so that they always work in newer GitLab versions. Project Services are a bit like plugins in that they allow a lot of freedom in
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). 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
# External issue tracker # 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; - the **Issues** link on the GitLab project pages takes you to the appropriate
- clicking 'New issue' on the project dashboard creates a new Jira issue; issue index of the external tracker
- To reference Jira issue PROJECT-1234 in comments, use syntax PROJECT-1234. Commit messages get turned into HTML links to the corresponding Jira issue. - clicking **New issue** on the project dashboard creates a new issue on the
external tracker
![Jira screenshot](jira-integration-points.png)
GitLab Enterprise Edition contains [advanced JIRA support](http://doc.gitlab.com/ee/integration/jira.html).
## Configuration ## 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. ### Project Service
Fill in the required details on the page:
![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). - [Redmine](../project_services/redmine.md)
* `project_url` The URL to the project in Redmine which is being linked to this GitLab project. - [Jira](jira.md)
* `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.
### Service Template ### Service Template
It is necessary to configure the external issue tracker per project, because project specific details are needed for the integration with GitLab. To save you the hassle from configuring each project's service individually,
The admin can add a service template that sets a default for each project. This makes it much easier to configure individual projects. GitLab provides the ability to set Service Templates which can then be
overridden in each project's settings.
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.
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).
This diff is collapsed.
...@@ -26,5 +26,12 @@ further configuration instructions and details. Contributions are welcome. ...@@ -26,5 +26,12 @@ further configuration instructions and details. Contributions are welcome.
| JetBrains TeamCity CI | A continuous integration and build server | | JetBrains TeamCity CI | A continuous integration and build server |
| PivotalTracker | Project Management Software (Source Commits Endpoint) | | 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 | | 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 | | 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).
# 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)
# 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.
...@@ -40,6 +40,27 @@ module API ...@@ -40,6 +40,27 @@ module API
end end
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 # Add release notes to tag
# #
# Parameters: # Parameters:
......
...@@ -41,6 +41,9 @@ module Gitlab ...@@ -41,6 +41,9 @@ module Gitlab
use_db && ActiveRecord::Base.connection.active? && use_db && ActiveRecord::Base.connection.active? &&
!ActiveRecord::Migrator.needs_migration? && !ActiveRecord::Migrator.needs_migration? &&
ActiveRecord::Base.connection.table_exists?('application_settings') ActiveRecord::Base.connection.table_exists?('application_settings')
rescue ActiveRecord::NoDatabaseError
false
end end
end end
end end
...@@ -65,6 +65,27 @@ describe API::API, api: true do ...@@ -65,6 +65,27 @@ describe API::API, api: true do
end end
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 context 'annotated tag' do
it 'should create a new annotated tag' do it 'should create a new annotated tag' do
# Identity must be set in .gitconfig to create annotated tag. # Identity must be set in .gitconfig to create annotated tag.
......
...@@ -80,6 +80,7 @@ describe ProjectsController, 'routing' do ...@@ -80,6 +80,7 @@ describe ProjectsController, 'routing' do
it 'to #show' do it 'to #show' do
expect(get('/gitlab/gitlabhq')).to route_to('projects#show', namespace_id: 'gitlab', id: 'gitlabhq') 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 end
it 'to #update' do it 'to #update' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment