diff --git a/app/assets/stylesheets/framework/typography.scss b/app/assets/stylesheets/framework/typography.scss index 1afcbc6d514..6e07a2b5de1 100644 --- a/app/assets/stylesheets/framework/typography.scss +++ b/app/assets/stylesheets/framework/typography.scss @@ -545,6 +545,24 @@ } } } + + /* AsciiDoc(tor) built-in alignment roles */ + + .text-left { + text-align: left !important; + } + + .text-right { + text-align: right !important; + } + + .text-center { + text-align: center !important; + } + + .text-justify { + text-align: justify !important; + } } /** diff --git a/app/models/concerns/cache_markdown_field.rb b/app/models/concerns/cache_markdown_field.rb index e4e0f55d5f4..04eb4659469 100644 --- a/app/models/concerns/cache_markdown_field.rb +++ b/app/models/concerns/cache_markdown_field.rb @@ -102,7 +102,7 @@ module CacheMarkdownField def updated_cached_html_for(markdown_field) return unless cached_markdown_fields.markdown_fields.include?(markdown_field) - refresh_markdown_cache if attribute_invalidated?(cached_markdown_fields.html_field(markdown_field)) + refresh_markdown_cache! if attribute_invalidated?(cached_markdown_fields.html_field(markdown_field)) cached_html_for(markdown_field) end diff --git a/app/services/import/github_service.rb b/app/services/import/github_service.rb index 3c57fada677..0cf17568c78 100644 --- a/app/services/import/github_service.rb +++ b/app/services/import/github_service.rb @@ -10,15 +10,26 @@ module Import return error(_('This namespace has already been taken! Please choose another one.'), :unprocessable_entity) end - project = Gitlab::LegacyGithubImport::ProjectCreator - .new(repo, project_name, target_namespace, current_user, access_params, type: provider) - .execute(extra_project_attrs) + project = create_project(access_params, provider) if project.persisted? success(project) else error(project_save_error(project), :unprocessable_entity) end + rescue Octokit::Error => e + log_error(e) + end + + def create_project(access_params, provider) + Gitlab::LegacyGithubImport::ProjectCreator.new( + repo, + project_name, + target_namespace, + current_user, + access_params, + type: provider + ).execute(extra_project_attrs) end def repo @@ -44,6 +55,18 @@ module Import def authorized? can?(current_user, :create_projects, target_namespace) end + + private + + def log_error(exception) + Gitlab::Import::Logger.error( + message: 'Import failed due to a GitHub error', + status: exception.response_status, + error: exception.response_body + ) + + error(_('Import failed due to a GitHub error: %{original}') % { original: exception.response_body }, :unprocessable_entity) + end end end diff --git a/changelogs/unreleased/218745-single-issue-api-performance-regression-degraded-by-8000ms-after-u.yml b/changelogs/unreleased/218745-single-issue-api-performance-regression-degraded-by-8000ms-after-u.yml new file mode 100644 index 00000000000..dafb281b779 --- /dev/null +++ b/changelogs/unreleased/218745-single-issue-api-performance-regression-degraded-by-8000ms-after-u.yml @@ -0,0 +1,5 @@ +--- +title: Fix issue and MR API performance regression when Markdown cache is stale +merge_request: 33235 +author: +type: fixed diff --git a/changelogs/unreleased/asciidoc-alignment-roles.yml b/changelogs/unreleased/asciidoc-alignment-roles.yml new file mode 100644 index 00000000000..d53d3705243 --- /dev/null +++ b/changelogs/unreleased/asciidoc-alignment-roles.yml @@ -0,0 +1,5 @@ +--- +title: 'AsciiDoc: Add support for built-in alignment roles.' +merge_request: 32928 +author: mnrvwl +type: fixed diff --git a/changelogs/unreleased/fj-bump-lfs-token-default-expiration-time.yml b/changelogs/unreleased/fj-bump-lfs-token-default-expiration-time.yml new file mode 100644 index 00000000000..c0dc036f79f --- /dev/null +++ b/changelogs/unreleased/fj-bump-lfs-token-default-expiration-time.yml @@ -0,0 +1,5 @@ +--- +title: Increase LFS token default time to 2 hours +merge_request: 33140 +author: +type: changed diff --git a/doc/.vale/gitlab/CurlStringsQuoted.yml b/doc/.vale/gitlab/CurlStringsQuoted.yml new file mode 100644 index 00000000000..9c8c8ab42c6 --- /dev/null +++ b/doc/.vale/gitlab/CurlStringsQuoted.yml @@ -0,0 +1,13 @@ +--- +# Error: gitlab.CurlStringsQuoted +# +# Ensures all codeblocks using curl quote any URL strings. +# +# For a list of all options, see https://errata-ai.github.io/vale/styles/ +extends: existence +message: 'Curl commands must wrap URLs in double quotes ("): %s' +link: https://docs.gitlab.com/ee/development/documentation/styleguide.html#code-blocks +level: warning +scope: code +raw: + - 'curl.*[^"=]https?://.*' diff --git a/doc/administration/gitaly/index.md b/doc/administration/gitaly/index.md index 43b96a02f41..ed71e8fe440 100644 --- a/doc/administration/gitaly/index.md +++ b/doc/administration/gitaly/index.md @@ -6,9 +6,14 @@ components can read or write Git data. GitLab components that access Git repositories (GitLab Rails, GitLab Shell, GitLab Workhorse, etc.) act as clients to Gitaly. End users do not have direct access to Gitaly. -On this page, *Gitaly server* refers to a standalone node that only runs Gitaly -and *Gitaly client* is a GitLab Rails app node that runs all other processes -except Gitaly. +On this page: + +- **Gitaly server** refers to any node that runs Gitaly itself. +- **Gitaly client** refers to any node that runs a process that makes requests of the + Gitaly server. Processes include, but are not limited to: + - GitLab Rails application. + - GitLab Shell. + - GitLab Workhorse. CAUTION: **Caution:** From GitLab 13.0, using NFS for Git repositories is deprecated. In GitLab 14.0, @@ -43,7 +48,8 @@ This is an optional way to deploy Gitaly which can benefit GitLab installations that are larger than a single machine. Most installations will be better served with the default configuration used by Omnibus and the GitLab source installation guide. -Follow transition to Gitaly on its own server, [Gitaly servers will need to be upgraded before other servers in your cluster](https://docs.gitlab.com/omnibus/update/#upgrading-gitaly-servers). +Following transition to Gitaly on its own server, +[Gitaly servers will need to be upgraded before Gitaly clients in your cluster](https://docs.gitlab.com/omnibus/update/#upgrading-gitaly-servers). Starting with GitLab 11.4, Gitaly is able to serve all Git requests without requiring a shared NFS mount for Git repository data. @@ -51,7 +57,7 @@ Between 11.4 and 11.8 the exception was the [Elasticsearch indexer](https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer). But since 11.8 the indexer uses Gitaly for data access as well. NFS can still be leveraged for redundancy on block level of the Git data. But only has to -be mounted on the Gitaly server. +be mounted on the Gitaly servers. From GitLab v11.8 to v12.2, it is possible to use Elasticsearch in conjunction with a Gitaly setup that isn't utilising NFS. In order to use Elasticsearch in this @@ -71,7 +77,7 @@ The following list depicts what the network architecture of Gitaly is: topology. - A `(Gitaly address, Gitaly token)` corresponds to a Gitaly server. - A Gitaly server hosts one or more storages. -- A GitLab server can use one or more Gitaly servers. +- A Gitaly client can use one or more Gitaly servers. - Gitaly addresses must be specified in such a way that they resolve correctly for ALL Gitaly clients. - Gitaly clients are: Puma/Unicorn, Sidekiq, GitLab Workhorse, @@ -109,20 +115,19 @@ Omnibus GitLab or install it from source: ### 2. Authentication Gitaly and GitLab use two shared secrets for authentication, one to authenticate gRPC requests -to Gitaly, and a second for authentication callbacks from GitLab-Shell to the GitLab internal API. +to Gitaly, and a second for authentication callbacks from GitLab Shell to the GitLab internal API. **For Omnibus GitLab** To configure the Gitaly token: -1. On the client server, edit `/etc/gitlab/gitlab.rb`: +1. On the Gitaly clients, edit `/etc/gitlab/gitlab.rb`: ```ruby gitlab_rails['gitaly_token'] = 'abc123secret' ``` 1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure). - 1. On the Gitaly server, edit `/etc/gitlab/gitlab.rb`: ```ruby @@ -131,22 +136,21 @@ To configure the Gitaly token: 1. [Reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure). -There are two ways to configure the GitLab-Shell token: +There are two ways to configure the GitLab Shell token: -1. Copy `/etc/gitlab/gitlab-secrets.json` from the client server to same path on the Gitaly server. -1. [Reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure). +1. Copy `/etc/gitlab/gitlab-secrets.json` from the Gitaly client to same path on the Gitaly servers (and any other Gitaly clients). +1. [Reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) on Gitaly servers. **OR** -1. On the client server, edit `/etc/gitlab/gitlab.rb`: +1. On the Gitaly clients, edit `/etc/gitlab/gitlab.rb`: ```ruby gitlab_shell['secret_token'] = 'shellsecret' ``` 1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure). - -1. On the Gitaly server, edit `/etc/gitlab/gitlab.rb`: +1. On the Gitaly servers, edit `/etc/gitlab/gitlab.rb`: ```ruby gitlab_shell['secret_token'] = 'shellsecret' @@ -156,9 +160,9 @@ There are two ways to configure the GitLab-Shell token: **For installations from source** -1. Copy `/home/git/gitlab/.gitlab_shell_secret` from the client server to the same path on the Gitaly -server. -1. On the client server, edit `/home/git/gitlab/config/gitlab.yml`: +1. Copy `/home/git/gitlab/.gitlab_shell_secret` from the Gitaly client to the same path on the Gitaly +servers (and any other Gitaly clients). +1. On the Gitaly clients, edit `/home/git/gitlab/config/gitlab.yml`: ```yaml gitlab: @@ -166,12 +170,20 @@ server. token: 'abc123secret' ``` +1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source). +1. On the Gitaly servers, edit `/home/git/gitaly/config.toml`: + + ```toml + [auth] + token = 'abc123secret' + ``` + 1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source). ### 3. Gitaly server configuration -Next, on the Gitaly servers, you need to configure storage paths, enable -the network listener and configure the token. +Next, on the Gitaly servers, you need to configure storage paths and enable +the network listener. NOTE: **Note:** If you want to reduce the risk of downtime when you enable authentication you can temporarily disable enforcement, see [the @@ -221,7 +233,7 @@ authentication](https://gitlab.com/gitlab-org/gitaly/blob/master/doc/configurati # Configure the gitlab-shell API callback URL. Without this, `git push` will # fail. This can be your 'front door' GitLab URL or an internal load # balancer. - # Don't forget to copy `/etc/gitlab/gitlab-secrets.json` from web server to Gitaly server. + # Don't forget to copy `/etc/gitlab/gitlab-secrets.json` from Gitaly client to Gitaly server. gitlab_rails['internal_api_url'] = 'https://gitlab.example.com' # Make Gitaly accept connections on all network interfaces. You must use @@ -230,7 +242,7 @@ authentication](https://gitlab.com/gitlab-org/gitaly/blob/master/doc/configurati gitaly['listen_addr'] = "0.0.0.0:8075" ``` -1. Append the following to `/etc/gitlab/gitlab.rb` for each respective server: +1. Append the following to `/etc/gitlab/gitlab.rb` for each respective Gitaly server: