Skip to content

Commit

Permalink
Add latest changes from gitlab-org/gitlab@master
Browse files Browse the repository at this point in the history
  • Loading branch information
GitLab Bot committed Oct 16, 2019
1 parent d2ffc30 commit 00c78fb
Show file tree
Hide file tree
Showing 91 changed files with 839 additions and 216 deletions.
2 changes: 1 addition & 1 deletion .gitlab/issue_templates/Problem_Validation.md
Expand Up @@ -38,4 +38,4 @@
For example, if the solution will take a product manager, designer, and engineer two weeks of effort - you may quantify this as 1.5 (based on 0.5 months x 3 people). -->

/label ~"workflow::problem backlog"
/label ~"workflow::validation backlog" ~devops:: ~category: ~group::
2 changes: 2 additions & 0 deletions app/assets/stylesheets/framework/files.scss
Expand Up @@ -108,12 +108,14 @@
background: $white-light;

&.image_file,
&.audio,
&.video {
background: $gray-darker;
text-align: center;
padding: 30px;

img,
audio,
video {
max-width: 80%;
}
Expand Down
1 change: 1 addition & 0 deletions app/models/blob.rb
Expand Up @@ -32,6 +32,7 @@ class Blob < SimpleDelegator
BlobViewer::Balsamiq,

BlobViewer::Video,
BlobViewer::Audio,

BlobViewer::PDF,

Expand Down
12 changes: 12 additions & 0 deletions app/models/blob_viewer/audio.rb
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module BlobViewer
class Audio < Base
include Rich
include ClientSide

self.partial_name = 'audio'
self.extensions = UploaderHelper::SAFE_AUDIO_EXT
self.binary = true
end
end
2 changes: 0 additions & 2 deletions app/models/blob_viewer/video.rb
Expand Up @@ -8,7 +8,5 @@ class Video < Base
self.partial_name = 'video'
self.extensions = UploaderHelper::SAFE_VIDEO_EXT
self.binary = true
self.switcher_icon = 'film'
self.switcher_title = 'video'
end
end
4 changes: 1 addition & 3 deletions app/models/container_repository.rb
Expand Up @@ -69,9 +69,7 @@ def delete_tags!

digests = tags.map { |tag| tag.digest }.compact.to_set

digests.all? do |digest|
delete_tag_by_digest(digest)
end
digests.map(&method(:delete_tag_by_digest)).all?
end

def delete_tag_by_digest(digest)
Expand Down
3 changes: 3 additions & 0 deletions app/models/note.rb
Expand Up @@ -145,6 +145,9 @@ def value?(val)
end
scope :with_metadata, -> { includes(:system_note_metadata) }

scope :for_note_or_capitalized_note, ->(text) { where(note: [text, text.capitalize]) }
scope :like_note_or_capitalized_note, ->(text) { where('(note LIKE ? OR note LIKE ?)', text, text.capitalize) }

after_initialize :ensure_discussion_id
before_validation :nullify_blank_type, :nullify_blank_line_code
before_validation :set_discussion_id, on: :create
Expand Down
6 changes: 2 additions & 4 deletions app/services/system_notes/issuables_service.rb
Expand Up @@ -288,18 +288,16 @@ def cross_reference_note_content(gfm_reference)
"#{self.class.cross_reference_note_prefix}#{gfm_reference}"
end

# rubocop: disable CodeReuse/ActiveRecord
def notes_for_mentioner(mentioner, noteable, notes)
if mentioner.is_a?(Commit)
text = "#{self.class.cross_reference_note_prefix}%#{mentioner.to_reference(nil)}"
notes.where('(note LIKE ? OR note LIKE ?)', text, text.capitalize)
notes.like_note_or_capitalized_note(text)
else
gfm_reference = mentioner.gfm_reference(noteable.project || noteable.group)
text = cross_reference_note_content(gfm_reference)
notes.where(note: [text, text.capitalize])
notes.for_note_or_capitalized_note(text)
end
end
# rubocop: enable CodeReuse/ActiveRecord

def self.cross_reference_note_prefix
'mentioned in '
Expand Down
2 changes: 2 additions & 0 deletions app/views/projects/blob/viewers/_audio.html.haml
@@ -0,0 +1,2 @@
.file-content.audio
%audio{ src: blob_raw_path, controls: true, data: { setup: '{}' } }
5 changes: 5 additions & 0 deletions changelogs/unreleased/19822-audio-preview-in-repo.yml
@@ -0,0 +1,5 @@
---
title: Users can preview audio files in a repository.
merge_request: 18354
author: Jesse Hall @jessehall3
type: added
5 changes: 5 additions & 0 deletions changelogs/unreleased/ab-replace-index.yml
@@ -0,0 +1,5 @@
---
title: Replace index on ci_triggers
merge_request: 18652
author:
type: performance
5 changes: 5 additions & 0 deletions changelogs/unreleased/introduce-feature-flag-api.yml
@@ -0,0 +1,5 @@
---
title: Support Create/Read/Destroy operations in Feature Flag API
merge_request: 18198
author:
type: added
6 changes: 6 additions & 0 deletions config/gitlab.yml.example
Expand Up @@ -1024,6 +1024,12 @@ production: &base
# enabled: true
# address: localhost
# port: 8083
# # blackout_seconds:
# # defines an interval to block healthcheck,
# # but continue accepting application requests
# # this allows Load Balancer to notice service
# # being shutdown and not interrupt any of the clients
# blackout_seconds: 10

## Prometheus settings
# Do not modify these settings here. They should be modified in /etc/gitlab/gitlab.rb
Expand Down
1 change: 1 addition & 0 deletions config/initializers/1_settings.rb
Expand Up @@ -668,6 +668,7 @@
Settings.monitoring.web_exporter['enabled'] ||= false
Settings.monitoring.web_exporter['address'] ||= 'localhost'
Settings.monitoring.web_exporter['port'] ||= 8083
Settings.monitoring.web_exporter['blackout_seconds'] ||= 10

#
# Testing settings
Expand Down
10 changes: 9 additions & 1 deletion config/initializers/7_prometheus_metrics.rb
Expand Up @@ -70,9 +70,18 @@ def prometheus_default_multiproc_dir
Gitlab::Metrics::Exporter::WebExporter.instance.start
end

Gitlab::Cluster::LifecycleEvents.on_before_phased_restart do
# We need to ensure that before we re-exec server
# we do stop the exporter
Gitlab::Metrics::Exporter::WebExporter.instance.stop
end

Gitlab::Cluster::LifecycleEvents.on_before_master_restart do
# We need to ensure that before we re-exec server
# we do stop the exporter
#
# We do it again, for being extra safe,
# but it should not be needed
Gitlab::Metrics::Exporter::WebExporter.instance.stop
end

Expand All @@ -81,7 +90,6 @@ def prometheus_default_multiproc_dir
# but this does not happen for Ruby fork
#
# This does stop server, as it is running on master.
# However, ensures that we close the TCPSocket.
Gitlab::Metrics::Exporter::WebExporter.instance.stop
end
end
14 changes: 14 additions & 0 deletions config/initializers/cluster_events_before_phased_restart.rb
@@ -0,0 +1,14 @@
# Technical debt, this should be ideally upstreamed.
#
# However, there's currently no way to hook before doing
# graceful shutdown today.
#
# Follow-up the issue: https://gitlab.com/gitlab-org/gitlab/issues/34107

if defined?(::Puma)
Puma::Cluster.prepend(::Gitlab::Cluster::Mixins::PumaCluster)
end

if defined?(::Unicorn::HttpServer)
Unicorn::HttpServer.prepend(::Gitlab::Cluster::Mixins::UnicornHttpServer)
end
21 changes: 21 additions & 0 deletions db/migrate/20191016072826_replace_ci_trigger_requests_index.rb
@@ -0,0 +1,21 @@
# frozen_string_literal: true

class ReplaceCiTriggerRequestsIndex < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers

DOWNTIME = false

disable_ddl_transaction!

def up
add_concurrent_index :ci_trigger_requests, [:trigger_id, :id], order: { id: :desc }

remove_concurrent_index :ci_trigger_requests, [:trigger_id]
end

def down
add_concurrent_index :ci_trigger_requests, [:trigger_id]

remove_concurrent_index :ci_trigger_requests, [:trigger_id, :id], order: { id: :desc }
end
end
4 changes: 2 additions & 2 deletions db/schema.rb
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2019_10_04_133612) do
ActiveRecord::Schema.define(version: 2019_10_16_072826) do

# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
Expand Down Expand Up @@ -906,7 +906,7 @@
t.datetime "updated_at"
t.integer "commit_id"
t.index ["commit_id"], name: "index_ci_trigger_requests_on_commit_id"
t.index ["trigger_id"], name: "index_ci_trigger_requests_on_trigger_id"
t.index ["trigger_id", "id"], name: "index_ci_trigger_requests_on_trigger_id_and_id", order: { id: :desc }
end

create_table "ci_triggers", id: :serial, force: :cascade do |t|
Expand Down
Expand Up @@ -8,7 +8,7 @@ Managing a large number of users in GitLab can become a burden for system admini

In this guide we will focus on configuring GitLab with Active Directory. [Active Directory](https://en.wikipedia.org/wiki/Active_Directory) is a popular LDAP compatible directory service provided by Microsoft, included in all modern Windows Server operating systems.

GitLab has supported LDAP integration since [version 2.2](https://about.gitlab.com/2012/02/22/gitlab-version-2-2/). With GitLab LDAP [group syncing](../how_to_configure_ldap_gitlab_ee/index.html#group-sync) being added to GitLab Enterprise Edition in [version 6.0](https://about.gitlab.com/2013/08/20/gitlab-6-dot-0-released/). LDAP integration has become one of the most popular features in GitLab.
GitLab has supported LDAP integration since [version 2.2](https://about.gitlab.com/blog/2012/02/22/gitlab-version-2-2/). With GitLab LDAP [group syncing](../how_to_configure_ldap_gitlab_ee/index.html#group-sync) being added to GitLab Enterprise Edition in [version 6.0](https://about.gitlab.com/blog/2013/08/20/gitlab-6-dot-0-released/). LDAP integration has become one of the most popular features in GitLab.

## Getting started

Expand Down
2 changes: 1 addition & 1 deletion doc/administration/geo/replication/faq.md
Expand Up @@ -45,7 +45,7 @@ query.

## Can I `git push` to a **secondary** node?

Yes! Pushing directly to a **secondary** node (for both HTTP and SSH, including Git LFS) was [introduced](https://about.gitlab.com/2018/09/22/gitlab-11-3-released/) in [GitLab Premium](https://about.gitlab.com/pricing/#self-managed) 11.3.
Yes! Pushing directly to a **secondary** node (for both HTTP and SSH, including Git LFS) was [introduced](https://about.gitlab.com/blog/2018/09/22/gitlab-11-3-released/) in [GitLab Premium](https://about.gitlab.com/pricing/#self-managed) 11.3.

## How long does it take to have a commit replicated to a **secondary** node?

Expand Down
2 changes: 1 addition & 1 deletion doc/administration/geo/replication/index.md
Expand Up @@ -63,7 +63,7 @@ Keep in mind that:
- Get user data for logins (API).
- Replicate repositories, LFS Objects, and Attachments (HTTPS + JWT).
- Since GitLab Premium 10.0, the **primary** node no longer talks to **secondary** nodes to notify for changes (API).
- Pushing directly to a **secondary** node (for both HTTP and SSH, including Git LFS) was [introduced](https://about.gitlab.com/2018/09/22/gitlab-11-3-released/) in [GitLab Premium](https://about.gitlab.com/pricing/#self-managed) 11.3.
- Pushing directly to a **secondary** node (for both HTTP and SSH, including Git LFS) was [introduced](https://about.gitlab.com/blog/2018/09/22/gitlab-11-3-released/) in [GitLab Premium](https://about.gitlab.com/pricing/#self-managed) 11.3.
- There are [limitations](#current-limitations) in the current implementation.

### Architecture
Expand Down
2 changes: 1 addition & 1 deletion doc/administration/geo/replication/using_a_geo_server.md
Expand Up @@ -4,7 +4,7 @@

After you set up the [database replication and configure the Geo nodes][req], use your closest GitLab node as you would a normal standalone GitLab instance.

Pushing directly to a **secondary** node (for both HTTP, SSH including Git LFS) was [introduced](https://about.gitlab.com/2018/09/22/gitlab-11-3-released/) in [GitLab Premium](https://about.gitlab.com/pricing/#self-managed) 11.3.
Pushing directly to a **secondary** node (for both HTTP, SSH including Git LFS) was [introduced](https://about.gitlab.com/blog/2018/09/22/gitlab-11-3-released/) in [GitLab Premium](https://about.gitlab.com/pricing/#self-managed) 11.3.

Example of the output you will see when pushing to a **secondary** node:

Expand Down
2 changes: 1 addition & 1 deletion doc/administration/gitaly/reference.md
Expand Up @@ -134,7 +134,7 @@ A lot of Gitaly RPCs need to look up Git objects from repositories.
Most of the time we use `git cat-file --batch` processes for that. For
better performance, Gitaly can re-use these `git cat-file` processes
across RPC calls. Previously used processes are kept around in a
["git cat-file cache"](https://about.gitlab.com/2019/07/08/git-performance-on-nfs/#enter-cat-file-cache).
["git cat-file cache"](https://about.gitlab.com/blog/2019/07/08/git-performance-on-nfs/#enter-cat-file-cache).
In order to control how much system resources this uses, we have a maximum number
of cat-file processes that can go into the cache.

Expand Down
Expand Up @@ -146,7 +146,7 @@ However, you should **not** reinstate your old data _except_ under one of the fo

If you require access to your old Grafana data but do not meet one of these criteria, you may consider reinstating it temporarily, [exporting the dashboards](https://grafana.com/docs/reference/export_import/#exporting-a-dashboard) you need, then refreshing the data and [re-importing your dashboards](https://grafana.com/docs/reference/export_import/#importing-a-dashboard). Note that this poses a temporary vulnerability while your old Grafana data is in use, and the decision to do so should be weighed carefully with your need to access existing data and dashboards.

For more information and further mitigation details, please refer to our [blog post on the security release](https://about.gitlab.com/2019/08/12/critical-security-release-gitlab-12-dot-1-dot-6-released/).
For more information and further mitigation details, please refer to our [blog post on the security release](https://about.gitlab.com/blog/2019/08/12/critical-security-release-gitlab-12-dot-1-dot-6-released/).

---

Expand Down
6 changes: 3 additions & 3 deletions doc/ci/README.md
Expand Up @@ -161,9 +161,9 @@ See also:
The following articles explain reasons to use GitLab CI/CD
for your CI/CD infrastructure:

- [Why we chose GitLab CI for our CI/CD solution](https://about.gitlab.com/2016/10/17/gitlab-ci-oohlala/)
- [Building our web-app on GitLab CI](https://about.gitlab.com/2016/07/22/building-our-web-app-on-gitlab-ci/)
- [5 Teams that made the switch to GitLab CI/CD](https://about.gitlab.com/2019/04/25/5-teams-that-made-the-switch-to-gitlab-ci-cd/)
- [Why we chose GitLab CI for our CI/CD solution](https://about.gitlab.com/blog/2016/10/17/gitlab-ci-oohlala/)
- [Building our web-app on GitLab CI](https://about.gitlab.com/blog/2016/07/22/building-our-web-app-on-gitlab-ci/)
- [5 Teams that made the switch to GitLab CI/CD](https://about.gitlab.com/blog/2019/04/25/5-teams-that-made-the-switch-to-gitlab-ci-cd/)

See also the [Why CI/CD?](https://docs.google.com/presentation/d/1OGgk2Tcxbpl7DJaIOzCX4Vqg3dlwfELC3u2jEeCBbDk) presentation.

Expand Down
2 changes: 1 addition & 1 deletion doc/ci/ci_cd_for_external_repos/index.md
Expand Up @@ -7,7 +7,7 @@ type: index, howto
>[Introduced][ee-4642] in [GitLab Premium][eep] 10.6.
NOTE: **Note:**
This feature [is available for free](https://about.gitlab.com/2019/09/09/ci-cd-github-extended-again/) to
This feature [is available for free](https://about.gitlab.com/blog/2019/09/09/ci-cd-github-extended-again/) to
GitLab.com users until March 22nd, 2020.

GitLab CI/CD can be used with:
Expand Down
2 changes: 1 addition & 1 deletion doc/ci/environments.md
Expand Up @@ -748,7 +748,7 @@ Re-using variables defined inside `script` as part of the environment name will
Below are some links you may find interesting:

- [The `.gitlab-ci.yml` definition of environments](yaml/README.md#environment)
- [A blog post on Deployments & Environments](https://about.gitlab.com/2016/08/26/ci-deployment-and-environments/)
- [A blog post on Deployments & Environments](https://about.gitlab.com/blog/2016/08/26/ci-deployment-and-environments/)
- [Review Apps - Use dynamic environments to deploy your code for every branch](review_apps/index.md)
- [Deploy Boards for your applications running on Kubernetes](../user/project/deploy_boards.md) **(PREMIUM)**

Expand Down

0 comments on commit 00c78fb

Please sign in to comment.