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
22262be8
Commit
22262be8
authored
May 21, 2020
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose artifacts #locked? in BuildArtifactEntity
parent
68093563
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
app/serializers/build_artifact_entity.rb
app/serializers/build_artifact_entity.rb
+4
-0
spec/serializers/build_artifact_entity_spec.rb
spec/serializers/build_artifact_entity_spec.rb
+4
-0
No files found.
app/serializers/build_artifact_entity.rb
View file @
22262be8
...
@@ -23,6 +23,10 @@ class BuildArtifactEntity < Grape::Entity
...
@@ -23,6 +23,10 @@ class BuildArtifactEntity < Grape::Entity
fast_browse_project_job_artifacts_path
(
project
,
job
)
fast_browse_project_job_artifacts_path
(
project
,
job
)
end
end
expose
:locked
,
if:
->
(
*
)
{
job
.
job_artifacts_archive
.
present?
}
do
|
job
|
job
.
job_artifacts_archive
.
locked?
end
private
private
alias_method
:job
,
:object
alias_method
:job
,
:object
...
...
spec/serializers/build_artifact_entity_spec.rb
View file @
22262be8
...
@@ -30,5 +30,9 @@ describe BuildArtifactEntity do
...
@@ -30,5 +30,9 @@ describe BuildArtifactEntity do
expect
(
subject
[
:browse_path
])
expect
(
subject
[
:browse_path
])
.
to
include
"jobs/
#{
job
.
id
}
/artifacts/browse"
.
to
include
"jobs/
#{
job
.
id
}
/artifacts/browse"
end
end
it
'exposes locked information about artifact'
do
expect
(
subject
).
to
include
(
:locked
)
end
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