Commit ef0d1748 authored by Marin Jankovski's avatar Marin Jankovski

Merge branch 'ce-to-ee-2018-06-18' into 'master'

CE upstream - 2018-06-18 15:21 UTC

Closes gitlab-runner#2211

See merge request gitlab-org/gitlab-ee!6170
parents e6f21f01 e24440de
...@@ -208,6 +208,15 @@ table { ...@@ -208,6 +208,15 @@ table {
&:not(:last-of-type) { &:not(:last-of-type) {
border-bottom: 1px solid $well-inner-border; border-bottom: 1px solid $well-inner-border;
} }
p,
ol,
ul,
.form-group {
&:last-of-type {
margin-bottom: 0;
}
}
} }
.badge.badge-gray { .badge.badge-gray {
......
...@@ -337,7 +337,8 @@ ...@@ -337,7 +337,8 @@
} }
.btn-clipboard { .btn-clipboard {
margin-left: 5px; background-color: $white-light;
border: 1px solid $theme-gray-200;
} }
.deploy-token-help-block { .deploy-token-help-block {
......
module IssuesAction module IssuesAction
extend ActiveSupport::Concern extend ActiveSupport::Concern
include IssuableCollections include IssuableCollections
include IssuesCalendar
# rubocop:disable Gitlab/ModuleWithInstanceVariables # rubocop:disable Gitlab/ModuleWithInstanceVariables
def issues def issues
...@@ -17,18 +18,9 @@ module IssuesAction ...@@ -17,18 +18,9 @@ module IssuesAction
end end
# rubocop:enable Gitlab/ModuleWithInstanceVariables # rubocop:enable Gitlab/ModuleWithInstanceVariables
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def issues_calendar def issues_calendar
@issues = issuables_collection render_issues_calendar(issuables_collection)
.non_archived
.with_due_date
.limit(100)
respond_to do |format|
format.ics { response.headers['Content-Disposition'] = 'inline' }
end
end end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
private private
......
module IssuesCalendar
extend ActiveSupport::Concern
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def render_issues_calendar(issuables)
@issues = issuables
.non_archived
.with_due_date
.limit(100)
respond_to do |format|
format.ics do
# NOTE: with text/calendar as Content-Type, the browser always downloads
# the content as a file (even ignoring the Content-Disposition
# header). We want to display the content inline when accessed
# from GitLab, similarly to the RSS feed.
if request.referer&.start_with?(::Settings.gitlab.base_url)
response.headers['Content-Type'] = 'text/plain'
end
end
end
end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
end
...@@ -7,6 +7,7 @@ class Projects::ArtifactsController < Projects::ApplicationController ...@@ -7,6 +7,7 @@ class Projects::ArtifactsController < Projects::ApplicationController
before_action :authorize_read_build! before_action :authorize_read_build!
before_action :authorize_update_build!, only: [:keep] before_action :authorize_update_build!, only: [:keep]
before_action :extract_ref_name_and_path before_action :extract_ref_name_and_path
before_action :set_request_format, only: [:file]
before_action :validate_artifacts! before_action :validate_artifacts!
before_action :entry, only: [:file] before_action :entry, only: [:file]
...@@ -101,4 +102,12 @@ class Projects::ArtifactsController < Projects::ApplicationController ...@@ -101,4 +102,12 @@ class Projects::ArtifactsController < Projects::ApplicationController
render_404 unless @entry.exists? render_404 unless @entry.exists?
end end
def set_request_format
request.format = :html if set_request_format?
end
def set_request_format?
request.format != :json
end
end end
...@@ -4,6 +4,7 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -4,6 +4,7 @@ class Projects::IssuesController < Projects::ApplicationController
include IssuableActions include IssuableActions
include ToggleAwardEmoji include ToggleAwardEmoji
include IssuableCollections include IssuableCollections
include IssuesCalendar
include SpammableActions include SpammableActions
prepend_before_action :authenticate_user!, only: [:new, :export_csv] prepend_before_action :authenticate_user!, only: [:new, :export_csv]
...@@ -44,14 +45,7 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -44,14 +45,7 @@ class Projects::IssuesController < Projects::ApplicationController
end end
def calendar def calendar
@issues = @issuables render_issues_calendar(@issuables)
.non_archived
.with_due_date
.limit(100)
respond_to do |format|
format.ics { response.headers['Content-Disposition'] = 'inline' }
end
end end
def new def new
......
...@@ -11,7 +11,7 @@ module Projects ...@@ -11,7 +11,7 @@ module Projects
order: { due_date: :asc, title: :asc } order: { due_date: :asc, title: :asc }
} }
finder_params[:group_ids] = @project.group.self_and_ancestors.select(:id) if @project.group finder_params[:group_ids] = @project.group.self_and_ancestors_ids if @project.group
MilestonesFinder.new(finder_params).execute.select([:iid, :title]) MilestonesFinder.new(finder_params).execute.select([:iid, :title])
end end
......
...@@ -10,9 +10,8 @@ ...@@ -10,9 +10,8 @@
.settings-content .settings-content
- if @new_deploy_token.persisted? - if @new_deploy_token.persisted?
= render 'projects/deploy_tokens/new_deploy_token', deploy_token: @new_deploy_token = render 'projects/deploy_tokens/new_deploy_token', deploy_token: @new_deploy_token
- else %h5.prepend-top-0
%h5.prepend-top-0 = s_('DeployTokens|Add a deploy token')
= s_('DeployTokens|Add a deploy token') = render 'projects/deploy_tokens/form', project: @project, token: @new_deploy_token, presenter: @deploy_tokens
= render 'projects/deploy_tokens/form', project: @project, token: @new_deploy_token, presenter: @deploy_tokens %hr
%hr
= render 'projects/deploy_tokens/table', project: @project, active_tokens: @deploy_tokens = render 'projects/deploy_tokens/table', project: @project, active_tokens: @deploy_tokens
.created-deploy-token-container .created-deploy-token-container.info-well
%h5.prepend-top-0 .well-segment
= s_('DeployTokens|Your New Deploy Token') %h5.prepend-top-0
= s_('DeployTokens|Your New Deploy Token')
.form-group .form-group
= text_field_tag 'deploy-token-user', deploy_token.username, readonly: true, class: 'deploy-token-field form-control js-select-on-focus' .input-group
= clipboard_button(text: deploy_token.username, title: s_('DeployTokens|Copy username to clipboard'), placement: 'left') = text_field_tag 'deploy-token-user', deploy_token.username, readonly: true, class: 'deploy-token-field form-control js-select-on-focus'
%span.deploy-token-help-block.prepend-top-5.text-success= s_("DeployTokens|Use this username as a login.") .input-group-append
= clipboard_button(text: deploy_token.username, title: s_('DeployTokens|Copy username to clipboard'), placement: 'left')
%span.deploy-token-help-block.prepend-top-5.text-success= s_("DeployTokens|Use this username as a login.")
.form-group .form-group
= text_field_tag 'deploy-token', deploy_token.token, readonly: true, class: 'deploy-token-field form-control js-select-on-focus' .input-group
= clipboard_button(text: deploy_token.token, title: s_('DeployTokens|Copy deploy token to clipboard'), placement: 'left') = text_field_tag 'deploy-token', deploy_token.token, readonly: true, class: 'deploy-token-field form-control js-select-on-focus'
%span.deploy-token-help-block.prepend-top-5.text-danger= s_("DeployTokens|Use this token as a password. Make sure you save it - you won't be able to access it again.") .input-group-append
%hr = clipboard_button(text: deploy_token.token, title: s_('DeployTokens|Copy deploy token to clipboard'), placement: 'left')
%span.deploy-token-help-block.prepend-top-5.text-danger= s_("DeployTokens|Use this token as a password. Make sure you save it - you won't be able to access it again.")
---
title: Allows you to create another deploy token dimmediately after creating one
merge_request: 19639
author:
type: changed
---
title: Render calendar feed inline when accessed from GitLab
merge_request:
author:
type: fixed
---
title: "[Rails5] Set request.format for artifacts_controller"
merge_request: 19937
author: "@blackst0ne"
type: fixed
---
title: "[Rails5] Invalid single-table inheritance type: Group is not a subclass of
Namespace"
merge_request: 19918
author: "@blackst0ne"
type: fixed
---
title: Allow trailing whitespace on blockquote fence lines
merge_request:
author:
type: fixed
---
title: Rails5 fix passing Group objects array into for_projects_and_groups milestone
scope
merge_request: 19920
author: Jasper Maes
type: fixed
---
title: Rails5 fix connection execute return integer instead of string
merge_request: 19901
author: Jasper Maes
type: fixed
...@@ -11,6 +11,12 @@ Rails.application.routes.draw do ...@@ -11,6 +11,12 @@ Rails.application.routes.draw do
post :toggle_award_emoji, on: :member post :toggle_award_emoji, on: :member
end end
favicon_redirect = redirect do |_params, _request|
ActionController::Base.helpers.asset_url(Gitlab::Favicon.main)
end
get 'favicon.png', to: favicon_redirect
get 'favicon.ico', to: favicon_redirect
draw :sherlock draw :sherlock
draw :development draw :development
draw :ci draw :ci
......
...@@ -1585,6 +1585,43 @@ variables: ...@@ -1585,6 +1585,43 @@ variables:
You can set it globally or per-job in the [`variables`](#variables) section. You can set it globally or per-job in the [`variables`](#variables) section.
### Custom build directories
> [Introduced][gitlab-runner-876] in Gitlab Runner 11.1
NOTE: **Note:**
This can only be used when `custom_build_dir` is set to true in the [Runner's
configuration](https://docs.gitlab.com/runner/configuration/advanced-configuration.html).
By default, GitLab Runner clones the repository in the `/builds` directory,
but sometimes your project might require to have the code in a specific
directory, like the GO projects for example. In that case, you can specify
the `CI_PROJECT_DIR` variable to tell the Runner in which directory to clone
the repository:
```yml
image: golang:1.10-alpine3.7
variables:
CI_PROJECT_DIR: /go/src/gitlab.com/namespace/project-name
stages:
- test
dir:
stage: test
script:
- pwd # /go/src/gitlab.com/namespace/project-name
```
The following executors may use this feature only when
[concurrent](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-global-section)
is set to `1`:
- `shell`
- `ssh`
- `docker`, `docker+machine` when the job's working directory is mounted as a host volume.
## Special YAML features ## Special YAML features
It's possible to use special YAML features like anchors (`&`), aliases (`*`) It's possible to use special YAML features like anchors (`&`), aliases (`*`)
...@@ -1778,6 +1815,7 @@ CI with various languages. ...@@ -1778,6 +1815,7 @@ CI with various languages.
[ce-7983]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7983 [ce-7983]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7983
[ce-7447]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7447 [ce-7447]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7447
[ce-12909]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12909 [ce-12909]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12909
[gitlab-runner-876]: https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/876
[schedules]: ../../user/project/pipelines/schedules.md [schedules]: ../../user/project/pipelines/schedules.md
[variables-expressions]: ../variables/README.md#variables-expressions [variables-expressions]: ../variables/README.md#variables-expressions
[ee]: https://about.gitlab.com/gitlab-ee/ [ee]: https://about.gitlab.com/gitlab-ee/
......
...@@ -17,7 +17,7 @@ We've gathered some resources to help you to get the best from Git with GitLab. ...@@ -17,7 +17,7 @@ We've gathered some resources to help you to get the best from Git with GitLab.
- [How to install Git](how_to_install_git/index.md) - [How to install Git](how_to_install_git/index.md)
- [Start using Git on the command line](../../gitlab-basics/start-using-git.md) - [Start using Git on the command line](../../gitlab-basics/start-using-git.md)
- [Command Line basic commands](../../gitlab-basics/command-line-commands.md) - [Command Line basic commands](../../gitlab-basics/command-line-commands.md)
- [GitLab Git Cheat Sheet (download)](https://gitlab.com/gitlab-com/marketing/raw/master/design/print/git-cheatsheet/print-pdf/git-cheatsheet.pdf) - [GitLab Git Cheat Sheet (download)](https://about.gitlab.com/images/press/git-cheat-sheet.pdf)
- Commits - Commits
- [Revert a commit](../../user/project/merge_requests/revert_changes.md#reverting-a-commit) - [Revert a commit](../../user/project/merge_requests/revert_changes.md#reverting-a-commit)
- [Cherry-picking a commit](../../user/project/merge_requests/cherry_pick_changes.md#cherry-picking-a-commit) - [Cherry-picking a commit](../../user/project/merge_requests/cherry_pick_changes.md#cherry-picking-a-commit)
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
comments: false comments: false
--- ---
DANGER: This guide exists for reference of how an AWS deployment could work.
We are currently seeing very slow EFS access performance which causes GitLab to
be 5-10x slower than using NFS or Local disk. We _do not_ recommend follow this
guide at this time.
# High Availability on AWS # High Availability on AWS
......
...@@ -58,6 +58,7 @@ Currently the following names are reserved as top level groups: ...@@ -58,6 +58,7 @@ Currently the following names are reserved as top level groups:
- dashboard - dashboard
- deploy.html - deploy.html
- explore - explore
- favicon.ico
- favicon.png - favicon.png
- groups - groups
- health_check - health_check
......
...@@ -10,7 +10,7 @@ module Banzai ...@@ -10,7 +10,7 @@ module Banzai
^``` ^```
.+? .+?
\n```$ \n```\ *$
) )
| |
(?<html> (?<html>
...@@ -19,9 +19,9 @@ module Banzai ...@@ -19,9 +19,9 @@ module Banzai
# Anything, including `>>>` blocks which are ignored by this filter # Anything, including `>>>` blocks which are ignored by this filter
# </tag> # </tag>
^<[^>]+?>\n ^<[^>]+?>\ *\n
.+? .+?
\n<\/[^>]+?>$ \n<\/[^>]+?>\ *$
) )
| |
(?: (?:
...@@ -30,14 +30,14 @@ module Banzai ...@@ -30,14 +30,14 @@ module Banzai
# Anything, including code and HTML blocks # Anything, including code and HTML blocks
# >>> # >>>
^>>>\n ^>>>\ *\n
(?<quote> (?<quote>
(?: (?:
# Any character that doesn't introduce a code or HTML block # Any character that doesn't introduce a code or HTML block
(?! (?!
^``` ^```
| |
^<[^>]+?>\n ^<[^>]+?>\ *\n
) )
. .
| |
...@@ -48,7 +48,7 @@ module Banzai ...@@ -48,7 +48,7 @@ module Banzai
\g<html> \g<html>
)+? )+?
) )
\n>>>$ \n>>>\ *$
) )
}mx.freeze }mx.freeze
......
...@@ -37,6 +37,7 @@ module Gitlab ...@@ -37,6 +37,7 @@ module Gitlab
class Namespace < ActiveRecord::Base class Namespace < ActiveRecord::Base
include MigrationClasses::Routable include MigrationClasses::Routable
self.table_name = 'namespaces' self.table_name = 'namespaces'
self.inheritance_column = :_type_disabled
belongs_to :parent, belongs_to :parent,
class_name: "#{MigrationClasses.name}::Namespace" class_name: "#{MigrationClasses.name}::Namespace"
has_one :route, as: :source has_one :route, as: :source
......
...@@ -17,7 +17,7 @@ module Gitlab ...@@ -17,7 +17,7 @@ module Gitlab
def check def check
catch_timeout 10.seconds do catch_timeout 10.seconds do
if Gitlab::Database.postgresql? if Gitlab::Database.postgresql?
ActiveRecord::Base.connection.execute('SELECT 1 as ping')&.first&.[]('ping') ActiveRecord::Base.connection.execute('SELECT 1 as ping')&.first&.[]('ping')&.to_s
else else
ActiveRecord::Base.connection.execute('SELECT 1 as ping')&.first&.first&.to_s ActiveRecord::Base.connection.execute('SELECT 1 as ping')&.first&.first&.to_s
end end
......
...@@ -30,6 +30,7 @@ module Gitlab ...@@ -30,6 +30,7 @@ module Gitlab
dashboard dashboard
deploy.html deploy.html
explore explore
favicon.ico
favicon.png favicon.png
files files
groups groups
......
...@@ -11,13 +11,25 @@ describe 'Dashboard Issues Calendar Feed' do ...@@ -11,13 +11,25 @@ describe 'Dashboard Issues Calendar Feed' do
end end
context 'when authenticated' do context 'when authenticated' do
it 'renders calendar feed' do context 'with no referer' do
sign_in user it 'renders calendar feed' do
visit issues_dashboard_path(:ics) sign_in user
visit issues_dashboard_path(:ics)
expect(response_headers['Content-Type']).to have_content('text/calendar') expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(response_headers['Content-Disposition']).to have_content('inline') expect(body).to have_text('BEGIN:VCALENDAR')
expect(body).to have_text('BEGIN:VCALENDAR') end
end
context 'with GitLab as the referer' do
it 'renders calendar feed as text/plain' do
sign_in user
page.driver.header('Referer', issues_dashboard_url(host: Settings.gitlab.base_url))
visit issues_dashboard_path(:ics)
expect(response_headers['Content-Type']).to have_content('text/plain')
expect(body).to have_text('BEGIN:VCALENDAR')
end
end end
end end
...@@ -28,7 +40,6 @@ describe 'Dashboard Issues Calendar Feed' do ...@@ -28,7 +40,6 @@ describe 'Dashboard Issues Calendar Feed' do
visit issues_dashboard_path(:ics, private_token: personal_access_token.token) visit issues_dashboard_path(:ics, private_token: personal_access_token.token)
expect(response_headers['Content-Type']).to have_content('text/calendar') expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(response_headers['Content-Disposition']).to have_content('inline')
expect(body).to have_text('BEGIN:VCALENDAR') expect(body).to have_text('BEGIN:VCALENDAR')
end end
end end
...@@ -38,7 +49,6 @@ describe 'Dashboard Issues Calendar Feed' do ...@@ -38,7 +49,6 @@ describe 'Dashboard Issues Calendar Feed' do
visit issues_dashboard_path(:ics, feed_token: user.feed_token) visit issues_dashboard_path(:ics, feed_token: user.feed_token)
expect(response_headers['Content-Type']).to have_content('text/calendar') expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(response_headers['Content-Disposition']).to have_content('inline')
expect(body).to have_text('BEGIN:VCALENDAR') expect(body).to have_text('BEGIN:VCALENDAR')
end end
end end
......
...@@ -13,13 +13,25 @@ describe 'Group Issues Calendar Feed' do ...@@ -13,13 +13,25 @@ describe 'Group Issues Calendar Feed' do
end end
context 'when authenticated' do context 'when authenticated' do
it 'renders calendar feed' do context 'with no referer' do
sign_in user it 'renders calendar feed' do
visit issues_group_path(group, :ics) sign_in user
visit issues_group_path(group, :ics)
expect(response_headers['Content-Type']).to have_content('text/calendar') expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(response_headers['Content-Disposition']).to have_content('inline') expect(body).to have_text('BEGIN:VCALENDAR')
expect(body).to have_text('BEGIN:VCALENDAR') end
end
context 'with GitLab as the referer' do
it 'renders calendar feed as text/plain' do
sign_in user
page.driver.header('Referer', issues_group_url(group, host: Settings.gitlab.base_url))
visit issues_group_path(group, :ics)
expect(response_headers['Content-Type']).to have_content('text/plain')
expect(body).to have_text('BEGIN:VCALENDAR')
end
end end
end end
...@@ -30,7 +42,6 @@ describe 'Group Issues Calendar Feed' do ...@@ -30,7 +42,6 @@ describe 'Group Issues Calendar Feed' do
visit issues_group_path(group, :ics, private_token: personal_access_token.token) visit issues_group_path(group, :ics, private_token: personal_access_token.token)
expect(response_headers['Content-Type']).to have_content('text/calendar') expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(response_headers['Content-Disposition']).to have_content('inline')
expect(body).to have_text('BEGIN:VCALENDAR') expect(body).to have_text('BEGIN:VCALENDAR')
end end
end end
...@@ -40,7 +51,6 @@ describe 'Group Issues Calendar Feed' do ...@@ -40,7 +51,6 @@ describe 'Group Issues Calendar Feed' do
visit issues_group_path(group, :ics, feed_token: user.feed_token) visit issues_group_path(group, :ics, feed_token: user.feed_token)
expect(response_headers['Content-Type']).to have_content('text/calendar') expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(response_headers['Content-Disposition']).to have_content('inline')
expect(body).to have_text('BEGIN:VCALENDAR') expect(body).to have_text('BEGIN:VCALENDAR')
end end
end end
......
...@@ -12,13 +12,25 @@ describe 'Project Issues Calendar Feed' do ...@@ -12,13 +12,25 @@ describe 'Project Issues Calendar Feed' do
end end
context 'when authenticated' do context 'when authenticated' do
it 'renders calendar feed' do context 'with no referer' do
sign_in user it 'renders calendar feed' do
visit project_issues_path(project, :ics) sign_in user
visit project_issues_path(project, :ics)
expect(response_headers['Content-Type']).to have_content('text/calendar') expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(response_headers['Content-Disposition']).to have_content('inline') expect(body).to have_text('BEGIN:VCALENDAR')
expect(body).to have_text('BEGIN:VCALENDAR') end
end
context 'with GitLab as the referer' do
it 'renders calendar feed as text/plain' do
sign_in user
page.driver.header('Referer', project_issues_url(project, host: Settings.gitlab.base_url))
visit project_issues_path(project, :ics)
expect(response_headers['Content-Type']).to have_content('text/plain')
expect(body).to have_text('BEGIN:VCALENDAR')
end
end end
end end
...@@ -29,7 +41,6 @@ describe 'Project Issues Calendar Feed' do ...@@ -29,7 +41,6 @@ describe 'Project Issues Calendar Feed' do
visit project_issues_path(project, :ics, private_token: personal_access_token.token) visit project_issues_path(project, :ics, private_token: personal_access_token.token)
expect(response_headers['Content-Type']).to have_content('text/calendar') expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(response_headers['Content-Disposition']).to have_content('inline')
expect(body).to have_text('BEGIN:VCALENDAR') expect(body).to have_text('BEGIN:VCALENDAR')
end end
end end
...@@ -39,7 +50,6 @@ describe 'Project Issues Calendar Feed' do ...@@ -39,7 +50,6 @@ describe 'Project Issues Calendar Feed' do
visit project_issues_path(project, :ics, feed_token: user.feed_token) visit project_issues_path(project, :ics, feed_token: user.feed_token)
expect(response_headers['Content-Type']).to have_content('text/calendar') expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(response_headers['Content-Disposition']).to have_content('inline')
expect(body).to have_text('BEGIN:VCALENDAR') expect(body).to have_text('BEGIN:VCALENDAR')
end end
end end
......
...@@ -11,4 +11,8 @@ describe Banzai::Filter::BlockquoteFenceFilter do ...@@ -11,4 +11,8 @@ describe Banzai::Filter::BlockquoteFenceFilter do
expect(output).to eq(expected) expect(output).to eq(expected)
end end
it 'allows trailing whitespace on blockquote fence lines' do
expect(filter(">>> \ntest\n>>> ")).to eq("> test")
end
end end
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