From 2cba93a0d2d12ee36bf98569e5c6c14ac7ea40e0 Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Sat, 21 Nov 2015 17:29:26 +0100 Subject: Make tag API consistent for release feature --- doc/api/tags.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'doc/api') diff --git a/doc/api/tags.md b/doc/api/tags.md index b5b90cf6b82..cf95f87dc3e 100644 --- a/doc/api/tags.md +++ b/doc/api/tags.md @@ -29,7 +29,7 @@ Parameters: ] }, "release": { - "tag": "1.0.0", + "tag_name": "1.0.0", "description": "Amazing release. Wow" }, "name": "v1.0.0", @@ -70,7 +70,7 @@ Parameters: ] }, "release": { - "tag": "1.0.0", + "tag_name": "1.0.0", "description": "Amazing release. Wow" }, "name": "v1.0.0", @@ -89,18 +89,18 @@ It returns 200 if the operation succeed. In case of an error, Add release notes to the existing git tag ``` -PUT /projects/:id/repository/:tag/release +PUT /projects/:id/repository/tags/:tag_name/release ``` Parameters: - `id` (required) - The ID of a project -- `tag` (required) - The name of a tag +- `tag_name` (required) - The name of a tag - `description` (required) - Release notes with markdown support ```json { - "tag": "1.0.0", + "tag_name": "1.0.0", "description": "Amazing release. Wow" } ``` -- cgit v1.2.1 From faef95af1a07bdcfd02eead36d144f332b428f1f Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Sat, 21 Nov 2015 18:08:45 +0100 Subject: API: Return 404 if the tag for a release does not exist --- doc/api/tags.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/api') diff --git a/doc/api/tags.md b/doc/api/tags.md index cf95f87dc3e..ca9e2cef651 100644 --- a/doc/api/tags.md +++ b/doc/api/tags.md @@ -86,7 +86,8 @@ It returns 200 if the operation succeed. In case of an error, ## New release -Add release notes to the existing git tag +Add release notes to the existing git tag. It returns 200 if the release is +created successfully. If the tag does not exist, 404 is returned. ``` PUT /projects/:id/repository/tags/:tag_name/release -- cgit v1.2.1 From 6f7e90f6dba300591281aba08ffbe30ce3cc5c90 Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Sat, 21 Nov 2015 18:51:41 +0100 Subject: Use POST to create a new release instead of PUT --- doc/api/tags.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/api') diff --git a/doc/api/tags.md b/doc/api/tags.md index ca9e2cef651..ab135117250 100644 --- a/doc/api/tags.md +++ b/doc/api/tags.md @@ -84,13 +84,13 @@ It returns 200 if the operation succeed. In case of an error, 405 with an explaining error message is returned. -## New release +## Create a new release -Add release notes to the existing git tag. It returns 200 if the release is +Add release notes to the existing git tag. It returns 201 if the release is created successfully. If the tag does not exist, 404 is returned. ``` -PUT /projects/:id/repository/tags/:tag_name/release +POST /projects/:id/repository/tags/:tag_name/release ``` Parameters: -- cgit v1.2.1 From 3ea05c5b5b253de33d8bf8d615c66e2935b940ef Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Sat, 21 Nov 2015 22:24:34 +0100 Subject: Only allow to create a release if it does not exist yet --- doc/api/tags.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/api') diff --git a/doc/api/tags.md b/doc/api/tags.md index ab135117250..bc61aa1118f 100644 --- a/doc/api/tags.md +++ b/doc/api/tags.md @@ -87,7 +87,8 @@ It returns 200 if the operation succeed. In case of an error, ## Create a new release Add release notes to the existing git tag. It returns 201 if the release is -created successfully. If the tag does not exist, 404 is returned. +created successfully. If the tag does not exist, 404 is returned. If there +already exists a release for the given tag, 409 is returned. ``` POST /projects/:id/repository/tags/:tag_name/release -- cgit v1.2.1 From 04a3d27eaba0312d99e8d88a3a9ee4b5c83ecce1 Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Sat, 21 Nov 2015 22:34:53 +0100 Subject: Allow editing a release in API via PUT method --- doc/api/tags.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'doc/api') diff --git a/doc/api/tags.md b/doc/api/tags.md index bc61aa1118f..085d387e824 100644 --- a/doc/api/tags.md +++ b/doc/api/tags.md @@ -106,3 +106,26 @@ Parameters: "description": "Amazing release. Wow" } ``` + +## Update a release + +Updates the release notes of a given release. It returns 200 if the release is +successfully updated. If the tag or the release does not exist, it returns 404 +with a proper error message. + +``` +PUT /projects/:id/repository/tags/:tag_name/release +``` + +Parameters: + +- `id` (required) - The ID of a project +- `tag_name` (required) - The name of a tag +- `description` (required) - Release notes with markdown support + +```json +{ + "tag_name": "1.0.0", + "description": "Amazing release. Wow" +} +``` \ No newline at end of file -- cgit v1.2.1