From 5e544154e1dadfaded22a8f37206b32b4dc27014 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 21 Oct 2021 12:10:30 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitlab/ci/rules.gitlab-ci.yml | 1 + app/assets/javascripts/gfm_auto_complete.js | 24 +++---- app/assets/javascripts/ide/constants.js | 2 +- .../geo/replication/troubleshooting.md | 30 ++++++--- doc/administration/postgresql/external.md | 2 +- doc/administration/postgresql/index.md | 37 +++++------ .../troubleshooting/kubernetes_cheat_sheet.md | 10 ++- .../troubleshooting/postgresql.md | 3 +- doc/development/fe_guide/vue.md | 2 +- doc/development/snowplow/index.md | 13 +--- doc/raketasks/backup_restore.md | 66 ++++++++++++++++--- doc/update/package/index.md | 37 +++++++---- locale/gitlab.pot | 3 + spec/frontend/gfm_auto_complete_spec.js | 12 +++- 14 files changed, 168 insertions(+), 74 deletions(-) diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 996e32f79b2..6dc2f23f737 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -707,6 +707,7 @@ when: never - <<: *if-dot-com-gitlab-org-and-security-merge-request changes: *feature-flag-config-patterns + when: manual allow_failure: true ############### diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index cb63c86a4fa..69331ff1a06 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -1,6 +1,6 @@ import $ from 'jquery'; import '~/lib/utils/jquery_at_who'; -import { escape as lodashEscape, sortBy, template } from 'lodash'; +import { escape as lodashEscape, sortBy, template, escapeRegExp } from 'lodash'; import * as Emoji from '~/emoji'; import axios from '~/lib/utils/axios_utils'; import { s__, __, sprintf } from '~/locale'; @@ -65,6 +65,17 @@ export function membersBeforeSave(members) { }); } +export const highlighter = (li, query) => { + // override default behaviour to escape dot character + // see https://github.com/ichord/At.js/pull/576 + if (!query) { + return li; + } + const escapedQuery = escapeRegExp(query); + const regexp = new RegExp(`>\\s*([^<]*?)(${escapedQuery})([^<]*)\\s*<`, 'ig'); + return li.replace(regexp, (str, $1, $2, $3) => `> ${$1}${$2}${$3} <`); +}; + export const defaultAutocompleteConfig = { emojis: true, members: true, @@ -664,16 +675,7 @@ class GfmAutoComplete { } return null; }, - highlighter(li, query) { - // override default behaviour to escape dot character - // see https://github.com/ichord/At.js/pull/576 - if (!query) { - return li; - } - const escapedQuery = query.replace(/[.+]/, '\\$&'); - const regexp = new RegExp(`>\\s*([^<]*?)(${escapedQuery})([^<]*)\\s*<`, 'ig'); - return li.replace(regexp, (str, $1, $2, $3) => `> ${$1}${$2}${$3} <`); - }, + highlighter, }; } diff --git a/app/assets/javascripts/ide/constants.js b/app/assets/javascripts/ide/constants.js index 4845b667b40..706d98fdb90 100644 --- a/app/assets/javascripts/ide/constants.js +++ b/app/assets/javascripts/ide/constants.js @@ -5,7 +5,7 @@ export const MAX_TITLE_LENGTH = 50; export const MAX_BODY_LENGTH = 72; export const SIDEBAR_INIT_WIDTH = 340; -export const SIDEBAR_MIN_WIDTH = 340; +export const SIDEBAR_MIN_WIDTH = 260; export const SIDEBAR_NAV_WIDTH = 60; // File view modes diff --git a/doc/administration/geo/replication/troubleshooting.md b/doc/administration/geo/replication/troubleshooting.md index 8fe27f3520c..8aed0eb69ab 100644 --- a/doc/administration/geo/replication/troubleshooting.md +++ b/doc/administration/geo/replication/troubleshooting.md @@ -723,17 +723,31 @@ If you disabled a secondary node, either with the [replication pause task](../in (13.2) or by using the user interface (13.1 and earlier), you must first re-enable the node before you can continue. This is fixed in 13.4. -Run the following command, replacing `https:///` with the URL -for your secondary server, using either `http` or `https`, and ensuring that you -end the URL with a slash (`/`): +This can be fixed in the database. -```shell -sudo gitlab-rails dbconsole +1. Start a database console: -UPDATE geo_nodes SET enabled = true WHERE url = 'https:///' AND enabled = false;" -``` + In [GitLab 14.2 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/341210): -This should update 1 row. + ```shell + sudo gitlab-rails dbconsole --database main + ``` + + In GitLab 14.1 and earlier: + + ```shell + sudo gitlab-rails dbconsole + ``` + +1. Run the following command, replacing `https:///` with the URL + for your secondary server. You can use either `http` or `https`, but ensure that you + end the URL with a slash (`/`): + + ```sql + UPDATE geo_nodes SET enabled = true WHERE url = 'https:///' AND enabled = false;" + ``` + + This should update 1 row. ### Message: ``NoMethodError: undefined method `secondary?' for nil:NilClass`` diff --git a/doc/administration/postgresql/external.md b/doc/administration/postgresql/external.md index 8f0fe0ace87..67c5448a8a0 100644 --- a/doc/administration/postgresql/external.md +++ b/doc/administration/postgresql/external.md @@ -4,7 +4,7 @@ group: Database info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- -# Configure GitLab using an external PostgreSQL service +# Configure GitLab using an external PostgreSQL service **(FREE SELF)** If you're hosting GitLab on a cloud provider, you can optionally use a managed service for PostgreSQL. For example, AWS offers a managed Relational diff --git a/doc/administration/postgresql/index.md b/doc/administration/postgresql/index.md index bce78bbccff..fb0fa9ae7b6 100644 --- a/doc/administration/postgresql/index.md +++ b/doc/administration/postgresql/index.md @@ -2,15 +2,31 @@ stage: Enablement group: Database info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -type: reference --- -# Configuring PostgreSQL for scaling +# Configuring PostgreSQL for scaling **(FREE SELF)** In this section, you'll be guided through configuring a PostgreSQL database to be used with GitLab in one of our [reference architectures](../reference_architectures/index.md). There are essentially three setups to choose from. +## Standalone PostgreSQL using Omnibus GitLab + +This setup is for when you have installed the +[Omnibus GitLab packages](https://about.gitlab.com/install/) (CE or EE), +to use the bundled PostgreSQL having only its service enabled. + +[> Read how to set up a standalone PostgreSQL instance using Omnibus GitLab](standalone.md) + +## Provide your own PostgreSQL instance + +This setup is for when you have installed GitLab using the +[Omnibus GitLab packages](https://about.gitlab.com/install/) (CE or EE), +or installed it [from source](../../install/installation.md), but you want to use +your own external PostgreSQL server. + +[> Read how to set up an external PostgreSQL instance](external.md) + ## PostgreSQL replication and failover with Omnibus GitLab **(PREMIUM SELF)** This setup is for when you have installed GitLab using the @@ -20,20 +36,3 @@ All the tools that are needed like PostgreSQL, PgBouncer, and Patroni are bundle the package, so you can it to set up the whole PostgreSQL infrastructure (primary, replica). [> Read how to set up PostgreSQL replication and failover using Omnibus GitLab](replication_and_failover.md) - -## Standalone PostgreSQL using Omnibus GitLab **(FREE SELF)** - -This setup is for when you have installed the -[Omnibus GitLab packages](https://about.gitlab.com/install/) (CE or EE), -to use the bundled PostgreSQL having only its service enabled. - -[> Read how to set up a standalone PostgreSQL instance using Omnibus GitLab](standalone.md) - -## Provide your own PostgreSQL instance **(FREE SELF)** - -This setup is for when you have installed GitLab using the -[Omnibus GitLab packages](https://about.gitlab.com/install/) (CE or EE), -or installed it [from source](../../install/installation.md), but you want to use -your own external PostgreSQL server. - -[> Read how to set up an external PostgreSQL instance](external.md) diff --git a/doc/administration/troubleshooting/kubernetes_cheat_sheet.md b/doc/administration/troubleshooting/kubernetes_cheat_sheet.md index abeba514e4b..64a6979c016 100644 --- a/doc/administration/troubleshooting/kubernetes_cheat_sheet.md +++ b/doc/administration/troubleshooting/kubernetes_cheat_sheet.md @@ -165,8 +165,16 @@ and they will assist you with any issues you are having. - How to connect to a GitLab PostgreSQL database: + In GitLab 14.2 (chart 5.2) and later: + ```shell - kubectl exec -it -- /srv/gitlab/bin/rails dbconsole -p + kubectl exec -it -- /srv/gitlab/bin/rails dbconsole --include-password --database main + ``` + + In GitLab 14.1 (chart 5.1) and earlier: + + ```shell + kubectl exec -it -- /srv/gitlab/bin/rails dbconsole --include-password ``` - How to get information about Helm installation status: diff --git a/doc/administration/troubleshooting/postgresql.md b/doc/administration/troubleshooting/postgresql.md index 3df957bacf9..f8cb45dd00d 100644 --- a/doc/administration/troubleshooting/postgresql.md +++ b/doc/administration/troubleshooting/postgresql.md @@ -2,10 +2,9 @@ stage: Enablement group: Database info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -type: reference --- -# PostgreSQL +# PostgreSQL **(FREE SELF)** This page contains information about PostgreSQL the GitLab Support team uses when troubleshooting. GitLab makes this information public, so that anyone can diff --git a/doc/development/fe_guide/vue.md b/doc/development/fe_guide/vue.md index 7c1bd5ea1f0..5d5d37e0398 100644 --- a/doc/development/fe_guide/vue.md +++ b/doc/development/fe_guide/vue.md @@ -250,7 +250,7 @@ return new Vue({ render(createElement) { return createElement('my-component', { props: { - username: gon.current_username, + avatarUrl: gl.avatarUrl, }, }); }, diff --git a/doc/development/snowplow/index.md b/doc/development/snowplow/index.md index b8b35857adf..f4f41221699 100644 --- a/doc/development/snowplow/index.md +++ b/doc/development/snowplow/index.md @@ -6,10 +6,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w # Snowplow -This page provides an overview of how Snowplow works and how to enable it. - -## What is Snowplow - Snowplow is an enterprise-grade marketing and Product Intelligence platform that tracks how users engage with our website and application. [Snowplow](https://snowplowanalytics.com) consists of several loosely-coupled sub-systems: @@ -23,12 +19,6 @@ Snowplow is an enterprise-grade marketing and Product Intelligence platform that ![snowplow_flow](../img/snowplow_flow.png) -### Useful links - -- [Snowplow data structure](https://docs.snowplowanalytics.com/docs/understanding-your-pipeline/canonical-event/) -- [Our Iglu schema registry](https://gitlab.com/gitlab-org/iglu) -- [List of events used in our codebase (Event Dictionary)](https://metrics.gitlab.com/snowplow.html) - ## Enable Snowplow tracking Tracking can be enabled at: @@ -165,6 +155,9 @@ Snowplow JavaScript adds [web-specific parameters](https://docs.snowplowanalytic ## Related topics +- [Snowplow data structure](https://docs.snowplowanalytics.com/docs/understanding-your-pipeline/canonical-event/) +- [Our Iglu schema registry](https://gitlab.com/gitlab-org/iglu) +- [List of events used in our codebase (Event Dictionary)](https://metrics.gitlab.com/snowplow.html) - [Product Intelligence Guide](https://about.gitlab.com/handbook/product/product-intelligence-guide/) - [Service Ping Guide](../service_ping/index.md) - [Product Intelligence Direction](https://about.gitlab.com/direction/product-intelligence/) diff --git a/doc/raketasks/backup_restore.md b/doc/raketasks/backup_restore.md index 6a787b6c900..8cf5dfc4206 100644 --- a/doc/raketasks/backup_restore.md +++ b/doc/raketasks/backup_restore.md @@ -409,6 +409,8 @@ For Omnibus GitLab packages: ##### S3 Encrypted Buckets +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64765) in GitLab 14.3. + AWS supports these [modes for server side encryption](https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html): - Amazon S3-Managed Keys (SSE-S3) @@ -1377,18 +1379,30 @@ after which users must reactivate 2FA. 1. Enter the database console: - For Omnibus GitLab packages: + For Omnibus GitLab 14.1 and earlier: ```shell sudo gitlab-rails dbconsole ``` - For installations from source: + For Omnibus GitLab 14.2 and later: + + ```shell + sudo gitlab-rails dbconsole --database main + ``` + + For installations from source, GitLab 14.1 and earlier: ```shell sudo -u git -H bundle exec rails dbconsole -e production ``` + For installations from source, GitLab 14.2 and later: + + ```shell + sudo -u git -H bundle exec rails dbconsole -e production --database main + ``` + 1. Examine the `ci_group_variables` and `ci_variables` tables: ```sql @@ -1411,18 +1425,30 @@ You may need to reconfigure or restart GitLab for the changes to take effect. 1. Enter the database console: - For Omnibus GitLab packages: + For Omnibus GitLab 14.1 and earlier: ```shell sudo gitlab-rails dbconsole ``` - For installations from source: + For Omnibus GitLab 14.2 and later: + + ```shell + sudo gitlab-rails dbconsole --database main + ``` + + For installations from source, GitLab 14.1 and earlier: ```shell sudo -u git -H bundle exec rails dbconsole -e production ``` + For installations from source, GitLab 14.2 and later: + + ```shell + sudo -u git -H bundle exec rails dbconsole -e production --database main + ``` + 1. Clear all tokens for projects, groups, and the entire instance: WARNING: @@ -1448,18 +1474,30 @@ You may need to reconfigure or restart GitLab for the changes to take effect. 1. Enter the database console: - For Omnibus GitLab packages: + For Omnibus GitLab 14.1 and earlier: ```shell sudo gitlab-rails dbconsole ``` - For installations from source: + For Omnibus GitLab 14.2 and later: + + ```shell + sudo gitlab-rails dbconsole --database main + ``` + + For installations from source, GitLab 14.1 and earlier: ```shell sudo -u git -H bundle exec rails dbconsole -e production ``` + For installations from source, GitLab 14.2 and later: + + ```shell + sudo -u git -H bundle exec rails dbconsole -e production --database main + ``` + 1. Clear all the tokens for pending jobs: ```sql @@ -1480,18 +1518,30 @@ The fix is to truncate the `web_hooks` table: 1. Enter the database console: - For Omnibus GitLab packages: + For Omnibus GitLab 14.1 and earlier: ```shell sudo gitlab-rails dbconsole ``` - For installations from source: + For Omnibus GitLab 14.2 and later: + + ```shell + sudo gitlab-rails dbconsole --database main + ``` + + For installations from source, GitLab 14.1 and earlier: ```shell sudo -u git -H bundle exec rails dbconsole -e production ``` + For installations from source, GitLab 14.2 and later: + + ```shell + sudo -u git -H bundle exec rails dbconsole -e production --database main + ``` + 1. Truncate the table: ```sql diff --git a/doc/update/package/index.md b/doc/update/package/index.md index 776a7111188..27845caed76 100644 --- a/doc/update/package/index.md +++ b/doc/update/package/index.md @@ -262,21 +262,36 @@ unable to add the `commit_message_regex_change` column. This results in the [backport migration of EE tables](https://gitlab.com/gitlab-org/gitlab/-/blob/cf00e431024018ddd82158f8a9210f113d0f4dbc/db/migrate/20190402150158_backport_enterprise_schema.rb#L1619) not working correctly. The backport migration assumes that certain tables in the database do not exist when running CE. -To fix this issue, manually add the missing `commit_message_negative_regex` column and restart GitLab: +To fix this issue: -```shell -# Access psql -sudo gitlab-rails dbconsole +1. Start a database console: -# Add the missing column -ALTER TABLE push_rules ADD COLUMN commit_message_negative_regex VARCHAR; + In GitLab 14.2 and later: -# Exit psql -\q + ```shell + sudo gitlab-rails dbconsole --database main + ``` -# Restart GitLab -sudo gitlab-ctl restart -``` + In GitLab 14.1 and earlier: + + ```shell + sudo gitlab-rails dbconsole + ``` + +1. Manually add the missing `commit_message_negative_regex` column: + + ```sql + ALTER TABLE push_rules ADD COLUMN commit_message_negative_regex VARCHAR; + + # Exit psql + \q + ``` + +1. Restart GitLab: + + ```shell + sudo gitlab-ctl restart + ``` ### Error `Failed to connect to the internal GitLab API` on a separate GitLab Pages server diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 3dc87e4112b..bc98c157f5d 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -27800,6 +27800,9 @@ msgstr "" msgid "Protip: %{linkStart}Auto DevOps%{linkEnd} uses Kubernetes clusters to deploy your code!" msgstr "" +msgid "Provide a number our sales team can use to call you." +msgstr "" + msgid "Provider" msgstr "" diff --git a/spec/frontend/gfm_auto_complete_spec.js b/spec/frontend/gfm_auto_complete_spec.js index eb11df2fe43..631e3307f7f 100644 --- a/spec/frontend/gfm_auto_complete_spec.js +++ b/spec/frontend/gfm_auto_complete_spec.js @@ -2,7 +2,7 @@ import MockAdapter from 'axios-mock-adapter'; import $ from 'jquery'; import labelsFixture from 'test_fixtures/autocomplete_sources/labels.json'; -import GfmAutoComplete, { membersBeforeSave } from 'ee_else_ce/gfm_auto_complete'; +import GfmAutoComplete, { membersBeforeSave, highlighter } from 'ee_else_ce/gfm_auto_complete'; import { initEmojiMock } from 'helpers/emoji'; import '~/lib/utils/jquery_at_who'; import { TEST_HOST } from 'helpers/test_constants'; @@ -858,4 +858,14 @@ describe('GfmAutoComplete', () => { ); }); }); + + describe('highlighter', () => { + it('escapes regex', () => { + const li = '
  • couple (woman,woman)
  • '; + + expect(highlighter(li, ')')).toBe( + '
  • couple (woman,woman)
  • ', + ); + }); + }); });