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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
6f7e90f6
Commit
6f7e90f6
authored
Nov 21, 2015
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use POST to create a new release instead of PUT
parent
faef95af
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
doc/api/tags.md
doc/api/tags.md
+3
-3
lib/api/tags.rb
lib/api/tags.rb
+1
-1
spec/requests/api/tags_spec.rb
spec/requests/api/tags_spec.rb
+4
-4
No files found.
doc/api/tags.md
View file @
6f7e90f6
...
...
@@ -84,13 +84,13 @@ It returns 200 if the operation succeed. In case of an error,
405 with an explaining error message is returned.
##
N
ew release
##
Create a n
ew release
Add release notes to the existing git tag. It returns 20
0
if the release is
Add release notes to the existing git tag. It returns 20
1
if the release is
created successfully. If the tag does not exist, 404 is returned.
```
P
U
T /projects/:id/repository/tags/:tag_name/release
P
OS
T /projects/:id/repository/tags/:tag_name/release
```
Parameters:
...
...
lib/api/tags.rb
View file @
6f7e90f6
...
...
@@ -48,7 +48,7 @@ module API
# description (required) - Release notes with markdown support
# Example Request:
# PUT /projects/:id/repository/tags/:tag_name/release
p
u
t
':id/repository/tags/:tag_name/release'
,
requirements:
{
tag_name:
/.*/
}
do
p
os
t
':id/repository/tags/:tag_name/release'
,
requirements:
{
tag_name:
/.*/
}
do
authorize_push_project
required_attributes!
[
:description
]
result
=
CreateReleaseService
.
new
(
user_project
,
current_user
).
...
...
spec/requests/api/tags_spec.rb
View file @
6f7e90f6
...
...
@@ -119,21 +119,21 @@ describe API::API, api: true do
end
end
describe
'P
U
T /projects/:id/repository/tags/:tag_name/release'
do
describe
'P
OS
T /projects/:id/repository/tags/:tag_name/release'
do
let
(
:tag_name
)
{
project
.
repository
.
tag_names
.
first
}
let
(
:description
)
{
'Awesome release!'
}
it
'should create description for existing git tag'
do
p
u
t
api
(
"/projects/
#{
project
.
id
}
/repository/tags/
#{
tag_name
}
/release"
,
user
),
p
os
t
api
(
"/projects/
#{
project
.
id
}
/repository/tags/
#{
tag_name
}
/release"
,
user
),
description:
description
expect
(
response
.
status
).
to
eq
(
20
0
)
expect
(
response
.
status
).
to
eq
(
20
1
)
expect
(
json_response
[
'tag_name'
]).
to
eq
(
tag_name
)
expect
(
json_response
[
'description'
]).
to
eq
(
description
)
end
it
'should return 404 if the tag does not exist'
do
p
u
t
api
(
"/projects/
#{
project
.
id
}
/repository/tags/foobar/release"
,
user
),
p
os
t
api
(
"/projects/
#{
project
.
id
}
/repository/tags/foobar/release"
,
user
),
description:
description
expect
(
response
.
status
).
to
eq
(
404
)
...
...
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