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
df902ebb
Commit
df902ebb
authored
Jun 15, 2020
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Geo::Fdw::GeoNode#job_artifacts method
parent
3b4eb406
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
39 deletions
+0
-39
ee/app/models/geo/fdw/geo_node.rb
ee/app/models/geo/fdw/geo_node.rb
+0
-19
ee/spec/models/geo/fdw/geo_node_spec.rb
ee/spec/models/geo/fdw/geo_node_spec.rb
+0
-20
No files found.
ee/app/models/geo/fdw/geo_node.rb
View file @
df902ebb
...
...
@@ -26,25 +26,6 @@ module Geo
projects
.
inner_join_project_registry
end
def
job_artifacts
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
)
fdw_job_artifact_table
=
Geo
::
Fdw
::
Ci
::
JobArtifact
.
arel_table
inner_join_restricted_job_artifacts
=
cte
.
table
.
join
(
fdw_job_artifact_table
,
Arel
::
Nodes
::
InnerJoin
)
.
on
(
cte
.
table
[
:id
].
eq
(
fdw_job_artifact_table
[
:id
]))
.
join_sources
Geo
::
Fdw
::
Ci
::
JobArtifact
.
with
(
cte
.
to_arel
)
.
from
(
cte
.
table
)
.
joins
(
inner_join_restricted_job_artifacts
)
end
def
projects
return
Geo
::
Fdw
::
Project
.
all
unless
selective_sync?
...
...
ee/spec/models/geo/fdw/geo_node_spec.rb
View file @
df902ebb
...
...
@@ -131,24 +131,4 @@ 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