diff options
author | Etienne BaquƩ <ebaque@gitlab.com> | 2019-09-03 09:38:59 +0000 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2019-09-03 09:38:59 +0000 |
commit | a43ab8d6a430014e875deb3bff3fd8d8da256747 (patch) | |
tree | 25da7465575e53501737bb0d71709021173f7319 /lib/api | |
parent | de4e2dcafceee485cba9ef6993062b00a4929d2f (diff) | |
download | gitlab-ce-a43ab8d6a430014e875deb3bff3fd8d8da256747.tar.gz |
Added relationships between Release and Milestone
Modified schema via migrations.
Added one-to-one relationship between the two models.
Added changelog file
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/entities.rb | 1 | ||||
-rw-r--r-- | lib/api/releases.rb | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index cfcf6228225..ba58e125568 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -1229,6 +1229,7 @@ module API 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 :milestone, using: Entities::Milestone, if: -> (release, _) { release.milestone.present? } expose :assets do expose :assets_count, as: :count do |release, _| diff --git a/lib/api/releases.rb b/lib/api/releases.rb index 7a3d804c30c..11a9a085068 100644 --- a/lib/api/releases.rb +++ b/lib/api/releases.rb @@ -54,6 +54,7 @@ module API requires :url, type: String end end + optional :milestone, type: String, desc: 'The title of the related milestone' 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 @@ -79,6 +80,7 @@ module API 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.' + optional :milestone, type: String, desc: 'The title of the related milestone' end put ':id/releases/:tag_name', requirements: RELEASE_ENDPOINT_REQUIREMETS do authorize_update_release! |