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
85632be2
Commit
85632be2
authored
Jul 24, 2020
by
Mike Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Subsume not_expired scope as well
parent
d25b4788
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
12 deletions
+21
-12
ee/app/finders/geo/job_artifact_registry_finder.rb
ee/app/finders/geo/job_artifact_registry_finder.rb
+1
-2
ee/app/models/ee/ci/job_artifact.rb
ee/app/models/ee/ci/job_artifact.rb
+2
-1
ee/spec/models/ee/ci/job_artifact_spec.rb
ee/spec/models/ee/ci/job_artifact_spec.rb
+18
-9
No files found.
ee/app/finders/geo/job_artifact_registry_finder.rb
View file @
85632be2
...
...
@@ -3,8 +3,7 @@
module
Geo
class
JobArtifactRegistryFinder
<
FileRegistryFinder
def
replicables
# TODO move not_expired into replicables scope
::
Ci
::
JobArtifact
.
replicables_for_geo_node
.
not_expired
::
Ci
::
JobArtifact
.
replicables_for_geo_node
end
def
syncable
...
...
ee/app/models/ee/ci/job_artifact.rb
View file @
85632be2
...
...
@@ -75,7 +75,8 @@ module EE
end
def
replicables_for_geo_node
(
node
=
::
Gitlab
::
Geo
.
current_node
)
selective_sync_scope
(
node
).
merge
(
object_storage_scope
(
node
))
not_expired
.
merge
(
selective_sync_scope
(
node
))
.
merge
(
object_storage_scope
(
node
))
end
def
object_storage_scope
(
node
)
...
...
ee/spec/models/ee/ci/job_artifact_spec.rb
View file @
85632be2
...
...
@@ -110,22 +110,31 @@ RSpec.describe Ci::JobArtifact do
# Permutations of sync_object_storage combined with object-stored-artifacts
# are tested in code, because the logic is simple, and to do it in the table
# would quadruple its size and have too much duplication.
where
(
:selective_sync_namespaces
,
:selective_sync_shards
,
:project_factory
,
:include_expectation
)
do
nil
|
nil
|
[
:project
]
|
true
where
(
:selective_sync_namespaces
,
:selective_sync_shards
,
:
factory
,
:
project_factory
,
:include_expectation
)
do
nil
|
nil
|
[
:
ci_job_artifact
]
|
[
:
project
]
|
true
# selective sync by shard
nil
|
:model
|
[
:project
]
|
true
nil
|
:other
|
[
:project
]
|
false
nil
|
:model
|
[
:
ci_job_artifact
]
|
[
:
project
]
|
true
nil
|
:other
|
[
:
ci_job_artifact
]
|
[
:
project
]
|
false
# selective sync by namespace
:model_parent
|
nil
|
[
:project
]
|
true
:model_parent_parent
|
nil
|
[
:project
,
:in_subgroup
]
|
true
:other
|
nil
|
[
:project
]
|
false
:other
|
nil
|
[
:project
,
:in_subgroup
]
|
false
:model_parent
|
nil
|
[
:ci_job_artifact
]
|
[
:project
]
|
true
:model_parent_parent
|
nil
|
[
:ci_job_artifact
]
|
[
:project
,
:in_subgroup
]
|
true
:other
|
nil
|
[
:ci_job_artifact
]
|
[
:project
]
|
false
:other
|
nil
|
[
:ci_job_artifact
]
|
[
:project
,
:in_subgroup
]
|
false
# expired
nil
|
nil
|
[
:ci_job_artifact
,
:expired
]
|
[
:project
]
|
false
# selective sync by shard
nil
|
:model
|
[
:ci_job_artifact
,
:expired
]
|
[
:project
]
|
false
nil
|
:other
|
[
:ci_job_artifact
,
:expired
]
|
[
:project
]
|
false
# selective sync by namespace
:model_parent
|
nil
|
[
:ci_job_artifact
,
:expired
]
|
[
:project
]
|
false
:model_parent_parent
|
nil
|
[
:ci_job_artifact
,
:expired
]
|
[
:project
,
:in_subgroup
]
|
false
:other
|
nil
|
[
:ci_job_artifact
,
:expired
]
|
[
:project
]
|
false
:other
|
nil
|
[
:ci_job_artifact
,
:expired
]
|
[
:project
,
:in_subgroup
]
|
false
end
with_them
do
subject
(
:job_artifact_included
)
{
described_class
.
replicables_for_geo_node
.
include?
(
ci_job_artifact
)
}
let
(
:factory
)
{
[
:ci_job_artifact
]}
let
(
:project
)
{
create
(
*
project_factory
)
}
let
(
:ci_build
)
{
create
(
:ci_build
,
project:
project
)
}
let
(
:node
)
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