Commit d31d53de authored by Shinya Maeda's avatar Shinya Maeda

Merge branch '213678-remove-deprecated-release-evidence-endpoints' into 'master'

Remove deprecated Release Evidence endpoints

See merge request gitlab-org/gitlab!30975
parents 1e638da0 c68e2198
......@@ -19,8 +19,6 @@ module Types
markdown_field :description_html, null: true
field :name, GraphQL::STRING_TYPE, null: true,
description: 'Name of the release'
field :evidence_sha, GraphQL::STRING_TYPE, null: true,
description: "SHA of the release's evidence"
field :created_at, Types::TimeType, null: true,
description: 'Timestamp of when the release was created'
field :released_at, Types::TimeType, null: true,
......
......@@ -81,14 +81,6 @@ class Release < ApplicationRecord
self.milestones.map {|m| m.title }.sort.join(", ")
end
def evidence_sha
evidences.first&.summary_sha
end
def evidence_summary
evidences.first&.summary || {}
end
private
def actual_sha
......
......@@ -43,13 +43,6 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated
edit_project_release_url(project, release)
end
def evidence_file_path
evidence = release.evidences.first
return unless evidence
project_evidence_url(project, release, evidence, format: :json)
end
private
def can_download_code?
......
---
title: Remove deprecated Release Evidence endpoints
merge_request: 30975
author:
type: removed
......@@ -8376,11 +8376,6 @@ type Release {
"""
descriptionHtml: String
"""
SHA of the release's evidence
"""
evidenceSha: String
"""
Milestones associated to the release
"""
......
......@@ -24597,20 +24597,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "evidenceSha",
"description": "SHA of the release's evidence",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "milestones",
"description": "Milestones associated to the release",
......
......@@ -1166,7 +1166,6 @@ Information about pagination in a connection.
| `createdAt` | Time | Timestamp of when the release was created |
| `description` | String | Description (also known as "release notes") of the release |
| `descriptionHtml` | String | The GitLab Flavored Markdown rendering of `description` |
| `evidenceSha` | String | SHA of the release's evidence |
| `name` | String | Name of the release |
| `releasedAt` | Time | Timestamp of when the release was released |
| `tagName` | String! | Name of the tag associated with the release |
......
......@@ -21,7 +21,6 @@ module API
expose :milestones, using: Entities::MilestoneWithStats, if: -> (release, _) { release.milestones.present? && can_read_milestone? }
expose :commit_path, expose_nil: false
expose :tag_path, expose_nil: false
expose :evidence_sha, expose_nil: false, if: ->(_, _) { can_download_code? }
expose :assets do
expose :assets_count, as: :count do |release, _|
......@@ -32,7 +31,6 @@ module API
expose :links, using: Entities::Releases::Link do |release, options|
release.links.sorted
end
expose :evidence_file_path, expose_nil: false, if: ->(_, _) { can_download_code? }
end
expose :evidences, using: Entities::Releases::Evidence, expose_nil: false, if: ->(_, _) { can_download_code? }
expose :_links do
......
......@@ -9,7 +9,7 @@ describe GitlabSchema.types['Release'] do
expected_fields = %w[
tag_name tag_path
description description_html
name evidence_sha milestones author commit
name milestones author commit
created_at released_at
]
......
......@@ -143,38 +143,6 @@ RSpec.describe Release do
end
end
describe '#evidence_sha' do
subject { release.evidence_sha }
context 'when a release was created before evidence collection existed' do
let!(:release) { create(:release) }
it { is_expected.to be_nil }
end
context 'when a release was created with evidence collection' do
let!(:release) { create(:release, :with_evidence) }
it { is_expected.to eq(release.evidences.first.summary_sha) }
end
end
describe '#evidence_summary' do
subject { release.evidence_summary }
context 'when a release was created before evidence collection existed' do
let!(:release) { create(:release) }
it { is_expected.to eq({}) }
end
context 'when a release was created with evidence collection' do
let!(:release) { create(:release, :with_evidence) }
it { is_expected.to eq(release.evidences.first.summary) }
end
end
describe '#milestone_titles' do
let(:release) { create(:release, :with_milestones) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment