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
f86313de
Commit
f86313de
authored
Feb 17, 2020
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GeoNode#job_artifacts guard clause
parent
2ecaf4a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
ee/app/models/geo_node.rb
ee/app/models/geo_node.rb
+1
-1
ee/spec/models/geo_node_spec.rb
ee/spec/models/geo_node_spec.rb
+22
-0
No files found.
ee/app/models/geo_node.rb
View file @
f86313de
...
...
@@ -219,7 +219,7 @@ class GeoNode < ApplicationRecord
end
def
job_artifacts
Ci
::
JobArtifact
.
all
unless
selective_sync?
return
Ci
::
JobArtifact
.
all
unless
selective_sync?
Ci
::
JobArtifact
.
project_id_in
(
projects
)
end
...
...
ee/spec/models/geo_node_spec.rb
View file @
f86313de
...
...
@@ -744,4 +744,26 @@ describe GeoNode, :request_store, :geo, type: :model do
end
end
end
describe
'#job_artifacts'
do
context
'when selective sync is enabled'
do
it
'applies project restriction'
do
node
.
update!
(
selective_sync_type:
'namespaces'
)
expect
(
Ci
::
JobArtifact
).
to
receive
(
:project_id_in
).
once
.
and_call_original
node
.
job_artifacts
end
end
context
'when selective sync is disabled'
do
it
'does not apply project restriction'
do
node
.
update!
(
selective_sync_type:
nil
)
expect
(
Ci
::
JobArtifact
).
not_to
receive
(
:project_id_in
)
node
.
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