Skip to content

Commit 514ada7

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent f0e9d20 commit 514ada7

File tree

28 files changed

+1125
-29
lines changed

28 files changed

+1125
-29
lines changed

.gitlab/ci/rules.gitlab-ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,6 +1481,13 @@
14811481
changes: ["vendor/gems/ipynbdiff/**/*"]
14821482
- <<: *if-merge-request-labels-run-all-rspec
14831483

1484+
.vendor:rules:omniauth_crowd:
1485+
rules:
1486+
- <<: *if-merge-request
1487+
changes: ["vendor/gems/omniauth_crowd/**/*"]
1488+
- <<: *if-merge-request-labels-run-all-rspec
1489+
1490+
14841491
.vendor:rules:omniauth-gitlab:
14851492
rules:
14861493
- <<: *if-merge-request

.gitlab/ci/vendored-gems.gitlab-ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ vendor ipynbdiff:
1414
include: vendor/gems/ipynbdiff/.gitlab-ci.yml
1515
strategy: depend
1616

17+
vendor omniauth_crowd:
18+
extends:
19+
- .vendor:rules:omniauth_crowd
20+
needs: []
21+
trigger:
22+
include: vendor/gems/omniauth_crowd/.gitlab-ci.yml
23+
strategy: depend
24+
1725
vendor omniauth-gitlab:
1826
extends:
1927
- .vendor:rules:omniauth-gitlab

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ gem 'omniauth-oauth2-generic', '~> 0.2.2'
5151
gem 'omniauth-saml', '~> 1.10'
5252
gem 'omniauth-shibboleth', '~> 1.3.0'
5353
gem 'omniauth-twitter', '~> 1.4'
54-
gem 'omniauth_crowd', '~> 2.4.0'
54+
gem 'omniauth_crowd', '~> 2.4.0', path: 'vendor/gems/omniauth_crowd' # See vendor/gems/omniauth_crowd/README.md
5555
gem 'omniauth-authentiq', '~> 0.3.3'
5656
gem 'gitlab-omniauth-openid-connect', '~> 0.9.0', require: 'omniauth_openid_connect'
5757
gem 'omniauth-salesforce', '~> 1.0.5'

Gemfile.lock

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ PATH
3131
omniauth (~> 1.0)
3232
omniauth-oauth2 (~> 1.7.1)
3333

34+
PATH
35+
remote: vendor/gems/omniauth_crowd
36+
specs:
37+
omniauth_crowd (2.4.0)
38+
activesupport
39+
nokogiri (>= 1.4.4)
40+
omniauth (~> 1.0, < 3)
41+
3442
GEM
3543
remote: https://rubygems.org/
3644
specs:
@@ -915,10 +923,6 @@ GEM
915923
omniauth-twitter (1.4.0)
916924
omniauth-oauth (~> 1.1)
917925
rack
918-
omniauth_crowd (2.4.0)
919-
activesupport
920-
nokogiri (>= 1.4.4)
921-
omniauth (~> 1.0)
922926
open4 (1.3.4)
923927
openid_connect (1.3.0)
924928
activemodel
@@ -1652,7 +1656,7 @@ DEPENDENCIES
16521656
omniauth-saml (~> 1.10)
16531657
omniauth-shibboleth (~> 1.3.0)
16541658
omniauth-twitter (~> 1.4)
1655-
omniauth_crowd (~> 2.4.0)
1659+
omniauth_crowd (~> 2.4.0)!
16561660
org-ruby (~> 0.9.12)
16571661
pact (~> 1.12)
16581662
parallel (~> 1.19)

app/models/container_registry/event.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class Event
66

77
ALLOWED_ACTIONS = %w(push delete).freeze
88
PUSH_ACTION = 'push'
9+
DELETE_ACTION = 'delete'
910
EVENT_TRACKING_CATEGORY = 'container_registry:notification'
1011

1112
attr_reader :event
@@ -41,6 +42,10 @@ def target_tag?
4142
event['target'].has_key?('tag')
4243
end
4344

45+
def target_digest?
46+
event['target'].has_key?('digest')
47+
end
48+
4449
def target_repository?
4550
!target_tag? && event['target'].has_key?('repository')
4651
end
@@ -53,6 +58,10 @@ def action_push?
5358
PUSH_ACTION == action
5459
end
5560

61+
def action_delete?
62+
DELETE_ACTION == action
63+
end
64+
5665
def container_repository_exists?
5766
return unless container_registry_path
5867

@@ -74,7 +83,7 @@ def project
7483

7584
def update_project_statistics
7685
return unless supported?
77-
return unless target_tag?
86+
return unless target_tag? || (action_delete? && target_digest?)
7887
return unless project
7988

8089
Rails.cache.delete(project.root_ancestor.container_repositories_size_cache_key)

doc/administration/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ Learn how to install, configure, update, and maintain your GitLab instance.
207207

208208
## Troubleshooting
209209

210-
- [Debugging tips](troubleshooting/debug.md): Tips to debug problems when things go wrong.
211210
- [Log system](logs.md): Where to look for logs.
212211
- [Sidekiq Troubleshooting](troubleshooting/sidekiq.md): Debug when Sidekiq appears hung and is not processing jobs.
213212
- [Troubleshooting Elasticsearch](troubleshooting/elasticsearch.md)
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
---
2-
stage: Systems
3-
group: Distribution
4-
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
2+
redirect_to: '../reference_architectures/troubleshooting.md'
3+
remove_date: '2022-10-19'
54
---
65

7-
# Debugging tips **(FREE SELF)**
6+
This document was moved to [another location](../reference_architectures/troubleshooting.md).
87

9-
Sometimes things don't work the way they should. Here are some tips on debugging issues out
10-
in production.
11-
12-
## More information
13-
14-
- [Debugging Stuck Ruby Processes](https://newrelic.com/blog/best-practices/debugging-stuck-ruby-processes-what-to-do-before-you-kill-9)
8+
<!-- This redirect file can be deleted after 2022-10-19. -->
9+
<!-- Redirects that point to other docs in the same project expire in three months. -->
10+
<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
11+
<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->

doc/administration/troubleshooting/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ installation.
2121
- [Linux cheat sheet](linux_cheat_sheet.md)
2222
- [Parsing GitLab logs with `jq`](log_parsing.md)
2323
- [Diagnostics tools](diagnostics_tools.md)
24-
- [Debugging tips](debug.md)
2524
- [Tracing requests with correlation ID](tracing_correlation_id.md)
2625

26+
Some feature documentation pages also have a troubleshooting section at the end
27+
that you can check for feature-specific help.
28+
2729
If you need a testing environment to troubleshoot, see the
2830
[apps for a testing environment](test_environments.md).

doc/api/project_level_variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,5 @@ This parameter is used for filtering by attributes, such as `environment_scope`.
170170
Example usage:
171171

172172
```shell
173-
curl --request DELETE --globoff --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/VARIABLE_1?filter[environment_scope]=production"
173+
curl --globoff --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/VARIABLE_1?filter[environment_scope]=production"
174174
```

doc/api/users.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ NOTE:
5757
Username search is case insensitive.
5858

5959
In addition, you can filter users based on the states `blocked` and `active`.
60-
It does not support `active=false` or `blocked=false`. The list of billable users
61-
is the total number of users minus the blocked users.
60+
It does not support `active=false` or `blocked=false`.
6261

6362
```plaintext
6463
GET /users?active=true

spec/models/container_registry/event_spec.rb

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,18 @@
4040

4141
subject(:handle!) { described_class.new(raw_event).handle! }
4242

43-
it 'enqueues a project statistics update' do
44-
expect(ProjectCacheWorker).to receive(:perform_async).with(project.id, [], [:container_registry_size])
43+
shared_examples 'event with project statistics update' do
44+
it 'enqueues a project statistics update' do
45+
expect(ProjectCacheWorker).to receive(:perform_async).with(project.id, [], [:container_registry_size])
4546

46-
handle!
47-
end
47+
handle!
48+
end
4849

49-
it 'clears the cache for the namespace container repositories size' do
50-
expect(Rails.cache).to receive(:delete).with(group.container_repositories_size_cache_key)
50+
it 'clears the cache for the namespace container repositories size' do
51+
expect(Rails.cache).to receive(:delete).with(group.container_repositories_size_cache_key)
5152

52-
handle!
53+
handle!
54+
end
5355
end
5456

5557
shared_examples 'event without project statistics update' do
@@ -60,10 +62,32 @@
6062
end
6163
end
6264

65+
it_behaves_like 'event with project statistics update'
66+
6367
context 'with no target tag' do
6468
let(:target) { super().without('tag') }
6569

6670
it_behaves_like 'event without project statistics update'
71+
72+
context 'with a target digest' do
73+
let(:target) { super().merge('digest' => 'abc123') }
74+
75+
it_behaves_like 'event without project statistics update'
76+
end
77+
78+
context 'with a delete action' do
79+
let(:action) { 'delete' }
80+
81+
context 'without a target digest' do
82+
it_behaves_like 'event without project statistics update'
83+
end
84+
85+
context 'with a target digest' do
86+
let(:target) { super().merge('digest' => 'abc123') }
87+
88+
it_behaves_like 'event with project statistics update'
89+
end
90+
end
6791
end
6892

6993
context 'with an unsupported action' do
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
workflow:
2+
rules:
3+
- if: $CI_MERGE_REQUEST_ID
4+
5+
.rspec:
6+
cache:
7+
key: omniauth-gitlab-ruby
8+
paths:
9+
- vendor/gems/omniauth_crowd/vendor/ruby
10+
before_script:
11+
- cd vendor/gems/omniauth_crowd
12+
- ruby -v # Print out ruby version for debugging
13+
- gem install bundler --no-document # Bundler is not installed with the image
14+
- bundle config set --local path 'vendor' # Install dependencies into ./vendor/ruby
15+
- bundle config set with 'development'
16+
- bundle install -j $(nproc)
17+
script:
18+
- bundle exec rspec
19+
20+
rspec-2.6:
21+
image: "ruby:2.6"
22+
extends: .rspec
23+
24+
rspec-2.7:
25+
image: "ruby:2.7"
26+
extends: .rspec
27+
28+
rspec-3.0:
29+
image: "ruby:3.0"
30+
extends: .rspec

vendor/gems/omniauth_crowd/Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source 'http://rubygems.org'
2+
3+
# Specify your gem's dependencies in omniauth-github.gemspec
4+
gemspec
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
PATH
2+
remote: .
3+
specs:
4+
omniauth_crowd (2.4.0)
5+
activesupport
6+
nokogiri (>= 1.4.4)
7+
omniauth (~> 1.0, < 3)
8+
9+
GEM
10+
remote: http://rubygems.org/
11+
specs:
12+
activesupport (5.0.0.1)
13+
concurrent-ruby (~> 1.0, >= 1.0.2)
14+
i18n (~> 0.7)
15+
minitest (~> 5.1)
16+
tzinfo (~> 1.1)
17+
addressable (2.5.2)
18+
public_suffix (>= 2.0.2, < 4.0)
19+
concurrent-ruby (1.0.5)
20+
crack (0.4.3)
21+
safe_yaml (~> 1.0.0)
22+
diff-lcs (1.2.5)
23+
hashdiff (0.3.6)
24+
hashie (3.4.3)
25+
i18n (0.8.1)
26+
mini_portile2 (2.1.0)
27+
minitest (5.10.1)
28+
nokogiri (1.6.8.1)
29+
mini_portile2 (~> 2.1.0)
30+
omniauth (1.3.1)
31+
hashie (>= 1.2, < 4)
32+
rack (>= 1.0, < 3)
33+
public_suffix (3.0.0)
34+
rack (1.6.4)
35+
rack-test (0.6.3)
36+
rack (>= 1.0)
37+
rake (10.5.0)
38+
rexml (3.2.5)
39+
rspec (3.0.0)
40+
rspec-core (~> 3.0.0)
41+
rspec-expectations (~> 3.0.0)
42+
rspec-mocks (~> 3.0.0)
43+
rspec-core (3.0.4)
44+
rspec-support (~> 3.0.0)
45+
rspec-expectations (3.0.4)
46+
diff-lcs (>= 1.2.0, < 2.0)
47+
rspec-support (~> 3.0.0)
48+
rspec-mocks (3.0.4)
49+
rspec-support (~> 3.0.0)
50+
rspec-support (3.0.4)
51+
safe_yaml (1.0.4)
52+
thread_safe (0.3.6)
53+
tzinfo (1.2.2)
54+
thread_safe (~> 0.1)
55+
webmock (3.0.1)
56+
addressable (>= 2.3.6)
57+
crack (>= 0.3.2)
58+
hashdiff
59+
60+
PLATFORMS
61+
ruby
62+
63+
DEPENDENCIES
64+
bundler (> 1.0.0)
65+
omniauth_crowd!
66+
rack
67+
rack-test
68+
rake
69+
rexml (~> 3.2.5)
70+
rspec (~> 3.0.0)
71+
webmock (~> 3.0.0)
72+
73+
BUNDLED WITH
74+
2.3.15
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2011 Rob Di Marco
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)