summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-11 13:22:01 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-11 13:22:16 +0000
commit01496e9337972f1ea0256bcd1e12996edb883e54 (patch)
treeeed61c95985d0afaedf97c9c661018d5cc60d545
parent8db23545d53ecbd4ea6438f59ab12513d873bf18 (diff)
downloadgitlab-ce-01496e9337972f1ea0256bcd1e12996edb883e54.tar.gz
Add latest changes from gitlab-org/gitlab@15-7-stable-ee
-rw-r--r--config/feature_flags/ops/enforce_memory_watchdog.yml2
-rw-r--r--config/feature_flags/ops/gitlab_memory_watchdog.yml8
-rw-r--r--doc/user/project/import/github.md25
-rw-r--r--lib/api/container_registry_event.rb4
-rw-r--r--lib/gitlab/memory/watchdog.rb2
-rw-r--r--spec/lib/gitlab/memory/watchdog_spec.rb10
-rw-r--r--spec/requests/api/container_registry_event_spec.rb13
7 files changed, 29 insertions, 35 deletions
diff --git a/config/feature_flags/ops/enforce_memory_watchdog.yml b/config/feature_flags/ops/enforce_memory_watchdog.yml
index fae127564c9..ae0ab81f9f6 100644
--- a/config/feature_flags/ops/enforce_memory_watchdog.yml
+++ b/config/feature_flags/ops/enforce_memory_watchdog.yml
@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/367534
milestone: '15.2'
type: ops
group: group::application performance
-default_enabled: false
+default_enabled: true
diff --git a/config/feature_flags/ops/gitlab_memory_watchdog.yml b/config/feature_flags/ops/gitlab_memory_watchdog.yml
deleted file mode 100644
index f4c9a489864..00000000000
--- a/config/feature_flags/ops/gitlab_memory_watchdog.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: gitlab_memory_watchdog
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91910
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/367534
-milestone: '15.2'
-type: ops
-group: group::application performance
-default_enabled: false
diff --git a/doc/user/project/import/github.md b/doc/user/project/import/github.md
index 07a21d8b941..c1297cbf554 100644
--- a/doc/user/project/import/github.md
+++ b/doc/user/project/import/github.md
@@ -137,16 +137,27 @@ You can choose to import these items, but this could significantly increase impo
### Select which repositories to import
+> Ability to cancel pending or active imports [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/247325) in GitLab 15.7.
+
After you have authorized access to your GitHub repositories, you are redirected to the GitHub importer page and
your GitHub repositories are listed.
-1. By default, the proposed repository namespaces match the names as they exist in GitHub, but based on your permissions,
- you can choose to edit these names before you proceed to import any of them.
-1. Select the **Import** button next to any number of repositories, or select **Import all repositories**. Additionally,
- you can filter projects by name. If filter is applied, **Import all repositories** only imports matched repositories.
-1. The **Status** column shows the import status of each repository. You can choose to leave the page open and it will
- update in real-time or you can return to it later.
-1. Once a repository has been imported, select its GitLab path to open its GitLab URL.
+By default, the proposed repository namespaces match the names as they exist in GitHub, but based
+on your permissions, you can choose to edit these names before you proceed to import any of them.
+
+To select which repositories to import, next to any number of repositories select **Import** or
+select **Import all repositories**.
+
+Additionally, you can filter projects by name. If a filter is applied, **Import all repositories**
+only imports matched repositories.
+
+The **Status** column shows the import status of each repository. You can choose to keep the page
+open and watch updates in real time or you can return to it later.
+
+To cancel imports that are pending or in progress, next to the imported project, select **Cancel**.
+If the import has already started, the imported files are kept.
+
+To open an repository in GitLab URL after it has been imported, select its GitLab path.
![GitHub importer page](img/import_projects_from_github_importer_v12_3.png)
diff --git a/lib/api/container_registry_event.rb b/lib/api/container_registry_event.rb
index 9e59401ddf6..9467f09e4b6 100644
--- a/lib/api/container_registry_event.rb
+++ b/lib/api/container_registry_event.rb
@@ -34,8 +34,8 @@ module API
end
params do
requires :events, type: Array, desc: 'Event notifications' do
- requires :action, type: String, desc: 'The action to perform, `push`, `delete`',
- values: %w[push delete].freeze
+ requires :action, type: String, desc: 'The action to perform, `push`, `delete`, `pull`',
+ values: %w[push delete pull].freeze
optional :target, type: Hash, desc: 'The target of the action' do
optional :tag, type: String, desc: 'The target tag', documentation: { example: 'latest' }
optional :repository, type: String, desc: 'The target repository', documentation: { example: 'group/p1' }
diff --git a/lib/gitlab/memory/watchdog.rb b/lib/gitlab/memory/watchdog.rb
index 25af5bd781a..aac70a2f6aa 100644
--- a/lib/gitlab/memory/watchdog.rb
+++ b/lib/gitlab/memory/watchdog.rb
@@ -65,7 +65,7 @@ module Gitlab
while @alive
sleep(sleep_time_seconds)
- monitor if Feature.enabled?(:gitlab_memory_watchdog, type: :ops)
+ monitor
end
event_reporter.stopped(log_labels(memwd_reason: @reason).compact)
diff --git a/spec/lib/gitlab/memory/watchdog_spec.rb b/spec/lib/gitlab/memory/watchdog_spec.rb
index 668ea36d420..1603dda0c39 100644
--- a/spec/lib/gitlab/memory/watchdog_spec.rb
+++ b/spec/lib/gitlab/memory/watchdog_spec.rb
@@ -104,16 +104,6 @@ RSpec.describe Gitlab::Memory::Watchdog, :aggregate_failures, feature_category:
watchdog.call
end
- context 'when gitlab_memory_watchdog ops toggle is off' do
- before do
- stub_feature_flags(gitlab_memory_watchdog: false)
- end
-
- it 'does not trigger any monitor' do
- expect(configuration).not_to receive(:monitors)
- end
- end
-
context 'when process does not exceed threshold' do
it 'does not report violations event' do
expect(reporter).not_to receive(:threshold_violated)
diff --git a/spec/requests/api/container_registry_event_spec.rb b/spec/requests/api/container_registry_event_spec.rb
index 32c4b0e9598..64c17bc2eef 100644
--- a/spec/requests/api/container_registry_event_spec.rb
+++ b/spec/requests/api/container_registry_event_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe API::ContainerRegistryEvent, feature_category: :container_registry do
let(:secret_token) { 'secret_token' }
- let(:events) { [{ action: 'push' }] }
+ let(:events) { [{ action: 'push' }, { action: 'pull' }] }
let(:registry_headers) { { 'Content-Type' => ::API::ContainerRegistryEvent::DOCKER_DISTRIBUTION_EVENTS_V1_JSON } }
describe 'POST /container_registry_event/events' do
@@ -19,14 +19,15 @@ RSpec.describe API::ContainerRegistryEvent, feature_category: :container_registr
end
it 'returns 200 status and events are passed to event handler' do
- event = spy(:event)
- allow(::ContainerRegistry::Event).to receive(:new).and_return(event)
- expect(event).to receive(:supported?).and_return(true)
+ allow_next_instance_of(::ContainerRegistry::Event) do |event|
+ if event.supported?
+ expect(event).to receive(:handle!).once
+ expect(event).to receive(:track!).once
+ end
+ end
post_events
- expect(event).to have_received(:handle!).once
- expect(event).to have_received(:track!).once
expect(response).to have_gitlab_http_status(:ok)
end