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
df46e1db
Commit
df46e1db
authored
Nov 12, 2019
by
Etienne Baqué
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed asset count update
Rollback changes made on asset count. Fixed release documentation.
parent
abdb9ed2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
21 deletions
+14
-21
app/models/release.rb
app/models/release.rb
+1
-2
app/presenters/release_presenter.rb
app/presenters/release_presenter.rb
+1
-1
doc/api/releases/index.md
doc/api/releases/index.md
+11
-10
lib/api/entities.rb
lib/api/entities.rb
+1
-1
spec/models/release_spec.rb
spec/models/release_spec.rb
+0
-7
No files found.
app/models/release.rb
View file @
df46e1db
...
...
@@ -55,9 +55,8 @@ class Release < ApplicationRecord
def
assets_count
(
except:
[])
links_count
=
links
.
count
sources_count
=
except
.
include?
(
:sources
)
?
0
:
sources
.
count
count
=
links_count
+
sources_count
evidence
.
present?
?
count
+
1
:
count
links_count
+
sources_
count
end
def
sources
...
...
app/presenters/release_presenter.rb
View file @
df46e1db
...
...
@@ -37,7 +37,7 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated
edit_project_release_url
(
project
,
release
)
end
def
evidence_
url
def
evidence_
file_path
return
unless
release_evidence_available?
evidence_project_release_url
(
project
,
tag
,
format: :json
)
...
...
doc/api/releases/index.md
View file @
df46e1db
...
...
@@ -3,6 +3,7 @@
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/41766) in GitLab 11.7.
> - Using this API you can manipulate GitLab's [Release](../../user/project/releases/index.md) entries.
> - For manipulating links as a release asset, see [Release Links API](links.md).
> - Release Evidences were [introduced](https://gitlab.com/gitlab-org/gitlab/issues/26019) in GitLab 12.5.
## List Releases
...
...
@@ -89,7 +90,7 @@ Example response:
"tag_path"
:
"/root/awesome-app/-/tags/v0.11.1"
,
"evidence_sha"
:
"760d6cdfb0879c3ffedec13af470e0f71cf52c6cde4d"
,
"assets"
:{
"count"
:
7
,
"count"
:
6
,
"sources"
:[
{
"format"
:
"zip"
,
...
...
@@ -122,7 +123,7 @@ Example response:
"external"
:
true
}
],
"evidence_
url
"
:
"https://gitlab.example.com/root/awesome-app/-/releases/v0.2/evidence.json"
"evidence_
file_path
"
:
"https://gitlab.example.com/root/awesome-app/-/releases/v0.2/evidence.json"
},
},
{
...
...
@@ -158,7 +159,7 @@ Example response:
},
"evidence_sha"
:
"760d6cdfb0879c3ffedec13af470e0f71cf52c6cde4d"
,
"assets"
:{
"count"
:
5
,
"count"
:
4
,
"sources"
:[
{
"format"
:
"zip"
,
...
...
@@ -180,7 +181,7 @@ Example response:
"links"
:[
],
"evidence_
url
"
:
"https://gitlab.example.com/root/awesome-app/-/releases/v0.1/evidence.json"
"evidence_
file_path
"
:
"https://gitlab.example.com/root/awesome-app/-/releases/v0.1/evidence.json"
},
}
]
...
...
@@ -393,7 +394,7 @@ Example response:
"tag_path"
:
"/root/awesome-app/-/tags/v0.11.1"
,
"evidence_sha"
:
"760d6cdfb0879c3ffedec13af470e0f71cf52c6cde4d"
,
"assets"
:{
"count"
:
6
,
"count"
:
5
,
"sources"
:[
{
"format"
:
"zip"
,
...
...
@@ -420,7 +421,7 @@ Example response:
"external"
:
true
}
],
"evidence_
url
"
:
"https://gitlab.example.com/root/awesome-app/-/releases/v0.3/evidence.json"
"evidence_
file_path
"
:
"https://gitlab.example.com/root/awesome-app/-/releases/v0.3/evidence.json"
},
}
```
...
...
@@ -501,7 +502,7 @@ Example response:
"tag_path"
:
"/root/awesome-app/-/tags/v0.11.1"
,
"evidence_sha"
:
"760d6cdfb0879c3ffedec13af470e0f71cf52c6cde4d"
,
"assets"
:{
"count"
:
5
,
"count"
:
4
,
"sources"
:[
{
"format"
:
"zip"
,
...
...
@@ -523,7 +524,7 @@ Example response:
"links"
:[
],
"evidence_
url
"
:
"https://gitlab.example.com/root/awesome-app/-/releases/v0.1/evidence.json"
"evidence_
file_path
"
:
"https://gitlab.example.com/root/awesome-app/-/releases/v0.1/evidence.json"
},
}
```
...
...
@@ -585,7 +586,7 @@ Example response:
"tag_path"
:
"/root/awesome-app/-/tags/v0.11.1"
,
"evidence_sha"
:
"760d6cdfb0879c3ffedec13af470e0f71cf52c6cde4d"
,
"assets"
:{
"count"
:
5
,
"count"
:
4
,
"sources"
:[
{
"format"
:
"zip"
,
...
...
@@ -607,7 +608,7 @@ Example response:
"links"
:[
],
"evidence_
url
"
:
"https://gitlab.example.com/root/awesome-app/-/releases/v0.1/evidence.json"
"evidence_
file_path
"
:
"https://gitlab.example.com/root/awesome-app/-/releases/v0.1/evidence.json"
},
}
```
...
...
lib/api/entities.rb
View file @
df46e1db
...
...
@@ -1325,7 +1325,7 @@ module API
expose
:links
,
using:
Entities
::
Releases
::
Link
do
|
release
,
options
|
release
.
links
.
sorted
end
expose
:evidence_
url
,
expose_nil:
false
expose
:evidence_
file_path
,
expose_nil:
false
end
expose
:_links
do
expose
:merge_requests_url
,
expose_nil:
false
...
...
spec/models/release_spec.rb
View file @
df46e1db
...
...
@@ -72,13 +72,6 @@ RSpec.describe Release do
expect
(
assets_count
).
to
eq
(
1
)
end
end
context
'when evidence is available'
do
it
'counts this evidence'
,
:sidekiq_inline
do
evidence_count
=
release
.
assets_count
-
release
.
sources
.
count
-
release
.
links
.
count
expect
(
evidence_count
).
to
eq
(
1
)
end
end
end
describe
'#sources'
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