Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4add03ac
Commit
4add03ac
authored
Nov 09, 2020
by
Aakriti Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't return boolean for oauth on Geo primary
parent
a4d3e18f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
ee/changelogs/unreleased/ag-fix-oauth-app-for-secondary.yml
ee/changelogs/unreleased/ag-fix-oauth-app-for-secondary.yml
+5
-0
ee/lib/gitlab/geo.rb
ee/lib/gitlab/geo.rb
+1
-1
ee/spec/lib/gitlab/geo_spec.rb
ee/spec/lib/gitlab/geo_spec.rb
+16
-4
No files found.
ee/changelogs/unreleased/ag-fix-oauth-app-for-secondary.yml
0 → 100644
View file @
4add03ac
---
title
:
'
Geo:
Fix
OAuth
failure
on
primary'
merge_request
:
47178
author
:
type
:
fixed
ee/lib/gitlab/geo.rb
View file @
4add03ac
...
@@ -88,7 +88,7 @@ module Gitlab
...
@@ -88,7 +88,7 @@ module Gitlab
end
end
def
self
.
oauth_authentication
def
self
.
oauth_authentication
return
false
unless
Gitlab
::
Geo
.
secondary?
return
unless
Gitlab
::
Geo
.
secondary?
self
.
cache_value
(
:oauth_application
)
do
self
.
cache_value
(
:oauth_application
)
do
Gitlab
::
Geo
.
current_node
.
oauth_application
||
raise
(
OauthApplicationUndefinedError
)
Gitlab
::
Geo
.
current_node
.
oauth_application
||
raise
(
OauthApplicationUndefinedError
)
...
...
ee/spec/lib/gitlab/geo_spec.rb
View file @
4add03ac
...
@@ -143,6 +143,7 @@ RSpec.describe Gitlab::Geo, :geo, :request_store do
...
@@ -143,6 +143,7 @@ RSpec.describe Gitlab::Geo, :geo, :request_store do
end
end
describe
'.oauth_authentication'
do
describe
'.oauth_authentication'
do
context
'for Geo secondary'
do
before
do
before
do
stub_secondary_node
stub_secondary_node
stub_current_geo_node
(
secondary_node
)
stub_current_geo_node
(
secondary_node
)
...
@@ -151,6 +152,17 @@ RSpec.describe Gitlab::Geo, :geo, :request_store do
...
@@ -151,6 +152,17 @@ RSpec.describe Gitlab::Geo, :geo, :request_store do
it_behaves_like
'a Geo cached value'
,
:oauth_authentication
,
:oauth_application
it_behaves_like
'a Geo cached value'
,
:oauth_authentication
,
:oauth_application
end
end
context
'for Geo primary'
do
before
do
stub_current_geo_node
(
primary_node
)
end
it
'returns nil'
do
expect
(
described_class
.
oauth_authentication
).
to
be_nil
end
end
end
describe
'.connected?'
do
describe
'.connected?'
do
context
'when there is a database issue'
do
context
'when there is a database issue'
do
it
'returns false when database connection is down'
do
it
'returns false when database connection is down'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment