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
2ecaf4a2
Commit
2ecaf4a2
authored
Feb 17, 2020
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Geo::Fdw::GeoNode#job_artifacts guard clause
parent
75a095fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
ee/app/models/geo/fdw/geo_node.rb
ee/app/models/geo/fdw/geo_node.rb
+1
-1
ee/spec/models/geo/fdw/geo_node_spec.rb
ee/spec/models/geo/fdw/geo_node_spec.rb
+20
-0
No files found.
ee/app/models/geo/fdw/geo_node.rb
View file @
2ecaf4a2
...
...
@@ -27,7 +27,7 @@ module Geo
end
def
job_artifacts
Geo
::
Fdw
::
Ci
::
JobArtifact
.
all
unless
selective_sync?
return
Geo
::
Fdw
::
Ci
::
JobArtifact
.
all
unless
selective_sync?
query
=
Geo
::
Fdw
::
Ci
::
JobArtifact
.
project_id_in
(
projects
).
select
(
:id
)
cte
=
Gitlab
::
SQL
::
CTE
.
new
(
:restricted_job_artifacts
,
query
)
...
...
ee/spec/models/geo/fdw/geo_node_spec.rb
View file @
2ecaf4a2
...
...
@@ -131,4 +131,24 @@ RSpec.describe Geo::Fdw::GeoNode, :geo, type: :model do
end
end
end
describe
'#job_artifacts'
,
:geo_fdw
do
subject
{
described_class
.
find
(
node
.
id
)
}
context
'when selective sync is enabled'
do
it
'applies a CTE statement'
do
node
.
update!
(
selective_sync_type:
'namespaces'
)
expect
(
subject
.
job_artifacts
.
to_sql
).
to
match
(
/WITH .+restricted_job_artifacts/
)
end
end
context
'when selective sync is disabled'
do
it
'doest not apply a CTE statement'
do
node
.
update!
(
selective_sync_type:
nil
)
expect
(
subject
.
job_artifacts
.
to_sql
).
not_to
match
(
/WITH .+restricted_job_artifacts/
)
end
end
end
end
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