Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-10-21 12:10:30 +00:00
parent a7d30d92f8
commit 5e544154e1
14 changed files with 168 additions and 74 deletions

View File

@ -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
###############

View File

@ -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}<strong>${$2}</strong>${$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}<strong>${$2}</strong>${$3} <`);
},
highlighter,
};
}

View File

@ -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

View File

@ -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://<secondary url>/` 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://<secondary url>/' 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://<secondary url>/` 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://<secondary url>/' AND enabled = false;"
```
This should update 1 row.
### Message: ``NoMethodError: undefined method `secondary?' for nil:NilClass``

View File

@ -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

View File

@ -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)

View File

@ -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 <task-runner-pod-name> -- /srv/gitlab/bin/rails dbconsole -p
kubectl exec -it <task-runner-pod-name> -- /srv/gitlab/bin/rails dbconsole --include-password --database main
```
In GitLab 14.1 (chart 5.1) and earlier:
```shell
kubectl exec -it <task-runner-pod-name> -- /srv/gitlab/bin/rails dbconsole --include-password
```
- How to get information about Helm installation status:

View File

@ -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

View File

@ -250,7 +250,7 @@ return new Vue({
render(createElement) {
return createElement('my-component', {
props: {
username: gon.current_username,
avatarUrl: gl.avatarUrl,
},
});
},

View File

@ -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/)

View File

@ -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

View File

@ -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

View File

@ -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 ""

View File

@ -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 = '<li>couple (woman,woman) <gl-emoji data-name="couple_ww"></gl-emoji></li>';
expect(highlighter(li, ')')).toBe(
'<li> couple (woman,woman<strong>)</strong> <gl-emoji data-name="couple_ww"></gl-emoji></li>',
);
});
});
});