Commit 83d8c1d6 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 32d52eb6
......@@ -311,10 +311,7 @@ export default {
<gl-tooltip :target="() => $refs.graphTitle" :disabled="!showTitleTooltip">
{{ graphData.title }}
</gl-tooltip>
<div
class="prometheus-graph-widgets js-graph-widgets flex-fill"
data-qa-selector="prometheus_graph_widgets"
>
<div class="prometheus-graph-widgets js-graph-widgets flex-fill">
<slot></slot>
</div>
</div>
......
......@@ -342,7 +342,7 @@ export default {
</script>
<template>
<div class="prometheus-graphs" data-qa-selector="prometheus_graphs">
<div class="prometheus-graphs">
<div class="prometheus-graphs-header gl-p-3 pb-0 border-bottom bg-gray-light">
<div class="row">
<template v-if="environmentsEndpoint">
......
......@@ -138,7 +138,6 @@ export default {
v-gl-tooltip
class="ml-auto mx-3"
toggle-class="btn btn-transparent border-0"
data-qa-selector="prometheus_widgets_dropdown"
:right="true"
:no-caret="true"
:title="__('More actions')"
......@@ -162,11 +161,7 @@ export default {
>
{{ __('Generate link to chart') }}
</gl-dropdown-item>
<gl-dropdown-item
v-if="alertWidgetAvailable"
v-gl-modal="`alert-modal-${index}`"
data-qa-selector="alert_widget_menu_item"
>
<gl-dropdown-item v-if="alertWidgetAvailable" v-gl-modal="`alert-modal-${index}`">
{{ __('Alerts') }}
</gl-dropdown-item>
</gl-dropdown>
......
......@@ -331,7 +331,6 @@ export default {
:loading="isRetrying"
:disabled="isRetrying"
container-class="js-pipelines-retry-button btn btn-default btn-retry"
data-qa-selector="pipeline_retry_button"
@click="handleRetryClick"
>
<icon name="repeat" />
......
......@@ -232,7 +232,7 @@
- if project_nav_tab? :environments
= nav_link(controller: :environments, action: [:metrics, :metrics_redirect]) do
= link_to metrics_project_environments_path(@project), title: _('Metrics'), class: 'shortcuts-metrics', data: { qa_selector: 'operations_metrics_link' } do
= link_to metrics_project_environments_path(@project), title: _('Metrics'), class: 'shortcuts-metrics' do
%span
= _('Metrics')
......
---
title: 'Geo: Include host when logging'
merge_request: 22203
author:
type: other
......@@ -651,7 +651,7 @@ With `only`, individual keys are logically joined by an AND:
> NOT((any of refs) AND (any of variables) AND (any of changes) AND (if Kubernetes is active))
This, more intuitively, means the keys join by an OR. A functionally equivalent expression:
This means the keys are treated as if joined by an OR. This relationship could be described as:
> (any of refs) OR (any of variables) OR (any of changes) OR (if Kubernetes is active)
......
......@@ -56,6 +56,13 @@ for more details.
Make sure that in case that your migration job is going to be retried data
integrity is guaranteed.
## Background migrations for EE-only features
All the background migration classes for EE-only features should be present in GitLab CE.
For this purpose, an empty class can be created for GitLab CE and for GitLab EE it can be extended
For this purpose, an empty class can be created for GitLab CE, and it can be extended for GitLab EE
as explained in the [guidelines for implementing Enterprise Edition features](ee_features.md#code-in-libgitlabbackground_migration).
## How It Works
Background migrations are simple classes that define a `perform` method. A
......
......@@ -350,6 +350,55 @@ resolve when you add the indentation to the equation.
EE-specific views should be placed in `ee/app/views/`, using extra
sub-directories if appropriate.
### Code in `lib/gitlab/background_migration/`
When you create EE-only background migrations, you have to plan for users that
downgrade GitLab EE to CE. In other words, every EE-only migration has to be present in
CE code but with no implementation, instead you need to extend it on EE side.
GitLab CE:
```ruby
# lib/gitlab/background_migration/prune_orphaned_geo_events.rb
module Gitlab
module BackgroundMigration
class PruneOrphanedGeoEvents
def perform(table_name)
end
end
end
end
Gitlab::BackgroundMigration::PruneOrphanedGeoEvents.prepend_if_ee('EE::Gitlab::BackgroundMigration::PruneOrphanedGeoEvents')
```
GitLab EE:
```ruby
# ee/lib/ee/gitlab/background_migration/prune_orphaned_geo_events.rb
module EE
module Gitlab
module BackgroundMigration
module PruneOrphanedGeoEvents
extend ::Gitlab::Utils::Override
override :perform
def perform(table_name = EVENT_TABLES.first)
return if ::Gitlab::Database.read_only?
deleted_rows = prune_orphaned_rows(table_name)
table_name = next_table(table_name) if deleted_rows.zero?
::BackgroundMigrationWorker.perform_in(RESCHEDULE_DELAY, self.class.name.demodulize, table_name) if table_name
end
end
end
end
end
```
#### Using `render_if_exists`
Instead of using regular `render`, we should use `render_if_exists`, which
......
......@@ -195,6 +195,31 @@ For example use `%{created_at}` in Ruby but `%{createdAt}` in JavaScript. Make s
// => When x == 2: 'Last 2 days'
```
The `n_` method should only be used to fetch pluralized translations of the same
string, not to control the logic of showing different strings for different
quantities. Some languages have different quantities of target plural forms -
Chinese (simplified), for example, has only one target plural form in our
translation tool. This means the translator would have to choose to translate
only one of the strings and the translation would not behave as intended in the
other case.
For example, prefer to use:
```ruby
if selected_projects.one?
selected_projects.first.name
else
n__("Project selected", "%d projects selected", selected_projects.count)
end
```
rather than:
```ruby
# incorrect usage example
n_("%{project_name}", "%d projects selected", count) % { project_name: 'GitLab' }
```
### Namespaces
Sometimes you need to add some context to the text that you want to translate
......
......@@ -104,10 +104,10 @@ GitLab.com](https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/7356).
There are several strategies to provide high-availability and redundancy:
1. Write-ahead logs (WAL) streamed to object storage (e.g. S3, Google Cloud
Storage).
1. Read-replicas (hot backups)
1. Delayed replicas
- Write-ahead logs (WAL) streamed to object storage (e.g. S3, Google Cloud
Storage).
- Read-replicas (hot backups).
- Delayed replicas.
To restore a database from a point in time, a base backup needs to have
been taken prior to that incident. Once a database has restored from
......@@ -145,9 +145,9 @@ saturate a single core, which can result in slower response times for
background job and/or Web requests. There are two ways to address this
limitation:
1. Run multiple PgBouncer instances
1. Use a multi-threaded connection pooler (e.g.
[Odyssey](https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/7776).
- Run multiple PgBouncer instances.
- Use a multi-threaded connection pooler (e.g.
[Odyssey](https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/7776).
On some Linux systems, it's possible to run [multiple PgBouncer instances on
the same port](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4796).
......@@ -158,9 +158,9 @@ avoid saturating a single core.
In addition, the PgBouncer instances that communicate with the primary
and secondaries are set up a bit differently:
1. Multiple PgBouncer instances in different availability zones talk to the
PostgreSQL primary
1. Multiple PgBouncer processes are colocated with PostgreSQL read replicas
- Multiple PgBouncer instances in different availability zones talk to the
PostgreSQL primary.
- Multiple PgBouncer processes are colocated with PostgreSQL read replicas.
For replicas, colocating is advantageous because it reduces network hops
and hence latency. However, for the primary, colocating is
......@@ -211,10 +211,10 @@ Redis process.
#### High availability/Risks
1. Single-core: Like PgBouncer, a single Redis process can only use one
Single-core: Like PgBouncer, a single Redis process can only use one
core. It does not support multi-threading.
1. Dumb secondaries: Redis secondaries (aka slaves) don't actually
Dumb secondaries: Redis secondaries (aka slaves) don't actually
handle any load. Unlike PostgreSQL secondaries, they don't even serve
read queries. They simply replicate data from the primary and take over
only when the primary fails.
......@@ -240,10 +240,10 @@ Sidekiq is a multi-threaded, background job processing system used in
Ruby on Rails applications. In GitLab, Sidekiq performs the heavy
lifting of many activities, including:
1. Updating merge requests after a push
1. Sending e-mails
1. Updating user authorizations
1. Processing CI builds and pipelines
- Updating merge requests after a push.
- Sending e-mails.
- Updating user authorizations.
- Processing CI builds and pipelines.
The full list of jobs can be found in the
[app/workers](https://gitlab.com/gitlab-org/gitlab/tree/master/app/workers)
......
......@@ -634,6 +634,10 @@ before attempting to perform it in a production environment.
You can only restore a backup to **exactly the same version and type (CE/EE)** of
GitLab that you created it on, for example CE 9.1.0.
If your backup is a different version than the current installation, you will
need to [downgrade your GitLab installation](https://docs.gitlab.com/omnibus/update/README.html#downgrading)
before restoring the backup.
### Restore prerequisites
You need to have a working GitLab installation before you can perform
......
......@@ -5742,11 +5742,6 @@ msgstr ""
msgid "CycleAnalyticsStage|should be under a group"
msgstr ""
msgid "CycleAnalytics|%{projectName}"
msgid_plural "CycleAnalytics|%d projects selected"
msgstr[0] ""
msgstr[1] ""
msgid "CycleAnalytics|%{stageCount} stages selected"
msgstr ""
......@@ -5768,6 +5763,11 @@ msgstr ""
msgid "CycleAnalytics|Number of tasks"
msgstr ""
msgid "CycleAnalytics|Project selected"
msgid_plural "CycleAnalytics|%d projects selected"
msgstr[0] ""
msgstr[1] ""
msgid "CycleAnalytics|Select labels"
msgstr ""
......
......@@ -289,8 +289,6 @@ module QA
autoload :AddExisting, 'qa/page/project/operations/kubernetes/add_existing'
autoload :Show, 'qa/page/project/operations/kubernetes/show'
end
autoload :Metrics, 'qa/page/project/operations/metrics'
end
module Wiki
......
This diff is collapsed.
# frozen_string_literal: true
module QA
module Page
module Project
module Operations
class Metrics < Page::Base
EXPECTED_TITLE = 'Memory Usage (Total)'
EXPECTED_LABEL = 'Total (GB)'
LOADING_MESSAGE = 'Waiting for performance data'
view 'app/assets/javascripts/monitoring/components/dashboard.vue' do
element :prometheus_graphs
end
view 'app/assets/javascripts/monitoring/components/charts/time_series.vue' do
element :prometheus_graph_widgets
end
view 'app/assets/javascripts/monitoring/components/panel_type.vue' do
element :prometheus_widgets_dropdown
element :alert_widget_menu_item
end
view 'ee/app/assets/javascripts/monitoring/components/alert_widget_form.vue' do
element :alert_query_dropdown
element :alert_query_option
element :alert_threshold_field
end
def wait_for_metrics
wait_for_data
return if has_metrics?
wait_until(max_duration: 180) do
wait_for_data
has_metrics?
end
end
def wait_for_data
wait_until(reload: false) { !has_text?(LOADING_MESSAGE) } if has_text?(LOADING_MESSAGE)
end
def has_metrics?
within_element :prometheus_graphs do
has_text?(EXPECTED_TITLE)
end
end
def wait_for_alert(operator = '>', threshold = 0)
wait_until(reload: false) { has_alert?(operator, threshold) }
end
def has_alert?(operator = '>', threshold = 0)
within_element :prometheus_graphs do
has_text?([EXPECTED_LABEL, operator, threshold].join(' '))
end
end
def write_first_alert(operator = '>', threshold = 0)
open_first_alert_modal
click_on operator
fill_element :alert_threshold_field, threshold
within('.modal-content') { click_button(class: 'btn-success') }
end
def delete_first_alert
open_first_alert_modal
within('.modal-content') { click_button(class: 'btn-danger') }
wait_for_requests
end
def open_first_alert_modal
all_elements(:prometheus_widgets_dropdown, minimum: 1).first.click
click_element :alert_widget_menu_item
click_element :alert_query_dropdown unless has_element?(:alert_query_option, wait: 3)
all_elements(:alert_query_option, minimum: 1).first.click
end
end
end
end
end
end
......@@ -9,7 +9,6 @@ module QA::Page
view 'app/assets/javascripts/pipelines/components/pipelines_table_row.vue' do
element :pipeline_commit_status
element :pipeline_retry_button
end
def click_on_latest_pipeline
......@@ -19,25 +18,10 @@ module QA::Page
end
def wait_for_latest_pipeline_success
wait_for_latest_pipeline_status { has_text?('passed') }
end
def wait_for_latest_pipeline_completion
wait_for_latest_pipeline_status { has_text?('passed') || has_text?('failed') }
end
def wait_for_latest_pipeline_status
wait_until(reload: false, max_duration: 300) do
within_element_by_index(:pipeline_commit_status, 0) { yield }
end
end
def wait_for_latest_pipeline_success_or_retry
wait_for_latest_pipeline_completion
if has_text?('failed')
click_element :pipeline_retry_button
wait_for_latest_pipeline_success
within_element_by_index(:pipeline_commit_status, 0) do
has_text?('passed')
end
end
end
end
......
......@@ -12,7 +12,6 @@ module QA
view 'app/views/layouts/nav/sidebar/_project.html.haml' do
element :link_operations
element :operations_environments_link
element :operations_metrics_link
end
end
end
......@@ -25,14 +24,6 @@ module QA
end
end
def go_to_operations_metrics
hover_operations do
within_submenu do
click_element(:operations_metrics_link)
end
end
end
def go_to_operations_kubernetes
hover_operations do
within_submenu 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