Commit 2b67531b authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent ed58c351
...@@ -43,7 +43,8 @@ class PostReceive ...@@ -43,7 +43,8 @@ class PostReceive
return false unless user return false unless user
# We only need to expire certain caches once per push # We only need to expire certain caches once per push
expire_caches(post_received) expire_caches(post_received, post_received.project.repository)
enqueue_repository_cache_update(post_received)
post_received.enum_for(:changes_refs).with_index do |(oldrev, newrev, ref), index| post_received.enum_for(:changes_refs).with_index do |(oldrev, newrev, ref), index|
service_klass = service_klass =
...@@ -72,18 +73,14 @@ class PostReceive ...@@ -72,18 +73,14 @@ class PostReceive
after_project_changes_hooks(post_received, user, refs.to_a, changes) after_project_changes_hooks(post_received, user, refs.to_a, changes)
end end
# Expire the project, branch, and tag cache once per push. Schedule an # Expire the repository status, branch, and tag cache once per push.
# update for the repository size and commit count if necessary. def expire_caches(post_received, repository)
def expire_caches(post_received) repository.expire_status_cache if repository.empty?
project = post_received.project repository.expire_branches_cache if post_received.includes_branches?
repository.expire_caches_for_tags if post_received.includes_tags?
project.repository.expire_status_cache if project.empty_repo?
project.repository.expire_branches_cache if post_received.includes_branches?
project.repository.expire_caches_for_tags if post_received.includes_tags?
enqueue_repository_cache_update(post_received)
end end
# Schedule an update for the repository size and commit count if necessary.
def enqueue_repository_cache_update(post_received) def enqueue_repository_cache_update(post_received)
stats_to_invalidate = [:repository_size] stats_to_invalidate = [:repository_size]
stats_to_invalidate << :commit_count if post_received.includes_default_branch? stats_to_invalidate << :commit_count if post_received.includes_default_branch?
...@@ -110,6 +107,9 @@ class PostReceive ...@@ -110,6 +107,9 @@ class PostReceive
user = identify_user(post_received) user = identify_user(post_received)
return false unless user return false unless user
# We only need to expire certain caches once per push
expire_caches(post_received, post_received.project.wiki.repository)
::Git::WikiPushService.new(post_received.project, user, changes: post_received.enum_for(:changes_refs)).execute ::Git::WikiPushService.new(post_received.project, user, changes: post_received.enum_for(:changes_refs)).execute
end end
......
---
title: Fix bug with new wiki not being indexed
merge_request: 18051
author:
type: fixed
...@@ -103,8 +103,7 @@ If you do choose to use EFS, avoid storing GitLab log files (e.g. those in `/var ...@@ -103,8 +103,7 @@ If you do choose to use EFS, avoid storing GitLab log files (e.g. those in `/var
there because this will also affect performance. We recommend that the log files be there because this will also affect performance. We recommend that the log files be
stored on a local volume. stored on a local volume.
For more details on another person's experience with EFS, see For more details on another person's experience with EFS, see this [Commit Brooklyn 2019 video](https://youtu.be/K6OS8WodRBQ?t=313).
[Amazon's Elastic File System: Burst Credits](https://rawkode.com/2017/04/16/amazons-elastic-file-system-burst-credits/)
## Avoid using CephFS and GlusterFS ## Avoid using CephFS and GlusterFS
......
...@@ -847,6 +847,35 @@ the database are preconfigured, but can be customized by setting the associated ...@@ -847,6 +847,35 @@ the database are preconfigured, but can be customized by setting the associated
postgres://user:password@postgres-host:postgres-port/postgres-database postgres://user:password@postgres-host:postgres-port/postgres-database
``` ```
#### Using external PostgreSQL database providers
While Auto DevOps provides out-of-the-box support for a PostgreSQL container for
production environments, for some use-cases it may not be sufficiently secure or
resilient and you may wish to use an external managed provider for PostgreSQL.
For example, AWS Relational Database Service.
You will need to define environment-scoped variables for `POSTGRES_ENABLED` and `DATABASE_URL` in your project's CI/CD settings.
To achieve this:
1. Disable the built-in PostgreSQL installation for the required environments using
scoped [environment variables](../../ci/environments.md#scoping-environments-with-specs).
For this use case, it's likely that only `production` will need to be added to this
list as the builtin PostgreSQL setup for Review Apps and staging will be sufficient
as a high availability setup is not required.
![Auto Metrics](img/disable_postgres.png)
1. Define the `DATABASE_URL` CI variable as a scoped environment variable that will be
available to your application. This should be a URL in the following format:
```yaml
postgres://user:password@postgres-host:postgres-port/postgres-database
```
You will need to ensure that your Kubernetes cluster has network access to wherever
PostgreSQL is hosted.
### Environment variables ### Environment variables
The following variables can be used for setting up the Auto DevOps domain, The following variables can be used for setting up the Auto DevOps domain,
......
...@@ -158,7 +158,7 @@ application for the changes to take effect. ...@@ -158,7 +158,7 @@ application for the changes to take effect.
### JupyterHub ### JupyterHub
> - Introduced in GitLab 11.0 for project-level clusters. > - Introduced in GitLab 11.0 for project-level clusters.
> - Introduced in GitLab 12.3 for group-level clusters. > - Introduced in GitLab 12.3 for group and instance-level clusters.
[JupyterHub](https://jupyterhub.readthedocs.io/en/stable/) is a [JupyterHub](https://jupyterhub.readthedocs.io/en/stable/) is a
multi-user service for managing notebooks across a team. [Jupyter multi-user service for managing notebooks across a team. [Jupyter
...@@ -191,6 +191,7 @@ file. ...@@ -191,6 +191,7 @@ file.
#### Jupyter Git Integration #### Jupyter Git Integration
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/28783) in GitLab 12.0 for project-level clusters. > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/28783) in GitLab 12.0 for project-level clusters.
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/32512) in GitLab 12.3 for group and instance-level clusters.
When installing JupyterHub onto your Kubernetes cluster, [JupyterLab's Git extension](https://github.com/jupyterlab/jupyterlab-git) When installing JupyterHub onto your Kubernetes cluster, [JupyterLab's Git extension](https://github.com/jupyterlab/jupyterlab-git)
is automatically provisioned and configured using the authenticated user's: is automatically provisioned and configured using the authenticated user's:
......
...@@ -125,6 +125,7 @@ The following table depicts the various user permission levels in a project. ...@@ -125,6 +125,7 @@ The following table depicts the various user permission levels in a project.
| Manage Error Tracking | | | | ✓ | ✓ | | Manage Error Tracking | | | | ✓ | ✓ |
| Delete wiki pages | | | | ✓ | ✓ | | Delete wiki pages | | | | ✓ | ✓ |
| View project Audit Events | | | | ✓ | ✓ | | View project Audit Events | | | | ✓ | ✓ |
| Manage [push rules](../push_rules/push_rules.md) | | | | ✓ | ✓ |
| Switch visibility level | | | | | ✓ | | Switch visibility level | | | | | ✓ |
| Transfer project to another namespace | | | | | ✓ | | Transfer project to another namespace | | | | | ✓ |
| Remove project | | | | | ✓ | | Remove project | | | | | ✓ |
......
...@@ -64,8 +64,8 @@ The following quick actions are applicable to descriptions, discussions and thre ...@@ -64,8 +64,8 @@ The following quick actions are applicable to descriptions, discussions and thre
| `/create_merge_request <branch name>` | ✓ | | | Create a new merge request starting from the current issue | | `/create_merge_request <branch name>` | ✓ | | | Create a new merge request starting from the current issue |
| `/relate #issue1 #issue2` | ✓ | | | Mark issues as related **(STARTER)** | | `/relate #issue1 #issue2` | ✓ | | | Mark issues as related **(STARTER)** |
| `/move <path/to/project>` | ✓ | | | Move this issue to another project | | `/move <path/to/project>` | ✓ | | | Move this issue to another project |
| `/zoom <Zoom URL>` | ✓ | | | Add Zoom meeting to this issue. | | `/zoom <Zoom URL>` | ✓ | | | Add Zoom meeting to this issue. ([Introduced in GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/merge_requests/16609)) |
| `/remove_zoom` | ✓ | | | Remove Zoom meeting from this issue. | | `/remove_zoom` | ✓ | | | Remove Zoom meeting from this issue. ([Introduced in GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/merge_requests/16609)) |
| `/target_branch <local branch name>` | | ✓ | | Set target branch | | `/target_branch <local branch name>` | | ✓ | | Set target branch |
| `/wip` | | ✓ | | Toggle the Work In Progress status | | `/wip` | | ✓ | | Toggle the Work In Progress status |
| `/approve` | | ✓ | | Approve the merge request | | `/approve` | | ✓ | | Approve the merge request |
......
...@@ -985,7 +985,7 @@ msgstr "" ...@@ -985,7 +985,7 @@ msgstr ""
msgid "Added" msgid "Added"
msgstr "" msgstr ""
msgid "Added %{epic_ref} as child epic." msgid "Added %{epic_ref} as a child epic."
msgstr "" msgstr ""
msgid "Added %{label_references} %{label_text}." msgid "Added %{label_references} %{label_text}."
...@@ -2934,6 +2934,12 @@ msgstr "" ...@@ -2934,6 +2934,12 @@ msgstr ""
msgid "Cherry-pick this merge request" msgid "Cherry-pick this merge request"
msgstr "" msgstr ""
msgid "Child epic does not exist."
msgstr ""
msgid "Child epic doesn't exist."
msgstr ""
msgid "Choose <strong>Create archive</strong> and wait for archiving to complete." msgid "Choose <strong>Create archive</strong> and wait for archiving to complete."
msgstr "" msgstr ""
...@@ -7700,6 +7706,9 @@ msgstr "" ...@@ -7700,6 +7706,9 @@ msgstr ""
msgid "Given access %{time_ago}" msgid "Given access %{time_ago}"
msgstr "" msgstr ""
msgid "Given epic is already related to this epic."
msgstr ""
msgid "Global Shortcuts" msgid "Global Shortcuts"
msgstr "" msgstr ""
...@@ -11141,6 +11150,12 @@ msgstr "" ...@@ -11141,6 +11150,12 @@ msgstr ""
msgid "Parameter" msgid "Parameter"
msgstr "" msgstr ""
msgid "Parent epic doesn't exist."
msgstr ""
msgid "Parent epic is not present."
msgstr ""
msgid "Part of merge request changes" msgid "Part of merge request changes"
msgstr "" msgstr ""
...@@ -14039,6 +14054,12 @@ msgstr "" ...@@ -14039,6 +14054,12 @@ msgstr ""
msgid "SecurityDashboard| The security dashboard displays the latest security report. Use it to find and fix vulnerabilities." msgid "SecurityDashboard| The security dashboard displays the latest security report. Use it to find and fix vulnerabilities."
msgstr "" msgstr ""
msgid "SecurityDashboard|%{firstProject} and %{secondProject}"
msgstr ""
msgid "SecurityDashboard|%{firstProject}, %{secondProject}, and %{rest}"
msgstr ""
msgid "SecurityDashboard|Confidence" msgid "SecurityDashboard|Confidence"
msgstr "" msgstr ""
...@@ -14060,6 +14081,9 @@ msgstr "" ...@@ -14060,6 +14081,9 @@ msgstr ""
msgid "SecurityDashboard|Severity" msgid "SecurityDashboard|Severity"
msgstr "" msgstr ""
msgid "SecurityDashboard|Unable to add %{invalidProjects}"
msgstr ""
msgid "See metrics" msgid "See metrics"
msgstr "" msgstr ""
...@@ -14297,7 +14321,7 @@ msgstr "" ...@@ -14297,7 +14321,7 @@ msgstr ""
msgid "Session expiration, projects limit and attachment size." msgid "Session expiration, projects limit and attachment size."
msgstr "" msgstr ""
msgid "Set %{epic_ref} as parent epic." msgid "Set %{epic_ref} as the parent epic."
msgstr "" msgstr ""
msgid "Set a default template for issue descriptions." msgid "Set a default template for issue descriptions."
...@@ -14785,6 +14809,9 @@ msgstr "" ...@@ -14785,6 +14809,9 @@ msgstr ""
msgid "Something went wrong, unable to add %{project} to dashboard" msgid "Something went wrong, unable to add %{project} to dashboard"
msgstr "" msgstr ""
msgid "Something went wrong, unable to add projects to dashboard"
msgstr ""
msgid "Something went wrong, unable to get projects" msgid "Something went wrong, unable to get projects"
msgstr "" msgstr ""
...@@ -16134,6 +16161,9 @@ msgstr "" ...@@ -16134,6 +16161,9 @@ msgstr ""
msgid "This environment has no deployments yet." msgid "This environment has no deployments yet."
msgstr "" msgstr ""
msgid "This epic does not exist or you don't have sufficient permission."
msgstr ""
msgid "This feature requires local storage to be enabled" msgid "This feature requires local storage to be enabled"
msgstr "" msgstr ""
...@@ -18342,6 +18372,9 @@ msgstr "" ...@@ -18342,6 +18372,9 @@ msgstr ""
msgid "You don't have any recent searches" msgid "You don't have any recent searches"
msgstr "" msgstr ""
msgid "You don't have sufficient permission to perform this action."
msgstr ""
msgid "You don’t have access to Cycle Analytics for this group" msgid "You don’t have access to Cycle Analytics for this group"
msgstr "" msgstr ""
......
...@@ -43,6 +43,7 @@ describe PostReceive do ...@@ -43,6 +43,7 @@ describe PostReceive do
before do before do
allow_any_instance_of(Gitlab::GitPostReceive).to receive(:identify).and_return(empty_project.owner) allow_any_instance_of(Gitlab::GitPostReceive).to receive(:identify).and_return(empty_project.owner)
# Need to mock here so we can expect calls on project
allow(Gitlab::GlRepository).to receive(:parse).and_return([empty_project, Gitlab::GlRepository::PROJECT]) allow(Gitlab::GlRepository).to receive(:parse).and_return([empty_project, Gitlab::GlRepository::PROJECT])
end end
...@@ -102,7 +103,7 @@ describe PostReceive do ...@@ -102,7 +103,7 @@ describe PostReceive do
end end
it 'expires the status cache' do it 'expires the status cache' do
expect(project).to receive(:empty_repo?).and_return(true) expect(project.repository).to receive(:empty?).and_return(true)
expect(project.repository).to receive(:expire_status_cache) expect(project.repository).to receive(:expire_status_cache)
perform perform
...@@ -300,6 +301,11 @@ describe PostReceive do ...@@ -300,6 +301,11 @@ describe PostReceive do
describe '#process_wiki_changes' do describe '#process_wiki_changes' do
let(:gl_repository) { "wiki-#{project.id}" } let(:gl_repository) { "wiki-#{project.id}" }
before do
# Need to mock here so we can expect calls on project
allow(Gitlab::GlRepository).to receive(:parse).and_return([project, Gitlab::GlRepository::WIKI])
end
it 'updates project activity' do it 'updates project activity' do
# Force Project#set_timestamps_for_create to initialize timestamps # Force Project#set_timestamps_for_create to initialize timestamps
project project
...@@ -314,6 +320,28 @@ describe PostReceive do ...@@ -314,6 +320,28 @@ describe PostReceive do
.and change(project, :last_repository_updated_at) .and change(project, :last_repository_updated_at)
end end
end end
context "branches" do
let(:changes) do
<<~EOF
123456 789012 refs/heads/tést1
123456 789012 refs/heads/tést2
EOF
end
it 'expires the branches cache' do
expect(project.wiki.repository).to receive(:expire_branches_cache).once
perform
end
it 'expires the status cache' do
expect(project.wiki.repository).to receive(:empty?).and_return(true)
expect(project.wiki.repository).to receive(:expire_status_cache)
perform
end
end
end end
context "webhook" do context "webhook" 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