summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorJason Goodman <jgoodman@gitlab.com>2019-07-03 09:12:15 +0000
committerNick Thomas <nick@gitlab.com>2019-07-03 09:12:15 +0000
commit7ecffe2987e0f3953489759d080fc263c5cb95c5 (patch)
treee9a01188b0b731b997a14f795dc44f22a0c7f708 /lib/api
parentd6391c650344af7018de8a3dc6a756b2db9e4f6e (diff)
downloadgitlab-ce-7ecffe2987e0f3953489759d080fc263c5cb95c5.tar.gz
Show upcoming status for releases
Add released_at field to releases API Add released_at column to releases table Return releases to the API sorted by released_at
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/entities.rb2
-rw-r--r--lib/api/releases.rb2
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index d783591c238..b96903d4a8d 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -1186,8 +1186,10 @@ module API
MarkupHelper.markdown_field(entity, :description)
end
expose :created_at
+ expose :released_at
expose :author, using: Entities::UserBasic, if: -> (release, _) { release.author.present? }
expose :commit, using: Entities::Commit, if: lambda { |_, _| can_download_code? }
+ expose :upcoming_release?, as: :upcoming_release
expose :assets do
expose :assets_count, as: :count do |release, _|
diff --git a/lib/api/releases.rb b/lib/api/releases.rb
index 6b17f4317db..fdd8406388e 100644
--- a/lib/api/releases.rb
+++ b/lib/api/releases.rb
@@ -54,6 +54,7 @@ module API
requires :url, type: String
end
end
+ optional :released_at, type: DateTime, desc: 'The date when the release will be/was ready. Defaults to the current time.'
end
post ':id/releases' do
authorize_create_release!
@@ -77,6 +78,7 @@ module API
requires :tag_name, type: String, desc: 'The name of the tag', as: :tag
optional :name, type: String, desc: 'The name of the release'
optional :description, type: String, desc: 'Release notes with markdown support'
+ optional :released_at, type: DateTime, desc: 'The date when the release will be/was ready. Defaults to the current time.'
end
put ':id/releases/:tag_name', requirements: RELEASE_ENDPOINT_REQUIREMETS do
authorize_update_release!